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:
- Provider configuration — Add API keys for LLM providers
- Data directory — Choose data storage location (default:
~/.cortex/) - 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:
| Database | File | Migrations |
|---|---|---|
| Core | cortex.db | sessions, turns, jobs, policy rules |
| Memory | memory.db | 5-tier memory, FTS5, embeddings |
| Lens | lens.db | Audit events |
| Vault | vault.db | Encrypted credential entries |
| Plugins | plugins.db | Plugin 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": []
}
}