diff --git a/CLAUDE.md b/CLAUDE.md index ce23c14..4fa4517 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,5 +1,5 @@ -# Vox — Personal Terminal Agent +# Vox — Self-Learning Terminal Agent ## Build & Test ```bash @@ -15,9 +15,12 @@ uv sync --extra voice ``` ## Architecture -- `src/vox/cli.py` — Subcommand dispatcher: REPL, listen, speak, agent, config -- `src/vox/engine.py` — Ollama API client, response cleaning, general LLM queries +- `src/vox/cli.py` — Subcommand dispatcher: REPL, listen, speak, agent, learn, config +- `src/vox/engine.py` — Ollama API client, context-enriched prompts, response cleaning - `src/vox/config.py` — TOML config (~/.config/vox/config.toml) with env overrides +- `src/vox/safety.py` — Dangerous command detection and non-shell response filtering +- `src/vox/executor.py` — Command execution and clipboard utilities +- `src/vox/knowledge.py` — SQLite self-learning store (6 context layers) - `src/vox/voice/recorder.py` — Microphone capture via sounddevice - `src/vox/voice/asr.py` — Speech-to-text (Parakeet 0.6B via mlx-audio) - `src/vox/voice/tts.py` — Text-to-speech (Kokoro 82M via mlx-audio) @@ -25,8 +28,16 @@ uv sync --extra voice - `src/vox/agents/router.py` — Auto-route tasks to best installed agent via LLM - `src/vox/agents/{claude,codex,gemini,amp,droid}.py` — Headless agent wrappers - `scripts/finetune/` — Dataset building and LoRA fine-tuning pipeline -- `install.sh` / `uninstall.sh` — curl-installable scripts -- `docs/index.html` — GitHub Pages landing + +## Self-Learning (knowledge.py) +SQLite store at ~/.config/vox/knowledge.db with 6 layers: +1. Command patterns — validated NL-to-shell mappings (FTS5 indexed) +2. User corrections — rejected commands + corrected versions +3. Error patterns — commands that failed + error output +5. Agent learnings — which agent handles which task best +6. Session context — directory-aware recent commands + +After 3+ successful uses, a pattern is served from cache (skipping LLM). ## Backend Ollama API (local inference, no cloud). Default model: qwen2.5-coder:0.5b. @@ -37,18 +48,19 @@ Agents: auto-discovers claude, codex, gemini, amp, droid in PATH. ``` vox # Interactive REPL vox "find large files" # Single NL-to-shell -vox listen # Voice → shell command +vox listen # Voice -> shell command vox speak "hello" # Text-to-speech vox agent "fix tests" # Delegate to AI agent (auto-routed) vox agent --list # Show detected agents -vox agent --use claude "x" # Force specific agent +vox learn show # Show top learned patterns +vox learn stats # Knowledge store statistics +vox learn export -f p.json # Export patterns vox config init # Create config template -vox config show # Display current config ``` ## Conventions - Python 3.10+, ruff for lint/format -- Keep core dependencies minimal (httpx, rich) +- Keep core dependencies minimal (httpx, rich, sqlite3) - Voice/finetune deps are optional extras - All shell commands single-line, no heredocs diff --git a/README.md b/README.md index 6967386..a9c9ff2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ vox > find all python files bigger than 1MB ## Install ```bash -curl -fsSL https://raw.githubusercontent.com/aryateja2106/vox/main/install.sh | bash +curl -fsSL https://raw.githubusercontent.com/nl2shell/vox/main/install.sh | bash ``` **Requirements:** Python 3.9+, [Ollama](https://ollama.ai) for local inference. @@ -21,7 +21,7 @@ curl -fsSL https://raw.githubusercontent.com/aryateja2106/vox/main/install.sh | ## Uninstall ```bash -curl -fsSL https://raw.githubusercontent.com/aryateja2106/vox/main/uninstall.sh | bash +curl -fsSL https://raw.githubusercontent.com/nl2shell/vox/main/uninstall.sh | bash ``` ## Usage @@ -106,7 +106,7 @@ Vox is a step toward a world where the terminal understands you — not the othe ## Model -Vox is powered by [NL2Shell](https://github.com/aryateja2106/nl2shell), a fine-tuned Qwen3.5-0.8B model trained specifically for natural language to shell command translation. +Vox is powered by [NL2Shell](https://github.com/nl2shell/nl2shell), a fine-tuned Qwen3.5-0.8B model trained specifically for natural language to shell command translation. - **Parameters:** ~859M (runs on CPU, no GPU needed) - **Training data:** 12,000+ deduplicated NL→bash pairs including 960+ expert-curated commands @@ -118,7 +118,7 @@ You can also use any other Ollama model: `vox --model llama3.2` ## Contributing ```bash -git clone https://github.com/aryateja2106/vox.git +git clone https://github.com/nl2shell/vox.git cd vox uv sync uv run python -m vox diff --git a/docs/index.html b/docs/index.html index 77a842a..f9fc688 100644 --- a/docs/index.html +++ b/docs/index.html @@ -300,7 +300,7 @@ Examples Why Vox - + ★ Star on GitHub @@ -331,11 +331,11 @@

Talk to your terminal.

- curl -fsSL https://raw.githubusercontent.com/aryateja2106/vox/main/install.sh | bash + curl -fsSL https://raw.githubusercontent.com/nl2shell/vox/main/install.sh | bash
- curl -fsSL https://raw.githubusercontent.com/aryateja2106/vox/main/uninstall.sh | bash + curl -fsSL https://raw.githubusercontent.com/nl2shell/vox/main/uninstall.sh | bash
@@ -481,7 +481,7 @@

Three ways to use it.

Your terminal, finally fluent.

Install in under 10 seconds. No setup. No config. No excuses.

- + ★ Star on GitHub @@ -493,17 +493,17 @@

Your terminal, finally fluent.