docs: rename code_helper to code2context across documentation and CLI

- Rename `code_helper` command to `code2context` throughout codebase
- Update README.md table of contents and references
- Update installation instructions with new binary name
- Update all usage examples in main.go help text
- Update create_coding_feature pattern documentation
- Rename cmd directory from code_helper to code2context
This commit is contained in:
Kayvan Sylvan
2026-01-05 08:35:25 -08:00
parent 8806f4c2f4
commit 996933e687
5 changed files with 20 additions and 20 deletions

View File

@@ -185,7 +185,7 @@ Keep in mind that many of these were recorded when Fabric was Python-based, so r
- [Helper Apps](#helper-apps)
- [`to_pdf`](#to_pdf)
- [`to_pdf` Installation](#to_pdf-installation)
- [`code_helper`](#code_helper)
- [`code2context`](#code2context)
- [pbpaste](#pbpaste)
- [Web Interface (Fabric Web App)](#web-interface-fabric-web-app)
- [Meta](#meta)
@@ -904,9 +904,9 @@ go install github.com/danielmiessler/fabric/cmd/to_pdf@latest
Make sure you have a LaTeX distribution (like TeX Live or MiKTeX) installed on your system, as `to_pdf` requires `pdflatex` to be available in your system's PATH.
### `code_helper`
### `code2context`
`code_helper` is used in conjunction with the `create_coding_feature` pattern.
`code2context` is used in conjunction with the `create_coding_feature` pattern.
It generates a `json` representation of a directory of code that can be fed into an AI model
with instructions to create a new feature or edit the code in a specified way.
@@ -915,7 +915,7 @@ See [the Create Coding Feature Pattern README](./data/patterns/create_coding_fea
Install it first using:
```bash
go install github.com/danielmiessler/fabric/cmd/code_helper@latest
go install github.com/danielmiessler/fabric/cmd/code2context@latest
```
## pbpaste

View File

@@ -27,7 +27,7 @@ func main() {
// Stdin mode: read file list from stdin, instructions from argument
if flag.NArg() != 1 {
fmt.Fprintf(os.Stderr, "Error: When piping file list via stdin, provide exactly 1 argument: <instructions>\n")
fmt.Fprintf(os.Stderr, "Usage: find . -name '*.go' | code_helper \"instructions\"\n")
fmt.Fprintf(os.Stderr, "Usage: find . -name '*.go' | code2context \"instructions\"\n")
os.Exit(1)
}
@@ -90,18 +90,18 @@ func main() {
}
func printUsage() {
fmt.Fprintf(os.Stderr, `code_helper - Code project scanner for use with Fabric AI
fmt.Fprintf(os.Stderr, `code2context - Code project scanner for use with Fabric AI
Usage:
code_helper [options] <directory> <instructions>
<file_list> | code_helper [options] <instructions>
code2context [options] <directory> <instructions>
<file_list> | code2context [options] <instructions>
Examples:
code_helper . "Add input validation to all user inputs"
code_helper -depth 4 ./my-project "Implement error handling"
code_helper -out project.json ./src "Fix security issues"
find . -name '*.go' | code_helper "Refactor error handling"
git ls-files '*.py' | code_helper "Add type hints"
code2context . "Add input validation to all user inputs"
code2context -depth 4 ./my-project "Implement error handling"
code2context -out project.json ./src "Fix security issues"
find . -name '*.go' | code2context "Refactor error handling"
git ls-files '*.py' | code2context "Add type hints"
Options:
`)

View File

@@ -4,10 +4,10 @@ Generate code changes to an existing coding project using AI.
## Installation
After installing the `code_helper` binary:
After installing the `code2context` binary:
```bash
go install github.com/danielmiessler/fabric/cmd/code_helper@latest
go install github.com/danielmiessler/fabric/cmd/code2context@latest
```
## Usage
@@ -15,18 +15,18 @@ go install github.com/danielmiessler/fabric/cmd/code_helper@latest
The create_coding_feature allows you to apply AI-suggested code changes directly to your project files. Use it like this:
```bash
code_helper [project_directory] "[instructions for code changes]" | fabric --pattern create_coding_feature
code2context [project_directory] "[instructions for code changes]" | fabric --pattern create_coding_feature
```
For example:
```bash
code_helper . "Create a simple Hello World C program in file main.c" | fabric --pattern create_coding_feature
code2context . "Create a simple Hello World C program in file main.c" | fabric --pattern create_coding_feature
```
## How It Works
1. `code_helper` scans your project directory and creates a JSON representation
1. `code2context` scans your project directory and creates a JSON representation
2. The AI model analyzes your project structure and instructions
3. AI generates file changes in a standard format
4. Fabric parses these changes and prompts you to confirm
@@ -36,7 +36,7 @@ code_helper . "Create a simple Hello World C program in file main.c" | fabric --
```bash
# Request AI to create a Hello World program
code_helper . "Create a simple Hello World C program in file main.c" | fabric --pattern create_coding_feature
code2context . "Create a simple Hello World C program in file main.c" | fabric --pattern create_coding_feature
# Review the changes made to your project
git diff
@@ -52,7 +52,7 @@ git commit -s -m "Add Hello World program"
### Security Enhancement Example
```bash
code_helper . "Ensure that all user input is validated and sanitized before being used in the program." | fabric --pattern create_coding_feature
code2context . "Ensure that all user input is validated and sanitized before being used in the program." | fabric --pattern create_coding_feature
git diff
make check
git add <changed files>