context-compiler-cli
raw JSON → 0.2.3 verified Fri May 01 auth: no javascript
Context-compiler-cli is a CLI tool for analyzing, linting, and deterministically optimizing LLM prompt/context files. Current stable version is 0.2.3, released with active development cadence. It provides commands like compact, analyze, lint, and optimize, with tokenizer options (char, o200k_base). Differentiators include deterministic compaction preview and config persistence without JSON editing. Requires Node >=18.
Common errors
error command not found: ctxc ↓
cause npm global install not in PATH or not installed globally
fix
Run npm install -g context-compiler-cli or use npx ctxc
error Error: Could not resolve tokenizer 'o200k_base' ↓
cause Tokenizer name misspelled or not available in current version
fix
Use valid tokenizer: char or o200k_base; check spelling.
Warnings
breaking Requires Node >=18; older versions will fail. ↓
fix Upgrade Node to 18+ with nvm install 18
gotcha Token option 'o200k_base' may produce different results than 'char'; not a bug but intended behavior. ↓
fix Specify desired tokenizer with --tokenizer flag or config set.
deprecated Using 'context-compiler' command instead of 'ctxc' may be deprecated in future versions. ↓
fix Use ctxc for all commands.
Install
npm install context-compiler-cli yarn add context-compiler-cli pnpm add context-compiler-cli Imports
- cli wrong
npm install context-compiler-cli --savecorrectnpx ctxc --help - ctxc wrong
context-compiler analyze file.mdcorrectctxc analyze file.md --tokenizer o200k_base - context-compiler
context-compiler --help
Quickstart
npm install -g context-compiler-cli
ctxc --help
ctxc compact --text "You are helpful. You are helpful."