From 996933e68704f2f693e7e4dba172a582beb41a49 Mon Sep 17 00:00:00 2001 From: Kayvan Sylvan Date: Mon, 5 Jan 2026 08:35:25 -0800 Subject: [PATCH] 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 --- README.md | 8 ++++---- cmd/{code_helper => code2context}/code.go | 0 cmd/{code_helper => code2context}/code_test.go | 0 cmd/{code_helper => code2context}/main.go | 18 +++++++++--------- data/patterns/create_coding_feature/README.md | 14 +++++++------- 5 files changed, 20 insertions(+), 20 deletions(-) rename cmd/{code_helper => code2context}/code.go (100%) rename cmd/{code_helper => code2context}/code_test.go (100%) rename cmd/{code_helper => code2context}/main.go (79%) diff --git a/README.md b/README.md index da6b72ed..b6759da8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/cmd/code_helper/code.go b/cmd/code2context/code.go similarity index 100% rename from cmd/code_helper/code.go rename to cmd/code2context/code.go diff --git a/cmd/code_helper/code_test.go b/cmd/code2context/code_test.go similarity index 100% rename from cmd/code_helper/code_test.go rename to cmd/code2context/code_test.go diff --git a/cmd/code_helper/main.go b/cmd/code2context/main.go similarity index 79% rename from cmd/code_helper/main.go rename to cmd/code2context/main.go index 0b34f9e9..07a2e8fe 100644 --- a/cmd/code_helper/main.go +++ b/cmd/code2context/main.go @@ -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: \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] - | code_helper [options] + code2context [options] + | code2context [options] 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: `) diff --git a/data/patterns/create_coding_feature/README.md b/data/patterns/create_coding_feature/README.md index a1b17d1f..6311415c 100644 --- a/data/patterns/create_coding_feature/README.md +++ b/data/patterns/create_coding_feature/README.md @@ -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