Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cortex-context/cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
cortex-context CLI
CLI to initialize and manage Cortex Context (Knowledge Graph) tooling in any VS Code workspace.
Installs:
- Skills — VS Code Copilot Agent skills for Cortex (
cortex-research,cortex-dimensions,cortex-ingest,generate-spec) - MCP Server — TypeScript stdio server exposing Cortex tools to GitHub Copilot (bundled — no Python needed)
- VS Code Config — Injects
cortexentry into.vscode/mcp.json
Requirements
- Node.js 18+
- A running Cortex server
Installation
# Install globally
npm install -g @cortex-context/cli
# Or run directly without installing
npx @cortex-context/cli initUsage
# Initialize Cortex Context in the current workspace
cortex-context init
# Initialize with specific options (non-interactive)
cortex-context init --url http://localhost:8082 --token <your-token>
# Initialize in a specific workspace folder
cortex-context init --workspace /path/to/your/workspace
# Sync Skills/MCP to latest bundled version
cortex-context sync
# Preview what sync would change
cortex-context sync --dry-run
# Validate installation and connectivity
cortex-context doctorWhat init Does
- Prompts for Cortex server URL and optional API token
- Tests connectivity to the Cortex server
- Copies Skills into
{workspace}/.github/skills/ - Injects
cortexentry into{workspace}/.vscode/mcp.json(usesnpx @cortex-context/cli mcp-serve) - Saves configuration to
~/.cortex-context/config.json
After Init
# Reload VS Code (Cmd/Ctrl+Shift+P → "Reload Window")
# Then run doctor to verify:
cortex-context doctorCommands
Workspace setup
| Command | Description |
|---|---|
cortex-context init |
Full interactive setup (Skills, MCP, hooks, rules) |
cortex-context update |
Update Skills + MCP files to latest bundled version |
cortex-context update --dry-run |
Preview update changes without writing files |
cortex-context sync |
Ingest latest git diff into the Cortex Knowledge Graph |
cortex-context sync --dry-run |
Show diff without sending to Cortex API |
cortex-context doctor |
Validate installation + test Cortex connectivity |
cortex-context uninstall |
Remove Cortex Context from the workspace |
Local server
| Command | Description |
|---|---|
cortex-context server |
Install Docker (if needed) and start Neo4j + Cortex API locally |
cortex-context server --embeddings |
Start with embeddings image (sentence-transformers, CPU, ~1.5 GB) |
cortex-context server --embeddings-gpu |
Start with embeddings GPU image (PyTorch CUDA, ~2 GB — requires nvidia) |
cortex-context upgrade |
Pull latest Cortex backend image and restart the local stack |
cortex-context upgrade --embeddings |
Upgrade using the embeddings image variant |
cortex-context upgrade --embeddings-gpu |
Upgrade using the embeddings GPU image variant (PyTorch CUDA, ~2 GB — requires nvidia) |
cortex-context upgrade --pull-only |
Pull latest image without recreating the container |
cortex-context downgrade |
Switch to the base image variant (lightest, no embeddings) |
cortex-context downgrade --embeddings |
Switch to the CPU embeddings variant (lighter than GPU) |
Token management
| Command | Description |
|---|---|
cortex-context token |
Show current API token (masked) |
cortex-context token --show |
Reveal the full token |
cortex-context token --rotate |
Generate a new random token, save it, and restart stack |
cortex-context token --set <val> |
Set a specific token value (empty string clears auth) |
Advanced
| Command | Description |
|---|---|
cortex-context reset |
Wipe all nodes and relationships from the Knowledge Graph |
cortex-context mcp-serve |
Start the MCP server over stdio (used internally by VS Code/Cursor) |
Options (init)
| Flag | Description |
|---|---|
--url <url> |
Cortex server URL (skips prompt) |
--token <tok> |
API token (skips prompt) |
--workspace |
Target workspace path (default: cwd) |
--local |
Deploy a local Cortex stack with Docker (mutually exclusive with --url) |
--skip-mcp |
Don't configure MCP server |
--skip-skills |
Don't install Skills |
--skip-hooks |
Don't install git hooks |
--skip-rules |
Don't inject Copilot/Cursor rules |
--force |
Overwrite existing files without prompting |
Contributing
Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.
Found a bug? Open a bug report.
Have an idea? Open a feature request.
License
MIT