An open API service indexing awesome lists of open source software.

https://github.com/cortexlinux/cortex-cli

AI-powered CLI shell: natural language to system commands, prompt-to-plan pipeline, Firejail sandbox
https://github.com/cortexlinux/cortex-cli

ai-assistant ai-native apt automation bash chatgpt cli command-line cortex-linux devops firejail linux llm natural-language package-manager sandbox shell sysadmin systemd terminal

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# Cortex CLI

**AI-Powered Command Line Interface for Linux System Administration**

[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.11+-3776AB.svg)](https://python.org)

## 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

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

# From source
pip install -e .
```

## Configuration

```bash
# 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

- [cortex-llm](https://github.com/cortexlinux/cortex-llm) - LLM backend
- [cortex-security](https://github.com/cortexlinux/cortex-security) - Sandbox profiles

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## License

Apache 2.0 - See [LICENSE](LICENSE)