CLI Overview
The Cortex command-line interface for pushing memories from your terminal.
The Cortex CLI lets you authenticate agent keys and push memories directly from your shell. It's designed for CI/CD workflows, scripting, and quick memory operations.
Features
- Authentication — Login with agent keys
- Memory Push — Upload files as memories
- Identity Check — Verify stored credentials
- Zero Dependencies — Pure Node.js, no external packages
Quick Start
# Install
npm install -g @cortex-labs/cli
# Login
cortex login --key crtx_YOUR_KEY_HERE
# Push a memory
cortex push ./design-decisions.md --title "Auth Architecture" --scope engineering
# Verify identity
cortex whoami
Commands
| Command | Description |
|---|---|
cortex login | Authenticate with an agent key |
cortex whoami | Show current identity and endpoint |
cortex push | Push a file as a memory |
Configuration
Credentials are stored in ~/.cortex/config.json with mode 600 (owner read/write only).
{
"apiKey": "crtx_...",
"url": "https://your-cortex-host",
"actingUser": {
"name": "John Doe",
"email": "john@company.com",
"role": "IC",
"level": "Senior"
}
}
Environment Variables
| Variable | Description |
|---|---|
CORTEX_API_KEY | Agent key (overrides --key flag) |
CORTEX_URL | Cortex endpoint (overrides --url flag) |