Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 75 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,61 @@ Unlock advanced features with Cortex Pro:

**[Compare Plans โ†’](https://cortexlinux.com/pricing)** | **[Start Free Trial โ†’](https://cortexlinux.com/pricing)**

### AI Command Execution Setup (`ask --do`)

For the full AI-powered command execution experience, run the setup script:

```bash
# Full setup (Ollama + Watch Service + Shell Hooks)
./scripts/setup_ask_do.sh

# Or use Python directly
python scripts/setup_ask_do.py

# Options:
# --no-docker Skip Docker/Ollama setup (use cloud LLM only)
# --model phi Use a smaller model (2GB instead of 4GB)
# --skip-watch Skip watch service installation
# --uninstall Remove all components
```

This script will:
1. **Set up Ollama** with a local LLM (Mistral by default) in Docker
2. **Install the Watch Service** for terminal monitoring
3. **Configure Shell Hooks** for command logging
4. **Verify everything works**

#### Quick Start After Setup

```bash
# Start an interactive AI session
cortex ask --do

# Or with a specific task
cortex ask --do "install nginx and configure it for reverse proxy"

# Check watch service status
cortex watch --status
```

#### Manual Setup (Alternative)

If you prefer manual setup:

```bash
# Install the Cortex Watch service (runs automatically on login)
cortex watch --install --service

# Check status
cortex watch --status

# For Ollama (optional - for local LLM)
docker run -d --name ollama -p 11434:11434 -v ollama:/root/.ollama ollama/ollama
docker exec ollama ollama pull mistral
```

This enables Cortex to monitor your terminal activity during manual intervention mode, providing real-time AI feedback and error detection.

---

## Usage
Expand Down Expand Up @@ -187,9 +242,13 @@ cortex role set <slug>
| `cortex docker permissions` | Fix file ownership for Docker bind mounts |
| `cortex role detect` | Automatically identifies the system's purpose |
| `cortex role set <slug>` | Manually declare a system role |
| `cortex ask <question>` | Ask questions about your system |
| `cortex ask --do` | Interactive AI command execution mode |
| `cortex sandbox <cmd>` | Test packages in Docker sandbox |
| `cortex history` | View all past installations |
| `cortex rollback <id>` | Undo a specific installation |
| `cortex watch --install --service` | Install terminal monitoring service |
| `cortex watch --status` | Check terminal monitoring status |
| `cortex --version` | Show version information |
| `cortex --help` | Display help message |

Expand All @@ -210,9 +269,11 @@ Cortex stores configuration in `~/.cortex/`:

```
~/.cortex/
โ”œโ”€โ”€ config.yaml # User preferences
โ”œโ”€โ”€ history.db # Installation history (SQLite)
โ””โ”€โ”€ audit.log # Detailed audit trail
โ”œโ”€โ”€ config.yaml # User preferences
โ”œโ”€โ”€ history.db # Installation history (SQLite)
โ”œโ”€โ”€ audit.log # Detailed audit trail
โ”œโ”€โ”€ terminal_watch.log # Terminal monitoring log
โ””โ”€โ”€ watch_service.log # Watch service logs
```

---
Expand Down Expand Up @@ -269,12 +330,19 @@ Cortex stores configuration in `~/.cortex/`:
cortex/
โ”œโ”€โ”€ cortex/ # Main Python package
โ”‚ โ”œโ”€โ”€ cli.py # Command-line interface
โ”‚ โ”œโ”€โ”€ ask.py # AI Q&A and command execution
โ”‚ โ”œโ”€โ”€ coordinator.py # Installation orchestration
โ”‚ โ”œโ”€โ”€ llm_router.py # Multi-LLM routing
โ”‚ โ”œโ”€โ”€ daemon_client.py # IPC client for cortexd
โ”‚ โ”œโ”€โ”€ packages.py # Package manager wrapper
โ”‚ โ”œโ”€โ”€ hardware_detection.py
โ”‚ โ”œโ”€โ”€ installation_history.py
โ”‚ โ”œโ”€โ”€ watch_service.py # Terminal monitoring service
โ”‚ โ”œโ”€โ”€ do_runner/ # AI command execution
โ”‚ โ”‚ โ”œโ”€โ”€ handler.py # Main execution handler
โ”‚ โ”‚ โ”œโ”€โ”€ terminal.py # Terminal monitoring
โ”‚ โ”‚ โ”œโ”€โ”€ diagnosis.py # Error diagnosis & auto-fix
โ”‚ โ”‚ โ””โ”€โ”€ verification.py # Conflict detection
โ”‚ โ””โ”€โ”€ utils/ # Utility modules
โ”œโ”€โ”€ daemon/ # C++ background daemon (cortexd)
โ”‚ โ”œโ”€โ”€ src/ # Daemon source code
Expand All @@ -284,8 +352,12 @@ cortex/
โ”‚ โ””โ”€โ”€ README.md # Daemon documentation
โ”œโ”€โ”€ tests/ # Python test suite
โ”œโ”€โ”€ docs/ # Documentation
โ”‚ โ””โ”€โ”€ ASK_DO_ARCHITECTURE.md # ask --do deep dive
โ”œโ”€โ”€ examples/ # Example scripts
โ””โ”€โ”€ scripts/ # Utility scripts
โ”œโ”€โ”€ setup_ask_do.py # Full ask --do setup
โ”œโ”€โ”€ setup_ask_do.sh # Bash setup alternative
โ””โ”€โ”€ setup_ollama.py # Ollama-only setup
```

### Background Daemon (cortexd)
Expand Down
Loading