Metadata-Version: 2.4
Name: doomcli
Version: 0.1.0
Summary: A local terminal agent that translates English into shell commands
Author: Ahmad170412
License-Expression: MIT
Project-URL: Homepage, https://github.com/Ahmad170412/DoomCLI
Project-URL: Repository, https://github.com/Ahmad170412/DoomCLI
Project-URL: Issues, https://github.com/Ahmad170412/DoomCLI/issues
Keywords: terminal,ai,cli,shell,macos,command
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: mlx>=0.22.0
Requires-Dist: mlx-lm>=0.21.0
Requires-Dist: rich>=13.0
Requires-Dist: prompt-toolkit>=3.0
Requires-Dist: huggingface_hub>=0.20.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"

# DOOM

**Your terminal understands English. You stop Googling commands.**

DOOM is a local AI terminal agent that translates natural-language requests into zsh commands. Type what you want in plain English, preview the command, and run it. One request → one command. Private, fast, runs on your machine.

```
$ doom "how much ram does this mac have"

╭───── command ─────╮
│ sysctl hw.memsize │
╰───────────────────╯
[Displays the total physical memory installed in the machine.]
 run    cancel    edit (n):
```

## Installation

### From PyPI

```bash
pip install doomcli
doom "your request here"
```

On first run, DOOM will ask permission to download the model (~850MB) from Hugging Face. The model is cached in `~/.doom/model/` for future use.

### From source

```bash
git clone https://github.com/Ahmad170412/DoomCLI.git
cd DoomCLI
pip install -e .
doom "list all running processes"
```

### Standalone (no pip)

```bash
# Clone with the model
git clone --recurse-submodules https://github.com/Ahmad170412/DoomCLI.git
cd DoomCLI

# Create venv
python3 -m venv .venv
.venv/bin/pip install mlx mlx-lm rich prompt_toolkit

# Run
./doom "your request here"
```

## Usage

### One-shot mode

```bash
doom "create a new react project called my-app"
doom "what's my public ip"
doom "add OPENROUTER_API_KEY to my zshrc"
doom "find all files larger than 100mb"
```

### Interactive REPL

```bash
doom
```

Drops you into a loop where you can type request after request. Type `exit` or `Ctrl-C` to quit.

### Flags

| Flag | What it does |
|------|-------------|
| `--yes` | Auto-confirm non-destructive commands (still gates dangerous ones) |
| `--dry-run` | Preview the command, never execute |
| `--max-tokens 256` | Max tokens for generation (default 256) |

### Edit flow

When you see a command you want to tweak:

```
 run    cancel    edit (n): e
edit command: echo 'export API_KEY="sk-123"' >> ~/.zshrc
```

The command is **pre-filled** — arrow keys, backspace, type your changes, Enter.

## How It Works

DOOM runs a **fine-tuned Qwen2.5-Coder-1.5B** model locally on your machine. No API calls. No data leaves your computer.

1. You type a natural-language request
2. The model generates exactly one zsh command + a short explanation
3. DOOM previews the command in a clean panel
4. You confirm: `[y]` run, `[n]` cancel, or `[e]` edit the command
5. DOOM executes the command and shows the output

## Model

The fine-tuned model is available on Hugging Face: [Ahmad170412/Doom-V1](https://huggingface.co/Ahmad170412/Doom-V1)

| Metric | Base Qwen 1.5B | DOOM |
|--------|----------------|------|
| Combined correct | 25% | **50%** |
| Exact string match | 19% | **38%** |
| Format violations | 38 | **0** |

## Safety

DOOM has a **30-pattern destructive classifier** that flags dangerous commands before execution:

- File deletion (`rm`, `rmdir`, `find -delete`)
- Process control (`kill`, `pkill`, `dd`)
- Privilege escalation (`sudo`, `eval`, `curl | sh`)

Destructive commands get a **red warning panel** and always require explicit `[y]` confirmation.

**One command contract**: DOOM will never generate `&&`, `;`, pipes, or loops. One request → one command.

## Requirements

- macOS (Apple Silicon — M1/M2/M3/M4)
- Python 3.11+ (3.13 recommended)

## License

MIT
