cortex setup / cortex migrate

Initialize the CortexPrism environment, configure LLM providers, and set up databases.

cortex setup

Run the interactive setup wizard to configure CortexPrism for first use:

cortex setup

The setup wizard guides you through:

  1. Mode selection — Choose CLI or Web interface
  2. Provider configuration — Add API keys for up to 24 LLM providers (or skip)
  3. AI personalization — Optional context about how you use AI
  4. Personality template — Choose from 8 soul templates
  5. Channel setup — CLI, CLI+Web, CLI+Discord, or all channels
  6. Telemetry preference — Opt in or out of anonymous usage data

cortex migrate

Initialize or migrate all databases to the latest schema:

cortex migrate

Migrates all databases:

DatabaseFileMigrations
Corecortex.dbsessions, turns, jobs, policy rules, agents, services, hubs, nodes
Memorymemory.db5-tier memory, FTS5, embeddings, reflections, graph, skills
Lenslens.dbImmutable audit events (50+ event types)
Vaultvault.dbEncrypted credential entries (AES-256-GCM)
Pluginsplugins.dbPlugin registry and state

Migrations are idempotent with checksum guards — safe to run multiple times.

Configuration File

After setup, configuration is stored at ~/.cortex/config.json:

{
  "version": 1,
  "defaultProvider": "anthropic",
  "providers": {
    "anthropic": { "kind": "anthropic", "model": "claude-sonnet-4-5", "apiKey": "sk-..." },
    "openai": { "kind": "openai", "model": "gpt-4o", "apiKey": "sk-..." }
  },
  "agent": {
    "name": "Cortex",
    "maxTurns": 50,
    "streamOutput": true
  },
  "router": {
    "enabled": false,
    "confidenceThreshold": 0.7,
    "cascade": []
  }
}