Context-as-Code CLI (help/list/compile/validate)
npm install @zebralabs/context-clibash
npm install -g @zebralabs/context-cli
`
$3
After purchasing a pack, you'll receive a download link and authentication token. Install it:
`bash
ctx pack install pack-01-documentation-management \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN_HERE
`
$3
`bash
ctx list
`
You should see your installed pack listed. The pack is now part of your repository and works automatically with Cursor and Claude.
$3
Ask Cursor or Claude to generate documentation following your standards:
`
Generate a component specification following our documentation standards
`
AI will automatically use your installed standards — no re-explaining needed.
> Need a pack? Browse available packs at zebralabs.io/context-packs
Commands
$3
Show help information and command usage.
`bash
ctx help
`
$3
Install a context pack into your repository.
Options:
- --repo-root — Repository root directory (default: auto-detect)
- --mode — File merge mode (default: SkipExisting)
- --zip — Install from local ZIP file
- --registry — Registry URL for downloading packs
- --token — Authentication token for registry
- --version — Specific pack version (default: latest)
Examples:
Install from registry (requires token):
`bash
ctx pack install pack-01-documentation-management \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN
`
Install specific version:
`bash
ctx pack install pack-01-documentation-management \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN \
--version 0.4.0
`
Install from local ZIP (for testing):
`bash
ctx pack install pack-01-documentation-management \
--zip ./pack-01-documentation-management-v0.4.0.zip
`
What happens:
- Pack files are extracted and merged into docs/practices-and-standards/
- Cursor rules (.cursor/rules/) are copied to repository root
- Cursor skills (.cursor/skills/) are copied to repository root
- CLAUDE.md is copied to repository root
- context.yaml is created/updated with pack information
$3
List all installed context packs and their contributions.
`bash
ctx list
`
Output:
`
Installed Context Packs
-----------------------
- pack-01-documentation-management @ 0.4.0
Contributes:
- docs/practices-and-standards/01-engineering-practices/01-documentation-methodology
- docs/practices-and-standards/01-engineering-practices/00-methodologies
`
Options:
- --context-yaml — Path to context.yaml file (default: auto-detect)
$3
Compile standards from installed packs into consolidated outputs.
Options:
- --pack — Compile a specific pack only
- --context-yaml — Path to context.yaml file (default: auto-detect)
Examples:
Compile all installed packs:
`bash
ctx compile
`
Compile a specific pack:
`bash
ctx compile --pack pack-01-documentation-management
`
Output:
- docs/practices-and-standards/.compiled/system-prompt.md — Consolidated standards
- docs/practices-and-standards/.compiled/sources.md — Source file list
- docs/practices-and-standards/.compiled/report.md — Compilation report
Pack-specific compilation:
When using --pack, outputs are generated in the pack directory:
- docs/practices-and-standards/packs/ — Cursor rules
- docs/practices-and-standards/packs/ — Cursor skills
- docs/practices-and-standards/packs/ — Claude instructions
- docs/practices-and-standards/packs/ — Human-readable standards
$3
Validate your context.yaml configuration and installed packs.
`bash
ctx validate
`
Checks:
- Schema version compatibility
- Installed pack manifests exist
- Precedence list references valid packs
- Pack file structure integrity
Options:
- --context-yaml — Path to context.yaml file (default: auto-detect)
$3
Show the CLI version.
`bash
ctx version
or
ctx -v
or
ctx --version
`
How It Works
$3
After installing a pack, your repository structure looks like:
`
your-repo/
├── .cursor/
│ ├── rules/ # Cursor rules (auto-loaded)
│ │ ├── index.md
│ │ └── doc-process.md
│ └── skills/ # Cursor skills (on-demand)
│ └── Domain Discovery Process/
│ └── SKILL.md
├── CLAUDE.md # Claude instructions
├── docs/
│ └── practices-and-standards/
│ ├── context.yaml # Pack registry and configuration
│ ├── 01-engineering-practices/
│ │ ├── 00-methodologies/
│ │ └── 01-documentation-methodology/
│ └── packs/
│ └── pack-01-documentation-management/
│ ├── pack.yaml
│ └── ...
└── ...
`
$3
The context.yaml file tracks installed packs and their precedence:
`yaml
schema: context-install/v1
registry: https://www.zebralabs.io/api
installed_packs:
- id: pack-01-documentation-management
version: 0.4.0
manifest: docs/practices-and-standards/packs/pack-01-documentation-management/pack.yaml
precedence:
- pack-01-documentation-management
`
Precedence: When multiple packs define conflicting rules, packs listed earlier in precedence take priority.
$3
Cursor:
- Rules in .cursor/rules/ are automatically loaded — AI follows them in every conversation
- Skills in .cursor/skills/ are available on-demand — invoke by name when needed
- Methodology files in docs/practices-and-standards/ are indexed automatically
Claude:
- CLAUDE.md provides consolidated standards at repository root
- Methodology files can be referenced in conversations
- Standards are version-controlled with your code
Examples & Workflows
$3
`bash
1. Install CLI
npm install -g @zebralabs/context-cli
2. Install pack (after purchase)
ctx pack install pack-01-documentation-management \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN
3. Verify
ctx list
4. Start using with Cursor/Claude
AI now automatically follows your standards
`
$3
`bash
Install newer version
ctx pack install pack-01-documentation-management \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN \
--version 0.5.0 \
--mode Overwrite
Recompile to regenerate assets
ctx compile --pack pack-01-documentation-management
`
$3
`bash
Install from local ZIP (for pack development/testing)
ctx pack install pack-01-documentation-management \
--zip ./my-pack-v0.1.0.zip \
--mode Overwrite
Compile to test asset generation
ctx compile --pack pack-01-documentation-management
`
$3
`bash
Install first pack
ctx pack install pack-01-documentation-management \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN
Install second pack (when available)
ctx pack install pack-02-pr-review \
--registry https://www.zebralabs.io/api \
--token YOUR_TOKEN
Set precedence (edit context.yaml manually or via future command)
Then compile all packs
ctx compile
`
Troubleshooting
$3
Problem: CLI can't locate context.yaml in your repository.
Solutions:
- Ensure you're running commands from your repository root
- Use --context-yaml to specify the path explicitly
- Check that context.yaml exists in docs/practices-and-standards/ or practices-and-standards/
$3
Problem: Installed pack's pack.yaml file is missing.
Solutions:
- Reinstall the pack: ctx pack install
- Check that the pack directory exists in docs/practices-and-standards/packs/
$3
Problem: Registry installation requires authentication token.
Solutions:
- Ensure you have a valid token from your pack purchase
- Use --token YOUR_TOKEN flag
- For local testing, use --zip instead
$3
Problem: Files weren't copied during installation.
Solutions:
- Check installation mode: --mode SkipExisting skips existing files
- Use --mode Overwrite to replace existing files
- Check merge report in docs/practices-and-standards/.install/
$3
Problem: ctx compile fails with module errors.
Solutions:
- Ensure you're running from the repository root
- Check Node.js version (requires Node.js 18+)
- Verify all pack files are intact: ctx validate
- Try compiling a specific pack: ctx compile --pack
Advanced Usage
$3
To develop your own packs:
1. Create pack structure following the standard format
2. Include pack.yaml manifest with contributes.roots
3. Include install.ps1 installer script
4. Test installation: ctx pack install
5. Test compilation: ctx compile --pack
$3
Edit docs/practices-and-standards/context.yaml to set pack precedence:
`yaml
precedence:
- pack-01-documentation-management # Highest priority
- pack-02-pr-review # Lower priority
`
Packs listed earlier take precedence when rules conflict.
$3
Use a custom registry for private or internal packs:
`bash
ctx pack install my-pack \
--registry https://my-company.com/api \
--token INTERNAL_TOKEN
`
Or set default registry in context.yaml:
`yaml
registry: https://my-company.com/api
`
What's to Come
We're actively developing new features to make Context CLI even more powerful. Here's what's coming:
$3
- Rule Extraction — Automatic extraction of structured rules from markdown documents using @context.rules markers
- Conflict Detection — Intelligent detection of conflicting rules across multiple packs
- Semantic Conflict Resolution — Beyond ID-based conflicts, detect when rules semantically conflict
- Custom Documentation Support — Include your own custom standards alongside installed packs
- Change Tracking — Only recompile what's changed since last compilation
$3
- Interactive Conflict Resolution — Guided workflow for resolving conflicts between packs
- Granular Precedence — Set precedence at rule level, not just pack level
- Conflict Reports — Detailed reports showing all conflicts and resolutions
- Pack Dependencies — Declare dependencies between packs
$3
- Precedence Management — CLI commands to manage pack precedence without editing YAML
- Pack Updates — ctx pack update command to update all packs to latest versions
- Pack Removal — ctx pack uninstall to cleanly remove packs
- Better Error Messages — More helpful error messages with suggested fixes
- Progress Indicators — Visual feedback during long operations
$3
- GitHub Copilot Support — Generate .github/copilot-instructions.md` from compiled standards