Metadata-Version: 2.4
Name: huh-cli
Version: 0.1.1
Summary: On-device AI assistant for your terminal
License-Expression: MIT
Project-URL: Homepage, https://github.com/evanpaul14/huh
Project-URL: Repository, https://github.com/evanpaul14/huh
Project-URL: Issues, https://github.com/evanpaul14/huh/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0
Requires-Dist: rich>=13.0
Requires-Dist: huggingface_hub>=0.23.0
Requires-Dist: mlx-lm>=0.18.0; platform_machine == "arm64" and sys_platform == "darwin"
Requires-Dist: llama-cpp-python>=0.2.0; platform_machine != "arm64" or sys_platform != "darwin"
Dynamic: license-file

# huh

On-device AI assistant for your terminal. Run `huh` after a failed command and it tells you what you meant to type — no internet required.

## Install

```bash
pip install huh-cli
huh install   # adds shell hook to ~/.zshrc or ~/.bashrc
```

Then open a new terminal (or `source ~/.zshrc`) to activate.

## Usage

```bash
# Fix your last failed command
huh

# Ask for any shell command
huh ask "compress a folder to tar.gz"
huh ask "find files modified in the last 24 hours"

# Copy suggestion to clipboard instead of running
huh --copy
huh ask "list open ports" --copy

# Show or change the model
huh model
huh model mlx-community/Qwen2.5-Coder-3B-Instruct-4bit
```

## How it works

After `huh install`, your shell captures the last failed command and exit code. When you run `huh`, it feeds that context along with a snapshot of your environment (OS, shell, CWD, git branch) to a local LLM and returns a single corrected command.

- **Apple Silicon (M1/M2/M3):** uses [`mlx-lm`](https://github.com/ml-explore/mlx-lm) with a 4-bit quantized model
- **Everything else:** uses [`llama-cpp-python`](https://github.com/abetlen/llama-cpp-python) with a GGUF model auto-downloaded on first use

No data leaves your machine.

## Requirements

- Python 3.10+
- Apple Silicon Mac (MLX backend) or any machine that can run llama.cpp
