AI-Powered Package Manager for Debian/Ubuntu
Install software using natural language. No more memorizing package names.
Quick Start • Features • Usage • Architecture • Contributing • Community
Cortex is an AI-native package manager that understands what you want to install, even when you don't know the exact package name.
# Instead of googling "what's the package name for PDF editing on Ubuntu?"
cortex install "something to edit PDFs"
# Instead of remembering exact package names
cortex install "a lightweight code editor with syntax highlighting"
# Natural language just works
cortex install "tools for video compression"| Feature | Description |
|---|---|
| Natural Language | Describe what you need in plain English |
| Dry-Run Default | Preview all commands before execution |
| Sandboxed Execution | Commands run in Firejail isolation |
| Full Rollback | Undo any installation with cortex rollback |
| Audit Trail | Complete history in ~/.cortex/history.db |
| Hardware-Aware | Detects GPU, CPU, memory for optimized packages |
| Multi-LLM Support | Works with Claude, GPT-4, or local Ollama models |
# 1. Clone the repository
git clone https://github.com/cortexlinux/cortex.git
cd cortex
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate
# 3. Install Cortex
pip install -e .
# 4. Configure API key
echo 'ANTHROPIC_API_KEY=your-key-here' > .env
# 5. Verify installation
cortex --version# Preview what would be installed (safe, no changes made)
cortex install nginx --dry-run
# Actually install
cortex install nginx --execute# Install with natural language
cortex install "web server for static sites" --dry-run
cortex install "image editing software like photoshop" --execute
# View installation history
cortex history
# Rollback an installation
cortex rollback <installation-id>
# Check system preferences
cortex check-pref| Command | Description |
|---|---|
cortex install <query> |
Install packages matching natural language query |
cortex install <query> --dry-run |
Preview installation plan (default) |
cortex install <query> --execute |
Execute the installation |
cortex history |
View all past installations |
cortex rollback <id> |
Undo a specific installation |
cortex check-pref |
Display current preferences |
cortex --version |
Show version information |
cortex --help |
Display help message |
Cortex stores configuration in ~/.cortex/:
~/.cortex/
├── config.yaml # User preferences
├── history.db # Installation history (SQLite)
└── audit.log # Detailed audit trail
┌─────────────────────────────────────────────────────────────────┐
│ User Input │
│ "install video editor" │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ CLI Interface │
│ (cli.py) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ LLM Router │
│ Claude / GPT-4 / Ollama │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Anthropic │ │ OpenAI │ │ Ollama │ │
│ │ Claude │ │ GPT-4 │ │ Local │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Coordinator │
│ (Plan Generation & Validation) │
└─────────────────────────────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Hardware │ │ Package │ │ Sandbox │
│ Detection │ │ Manager │ │ Executor │
│ │ │ (apt/yum/dnf) │ │ (Firejail) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ Installation History │
│ (SQLite + Audit Logging) │
└─────────────────────────────────────────────────────────────────┘
cortex/
├── cortex/ # Main package
│ ├── cli.py # Command-line interface
│ ├── coordinator.py # Installation orchestration
│ ├── llm_router.py # Multi-LLM routing
│ ├── packages.py # Package manager wrapper
│ ├── hardware_detection.py
│ ├── installation_history.py
│ └── utils/ # Utility modules
├── tests/ # Test suite
├── docs/ # Documentation
├── examples/ # Example scripts
└── scripts/ # Utility scripts
Cortex is designed with security as a priority:
| Protection | Implementation |
|---|---|
| Dry-run by default | No execution without --execute flag |
| Sandboxed execution | All commands run in Firejail containers |
| Command validation | Dangerous patterns blocked before execution |
| Audit logging | Every action recorded with timestamps |
| Rollback capability | Full undo support for all installations |
| No root by default | Sudo only when explicitly required |
Found a vulnerability? Please report it responsibly:
- Email: security@cortexlinux.com
- See SECURITY.md for our disclosure policy
"ANTHROPIC_API_KEY not set"
# Verify .env file exists
cat .env
# Should show: ANTHROPIC_API_KEY=sk-ant-...
# If missing, create it:
echo 'ANTHROPIC_API_KEY=your-actual-key' > .env"command not found: cortex"
# Ensure virtual environment is activated
source venv/bin/activate
# Reinstall
pip install -e ."Python version too old"
# Check version
python3 --version
# Install Python 3.11 on Ubuntu/Debian
sudo apt update
sudo apt install python3.11 python3.11-venv
# Create venv with specific version
python3.11 -m venv venvpip install fails
# Update pip
pip install --upgrade pip
# Install build dependencies
sudo apt install python3-dev build-essential
# Retry installation
pip install -e .Alpha Release - Cortex is under active development. APIs may change.
- Natural language to package resolution
- Claude and OpenAI integration
- Installation history and rollback
- User preferences (YAML-backed)
- Hardware detection (GPU/CPU/Memory)
- Firejail sandboxing
- Dry-run preview mode
- Conflict resolution UI
- Multi-step orchestration
- Ollama local model support
- MCP server integration
- Snap/Flatpak support
- Fedora/RHEL support
- Arch Linux support
- Web UI dashboard
- VS Code extension
See ROADMAP.md for the full development roadmap.
We welcome contributions of all kinds!
- Code: Python, Linux kernel optimizations
- Documentation: Guides, tutorials, API docs
- Testing: Bug reports, test coverage
- Design: UI/UX improvements
We offer bounties for merged PRs:
| Tier | Reward | Examples |
|---|---|---|
| Small | $25 | Bug fixes, typos, minor features |
| Medium | $50-100 | New features, significant improvements |
| Large | $150-200 | Major features, security fixes |
See issues labeled bounty for available tasks.
# Fork and clone
git clone https://github.com/YOUR_USERNAME/cortex.git
cd cortex
# Setup development environment
python3 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest tests/ -vSee CONTRIBUTING.md for detailed guidelines.
- Discord: discord.gg/uCqHvxjU83
- Discussions: GitHub Discussions
- Email: mike@cortexlinux.com
- Twitter: @cortexlinux
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Discussions
- Security Issues: security@cortexlinux.com
Apache 2.0 - See LICENSE for details.
Built with love by the Cortex team and contributors worldwide.