| title |
Cortex CLI |
| description |
Cortex - The AI-Powered Coding Agent for your terminal |

Cortex is an open-source AI coding agent that runs directly in your terminal. It provides intelligent assistance for coding tasks with full access to your file system, terminal, and development tools.
Get up and running in under 5 minutes
Complete command reference
Customize Cortex to your workflow
Extend with Model Context Protocol
Use any AI provider: Anthropic Claude, OpenAI GPT-4, Google Gemini, Groq, Mistral, xAI Grok, DeepSeek, or local models via Ollama and LM Studio.
Built-in sandboxing with Seatbelt (macOS), Landlock (Linux), and Windows restricted tokens. Configurable approval policies for tool execution.
Create custom agents with specific prompts, tool restrictions, and capabilities. Built-in agents for building, planning, and code exploration.
Full support for Model Context Protocol (MCP) servers. Connect to databases, APIs, and external tools through a standardized protocol.
Headless execution mode for automation. GitHub Actions integration. JSON output for scripting.
Resume previous conversations. Export and import sessions. Track usage statistics.
```bash
curl -fsSL https://cortex.foundation/install | bash
```
```bash
brew install cortexlm/tap/cortex
```
```bash
cargo install cortex-cli
```
```bash
git clone https://github.com/cortexlm/cortex-cli
cd cortex-cli
cargo install --path .
```
# Start interactive TUI
cortex
# Start with an initial prompt
cortex "explain this codebase"
# Non-interactive execution
cortex run "fix the bug in main.rs"
# Headless mode for CI/CD
cortex exec --auto medium "run tests and fix failures"
| Variable |
Description |
CORTEX_HOME |
Override config directory (default: ~/.config/cortex) |
CORTEX_API_KEY |
API key for the default provider |
CORTEX_MODEL |
Default model to use |
CORTEX_LOG_LEVEL |
Log verbosity (error, warn, info, debug, trace) |
NO_COLOR |
Disable colored output |
VISUAL / EDITOR |
Editor for /edit command |
Master all commands and options
Build specialized AI assistants
Automate PR reviews and issues
Extend with external tools