@@ -29,7 +29,14 @@ You can either use the scripts directly from this folder or add them to your PAT
2929Generates contextual information from a codebase to send to an LLM.
3030
3131``` bash
32- ./context --files=" src/components/*.js" --exclude=" *.test.js" --max-size=300KB --depth=2 --include-git > context.txt
32+ # Using file patterns
33+ ./context --include=" src/*.js" --exclude=" *.test.js" > context.md
34+
35+ # Using direct patterns as arguments
36+ ./context " src/*.js" " README.md" > context.md
37+
38+ # Including git information
39+ ./context --include=" src/*.js" --git > context.md
3340```
3441
3542[ See full documentation for context] ( ./docs/context.md )
@@ -49,7 +56,7 @@ cat llm_response.md | ./apply-md --dry-run --verbose
4956Generates git-related context to help LLMs create meaningful commit messages.
5057
5158``` bash
52- ./git-context --diff -- recent-commits=2 --prompt --conventional > commit_context.txt
59+ ./git-context --recent-commits=5 --prompt=prompts/conventional_commit.txt > commit_context.txt
5360```
5461
5562[ See full documentation for git-context] ( ./docs/git-context.md )
@@ -62,7 +69,7 @@ These tools are designed to work seamlessly in Unix pipelines, allowing you to c
6269
6370``` bash
6471# Copy code context directly to clipboard (macOS)
65- ./context --files =" src/api/*.js" | pbcopy
72+ ./context --include =" src/api/*.js" | pbcopy
6673
6774# Generate and apply code changes directly from clipboard (macOS)
6875pbpaste | ./apply-md
@@ -71,7 +78,7 @@ pbpaste | ./apply-md
7178git commit -am " $( ./git-context | llm -m openrouter/anthropic/claude-3.5-haiku) " -e
7279
7380# Stream context to an LLM and apply changes in one command
74- ./context --files =" src/components/Button.js" | llm " Refactor this component to use hooks" | ./apply-md
81+ ./context --include =" src/components/Button.js" | llm " Refactor this component to use hooks" | ./apply-md
7582```
7683
7784### Scenario: Bug Fix Workflow
@@ -81,7 +88,7 @@ Let's walk through a complete workflow for fixing a bug:
81881 . Identify the files involved in the bug:
8289 ``` bash
8390 # Generate context for the relevant files
84- ./context --files =" src/utils/validation.js" --files =" src/components/Form.js" --depth=1 | pbcopy
91+ ./context --include =" src/utils/validation.js" --include =" src/components/Form.js" | pbcopy
8592 ```
8693
87942 . Paste the context into your preferred AI assistant's web UI with your request:
@@ -96,7 +103,7 @@ Let's walk through a complete workflow for fixing a bug:
961034 . Generate an appropriate commit message:
97104 ``` bash
98105 # Auto-generate semantically meaningful commit message
99- ./git-context --diff | llm " Generate a conventional commit message" | git commit -F -
106+ ./git-context | llm " Generate a conventional commit message" | git commit -F -
100107
101108 # Or with manual editing
102109 git commit -am " $( ./git-context | llm " Write a commit message" ) " -e
@@ -108,7 +115,7 @@ When working on larger refactoring tasks:
108115
1091161 . Generate context with git history for better understanding:
110117 ``` bash
111- ./context --files =" src/utils/parser.js" --depth=1 --include- git --git-depth=5 > parser_context.txt
118+ ./context --include =" src/utils/parser.js" --git > parser_context.txt
112119 ```
113120
1141212 . Send the context to an LLM with your request (e.g., "Refactor this parser to improve performance")
@@ -122,7 +129,7 @@ When working on larger refactoring tasks:
122129
1231304 . Generate commit context and message in one step:
124131 ``` bash
125- git commit -am " $( ./git-context --diff --conventional | llm " Generate a detailed commit message" ) " -e
132+ git commit -am " $( ./git-context --prompt=prompts/conventional_commit.txt | llm " Generate a detailed commit message" ) " -e
126133 ```
127134
128135## Customization
@@ -138,7 +145,7 @@ You can create your own prompt templates for different scenarios:
138145echo " Please review this code and identify potential bugs and security issues." > prompts/review_prompt.txt
139146
140147# Use your custom prompt with the context generator
141- ./context --files =" src/*.js" | cat - prompts/review_prompt.txt | llm
148+ ./context --include =" src/*.js" | cat - prompts/review_prompt.txt | llm
142149```
143150
144151### Integration with Other Tools
0 commit comments