context-cli
Command-line interface for the Context platform.
context-cli is the simplest way to build, inspect, and query Context caches locally or in CI. It is deterministic, scriptable, and designed for automation.
Commands
| Command | Description |
|---|---|
build |
Build a context cache from .md source documents |
resolve |
Resolve context for a query against a built cache |
inspect |
Inspect cache metadata and validity |
Usage
Build a cache
Reads all .md files recursively from --sources and produces a deterministic cache directory at --cache. Use --force to overwrite an existing cache.
Resolve context
Outputs a JSON selection result to stdout. The output is byte-identical across runs for the same cache, query, and budget.
Inspect a cache
Outputs cache metadata as JSON:
Output
resolveandinspectwrite JSON to stdout- Diagnostic messages go to stderr
- All output is deterministic
Exit codes
| Code | Meaning | MCP Error Code |
|---|---|---|
| 0 | Success | — |
| 1 | Usage error (bad arguments) | — |
| 2 | Invalid query | invalid_query |
| 3 | Invalid budget | invalid_budget |
| 4 | Cache missing | cache_missing |
| 5 | Cache invalid | cache_invalid |
| 6 | I/O error | io_error |
| 7 | Internal error | internal_error |
Build
The release binary is named context and placed in dist/.
Spec references
See spec_refs.md for links to the governing specifications.
"Context Engine" is a trademark of Context Engine Contributors. The software is open source under the Apache License 2.0. The trademark is not licensed for use by third parties to market competing products or services without prior written permission.