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:
- Mode selection — Choose CLI or Web interface
- Provider configuration — Add API keys for up to 24 LLM providers (or skip)
- AI personalization — Optional context about how you use AI
- Personality template — Choose from 8 soul templates
- Channel setup — CLI, CLI+Web, CLI+Discord, or all channels
- 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:
| Database | File | Migrations |
|---|---|---|
| Core | cortex.db | sessions, turns, jobs, policy rules, agents, services, hubs, nodes |
| Memory | memory.db | 5-tier memory, FTS5, embeddings, reflections, graph, skills |
| Lens | lens.db | Immutable audit events (50+ event types) |
| Vault | vault.db | Encrypted credential entries (AES-256-GCM) |
| Plugins | plugins.db | Plugin 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": []
}
}