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. Provider configuration — Add API keys for LLM providers
  2. Data directory — Choose data storage location (default: ~/.cortex/)
  3. Default model — Set your preferred LLM model for chat sessions

cortex migrate

Initialize or migrate all databases to the latest schema:

cortex migrate

Migrates all databases:

DatabaseFileMigrations
Corecortex.dbsessions, turns, jobs, policy rules
Memorymemory.db5-tier memory, FTS5, embeddings
Lenslens.dbAudit events
Vaultvault.dbEncrypted credential entries
Pluginsplugins.dbPlugin registry

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-20250514", "apiKey": "sk-..." },
    "openai": { "kind": "openai", "model": "gpt-4o", "apiKey": "sk-..." }
  },
  "agent": {
    "name": "Cortex",
    "maxTurns": 50,
    "streamOutput": true
  },
  "router": {
    "enabled": false,
    "confidenceThreshold": 0.7,
    "cascade": []
  }
}