context-cliis the command-line interface for the Context platform. It provides a deterministic, scriptable tool for building, inspecting, and auditing context caches across local development and CI/CD pipelines.
The CLI is the build-time control plane for deterministic context infrastructure. Determinism guarantees that identical inputs produce byte-identical outputs across machines, operating systems, and supported Rust versions.
- CI/CD Native: Seamlessly build context caches as build artifacts in your deployment pipeline.
- Auditable: Inspect cache manifests and content hashes to ensure context integrity.
- Reproducible: Every
resolveoperation is byte-identical to the results seen by your deployed AI agents. - On-Prem Ready: Works entirely offline with zero network dependencies.
- Platform Engineers managing AI infrastructure
- CI/CD Pipelines producing deterministic context artifacts
- Security & Compliance Teams auditing agent inputs
| Command | Responsibility |
|---|---|
build |
Compile .md source documents into a deterministic, content-addressed cache. |
resolve |
Execute the selection engine locally to verify agent retrieval behavior. |
inspect |
Validate cache integrity and view metadata snapshots. |
context build --sources ./docs --cache ./my-cacheRecursively ingests markdown documents and produces an immutable cache directory. The cache contains all data required for deterministic selection, eliminating runtime indexing or external dependencies.
context resolve --cache ./my-cache --query "deployment architecture" --budget 4000Verify exactly what context an agent will receive for a specific query and token budget. Results are output as JSON.
context inspect --cache ./my-cacheExample JSON output:
{
"cache_version": "v0",
"document_count": 42,
"total_bytes": 102400,
"valid": true
}Use the CLI to build context caches as part of your deployment artifacts:
# Example CI build step
context build --sources ./docs --cache ./dist/context-cache
context inspect --cache ./dist/context-cachecontext-cli manages the lifecycle of deterministic context artifacts.
- Build and verify caches during development and CI/CD
- Audit context behavior locally before deployment
- Produce the immutable artifacts consumed by
mcp-context-server
Agents never build context at runtime — they consume caches produced by this CLI.
| Code | Meaning | MCP Error Equivalent |
|---|---|---|
| 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 |
make build # debug build
make test # run all tests
make check # cargo check + clippy
make release # optimized build, binary copied to dist/
make clean # remove artifactsThe release binary is named context and placed in dist/.
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.