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
cortex entry into .vscode/mcp.json
Requirements
Installation
npm install -g @cortex-context/cli
npx @cortex-context/cli init
Usage
cortex-context init
cortex-context init --url http://localhost:8082 --token <your-token>
cortex-context init --workspace /path/to/your/workspace
cortex-context sync
cortex-context sync --dry-run
cortex-context doctor
What init Does
- Prompts for Cortex server URL and optional API token
- Tests connectivity to the Cortex server
- Copies Skills into
{workspace}/.github/skills/
- Injects
cortex entry into {workspace}/.vscode/mcp.json (uses npx @cortex-context/cli mcp-serve)
- Saves configuration to
~/.cortex-context/config.json
After Init
cortex-context doctor
Commands
Workspace setup
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
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
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
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)
--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