Skip to content

AI-powered CLI shell: natural language to system commands, prompt-to-plan pipeline, Firejail sandbox

License

Notifications You must be signed in to change notification settings

cortexlinux/cortex-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cortex CLI

AI-Powered Command Line Interface for Linux System Administration

License Python

Overview

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.

Key Features

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

Example Session

$ 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] > 

Architecture

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

Topics (from Planning)

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)

Installation

# From Cortex repository (recommended)
sudo apt install cortex-cli

# From source
pip install -e .

Configuration

# 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

Related Repositories

Contributing

See CONTRIBUTING.md for guidelines.

License

Apache 2.0 - See LICENSE

Releases

No releases published

Packages

No packages published