@contextpack/cli
v1.0.1
Published
npm for AI agent context files — install, share, and manage CLAUDE.md / .cursorrules / AGENTS.md as versioned dependencies
Downloads
296
Maintainers
Readme
contextpack
The package manager for AI agent context files.
What is contextpack?
contextpack manages context files for AI coding assistants (Claude Code, Cursor, Windsurf, Codex, GitHub Copilot). Instead of manually maintaining CLAUDE.md, .cursorrules, and other tool-specific files, you install packs from a registry and generate consolidated context files.
Installation
npm install -g @contextpack/cliQuick Start
# Initialize contextpack in your project
contextpack init
# Add packs
contextpack add community/typescript
contextpack add community/react
contextpack add community/nextjs
# Generate context files for your AI tools
contextpack generateThis creates:
CLAUDE.mdfor Claude Code.cursor/rules/contextpack.mdcfor Cursor.windsurfrulesfor WindsurfAGENTS.mdfor OpenAI Codex.github/copilot-instructions.mdfor GitHub Copilot
Commands
contextpack init
Initialize contextpack in your project. Creates .contextpack/manifest.yaml and .contextpack/overrides.md. Prompts for which AI tools to configure.
contextpack initcontextpack add <pack>
Add a pack from the registry. Resolves the latest version and caches it locally.
contextpack add community/typescript
contextpack add community/[email protected] # specific versioncontextpack generate
Generate context files from installed packs. Merges all pack rules with your project overrides and writes to each enabled tool's output file.
contextpack generatecontextpack remove <pack>
Remove a pack from your project and regenerate context files.
contextpack remove community/typescriptcontextpack update
Check for pack updates and apply them.
contextpack update
contextpack update --dry-run # see what would change
contextpack update --pack community/typescript # update specific packcontextpack inspect
Show project configuration: installed packs, enabled targets, overrides status.
contextpack inspect
contextpack inspect --json # machine-readable outputcontextpack search <query>
Search the pack registry.
contextpack search typescript
contextpack search react --limit 10contextpack login
Authenticate with the contextpack registry via GitHub OAuth.
contextpack logincontextpack publish
Publish a pack to the registry. Requires a pack.yaml in the current directory.
contextpack publishProject Structure
After running contextpack init and contextpack add:
my-project/
├── CLAUDE.md # generated
├── .cursor/rules/contextpack.mdc # generated
├── .contextpack/
│ ├── manifest.yaml # project state (commit this)
│ ├── overrides.md # project customizations (commit this)
│ └── cache/ # cached pack content (gitignore)
└── .gitignore # updated with .contextpack/cache/Manifest
.contextpack/manifest.yaml stores project configuration:
version: 1
project:
name: my-project
mode: managed
targets:
- id: claude-code
enabled: true
- id: cursor
enabled: true
- id: windsurf
enabled: false
packs:
- id: community/typescript
version: 1.0.0
source: community
- id: community/react
version: 1.0.0
source: community
overrides:
file: .contextpack/overrides.mdOverrides
.contextpack/overrides.md lets you customize pack rules for your project:
# Project Overrides
## React
- Use class components instead of hooks
- No server components
## Testing
- Skip tests for utility functionsOverrides appear last in generated context files, so AI models treat them as higher priority.
Generated Files
Generated files contain a managed block:
# Your existing content above (preserved)
<!-- contextpack:managed:start -->
## TypeScript
...pack content...
## React
...pack content...
## Project Overrides
...your overrides...
<!-- contextpack:managed:end -->
# Your existing content below (preserved)Only the managed block is updated. Your own content outside the markers is never touched.
Creating a Pack
Create a directory with:
pack.yaml— pack metadatarules.md— pack content (markdown)
pack.yamlformat:
scope: community
name: my-pack
version: 1.0.0
description: "Description of your pack"
tags: [tag1, tag2]
files: rules.md- Publish:
contextpack login
contextpack publishAvailable Packs
Browse packs at contextpack.dev or use:
contextpack search <query>License
MIT
