README
¶
Coding Agent Context CLI
A CLI tool for managing context files for coding agents. It helps you organize prompts, memories (reusable context), and bootstrap scripts that can be assembled into a single context file for AI coding agents.
It's aimed at coding agents with a simple interface for managing task-specific context and reusable knowledge.
Installation
Download the binary for your platform from the release page:
sudo curl -fsL -o /usr/local/bin/coding-agent-context https://github.com/kitproj/coding-agent-context-cli/releases/download/v0.0.1/coding-agent-context_v0.0.1_linux_arm64
sudo chmod +x /usr/local/bin/coding-agent-context
Using Go Install
go install github.com/kitproj/coding-agent-context-cli@latest
Usage
coding-agent-context [options] <task-name>
Options:
-d <directory> Add a directory to include in the context (can be used multiple times)
Default: .coding-agent-context, ~/.config/coding-agent-context, /var/local/coding-agent-context
-o <directory> Output directory for generated files (default: .)
-p <key=value> Template parameter for prompt substitution (can be used multiple times)
Example:
coding-agent-context -p feature="Authentication" -p language=Go add-feature
Quick Start
- Create a context directory structure:
mkdir -p .coding-agent-context/{prompts,memories}
- Create a memory file (
.coding-agent-context/memories/project-info.md):
---
---
# Project Context
- Framework: Go CLI
- Purpose: Manage AI agent context
- Create a prompt file (
.coding-agent-context/prompts/my-task.md):
---
---
# Task: {{ .taskName }}
Please help me with this task. The project uses {{ .language }}.
- Run the tool:
coding-agent-context -p taskName="Fix Bug" -p language=Go my-task
This generates ./prompt.md combining your memories and the task prompt.
Directory Structure
The tool searches these directories for context files (in priority order):
.coding-agent-context/(project-local)~/.config/coding-agent-context/(user-specific)/var/local/coding-agent-context/(system-wide)
Each directory should contain:
.coding-agent-context/
├── prompts/ # Task-specific prompt templates
│ └── <task-name>.md
└── memories/ # Reusable context files (included in all outputs)
└── *.md
File Formats
Prompt Files
Markdown files with YAML frontmatter and Go template support.
Example (.coding-agent-context/prompts/add-feature.md):
---
---
# Task: {{ .feature }}
Implement {{ .feature }} in {{ .language }}.
Run with:
coding-agent-context -p feature="User Login" -p language=Go add-feature
Memory Files
Markdown files included in every generated context. Can include bootstrap scripts in frontmatter.
Example (.coding-agent-context/memories/setup.md):
---
bootstrap: |
#!/bin/bash
npm install
---
# Development Setup
This project requires Node.js dependencies.
Output Files
prompt.md- Combined output with all memories and the task promptbootstrap- Executable script that runs all bootstrap scripts from memoriesbootstrap.d/- Individual bootstrap scripts (SHA256 named)
Run the bootstrap script to set up your environment:
./bootstrap
Examples
Basic Usage
# Create structure
mkdir -p .coding-agent-context/{prompts,memories}
# Add a memory
cat > .coding-agent-context/memories/conventions.md << 'EOF'
---
---
# Coding Conventions
- Use tabs for indentation
- Write tests for all functions
EOF
# Create a task prompt
cat > .coding-agent-context/prompts/refactor.md << 'EOF'
---
---
# Refactoring Task
Please refactor the codebase to improve code quality.
EOF
# Generate context
coding-agent-context refactor
With Template Parameters
cat > .coding-agent-context/prompts/add-feature.md << 'EOF'
---
---
# Add Feature: {{ .featureName }}
Implement {{ .featureName }} in {{ .language }}.
EOF
coding-agent-context -p featureName="Authentication" -p language=Go add-feature
With Bootstrap Scripts
cat > .coding-agent-context/memories/setup.md << 'EOF'
---
bootstrap: |
#!/bin/bash
go mod download
---
# Project Setup
This Go project uses modules.
EOF
coding-agent-context -o ./output my-task
cd output && ./bootstrap
Advanced Usage
Template Functions
Prompts use Go's text/template syntax:
{{ .variableName }} # Simple substitution
{{ if .debug }}Debug mode enabled{{ else }}Production mode{{ end }} # Conditionals
Directory Priority
When the same task exists in multiple directories, the first match wins:
.coding-agent-context/(highest priority)~/.config/coding-agent-context//var/local/coding-agent-context/(lowest priority)
Troubleshooting
"prompt file not found for task"
- Ensure
<task-name>.mdexists in aprompts/subdirectory
"failed to walk memory dir"
mkdir -p .coding-agent-context/memories
Template parameter shows <no value>
coding-agent-context -p myvar="value" my-task
Bootstrap script not executing
chmod +x bootstrap
Documentation
¶
There is no documentation for this package.