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

CommandDescription
cortex loginAuthenticate with an agent key
cortex whoamiShow current identity and endpoint
cortex pushPush 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

VariableDescription
CORTEX_API_KEYAgent key (overrides --key flag)
CORTEX_URLCortex endpoint (overrides --url flag)

Next Steps