AI-Powered Command Line Interface for Linux System Administration
cortex-cli is the core user interface for Cortex Linux. It translates natural language into safe, sandboxed system commands with explicit user confirmation before any privileged operations.
| Feature | Description |
|---|---|
| Natural Language | "install nginx" → apt install nginx |
| Prompt-to-Plan | Shows exactly what will execute before running |
| No Silent Sudo | Every privileged action requires explicit confirmation |
| Firejail Sandbox | Commands run in isolated environments |
| Audit Logging | Complete transcript of all operations |
$ cortex
Welcome to Cortex Linux Shell
cortex> install nginx and configure it for reverse proxy
📋 Plan:
1. sudo apt update
2. sudo apt install -y nginx
3. Create /etc/nginx/sites-available/reverse-proxy.conf
4. sudo systemctl enable --now nginx
⚠️ This requires elevated privileges.
Commands will modify: apt packages, nginx config, systemd
[Execute] [Dry-run] [Cancel] >
cortex-cli/
├── src/
│ ├── cortex/
│ │ ├── __init__.py
│ │ ├── cli.py # REPL entrypoint
│ │ ├── intent/ # Intent detection
│ │ ├── planner/ # Prompt-to-plan pipeline
│ │ ├── adapters/ # APT, systemctl, etc.
│ │ ├── sandbox/ # Firejail execution
│ │ └── audit/ # Transcript logging
├── skills/ # Pluggable skill definitions
├── tests/ # Test suite
└── docs/ # CLI documentation
This repository covers 10 major topics with 103 decisions and 91 tasks:
- APT prompt adapters (install, remove, update, upgrade, search)
- Audit logging, transcripts, and explainability
- Configuration change engine (no manual file editing)
- Cortex REPL command and shell integration
- Privilege escalation with explicit confirmation (no silent sudo)
- Prompt-to-plan pipeline (intent detection and tool selection)
- Safe command construction and execution sandbox
- Skill/plugin framework for new prompts and actions
- System status question answering (disk, packages, ports, versions)
- systemctl prompt adapters (start/stop/restart/enable/status)
# From Cortex repository (recommended)
sudo apt install cortex-cli
# From source
pip install -e .# Config location
~/.config/cortex/config.yaml
# Environment variables
CORTEX_MODEL=local # or 'claude', 'openai'
CORTEX_SANDBOX=firejail # or 'none' (not recommended)
CORTEX_LOG_LEVEL=info- cortex-llm - LLM backend
- cortex-security - Sandbox profiles
See CONTRIBUTING.md for guidelines.
Apache 2.0 - See LICENSE