A chat, a policy, and a hook runner.
In one terminal binary.

ahi runs coding models in your terminal, lets them read and change only what a file in the repository approves, and runs your pre-commit checks without downloading a thing.

cargo install ahi --locked

Linux can also take the attested release archive: ahi update verifies the build provenance with the GitHub CLI before replacing the binary. Binaries for Linux x86_64 and aarch64 and Windows x86_64 are on every release.

01

Chat in the terminal you already have

Pick a model, sign in with the browser or register an OpenAI-compatible gateway, and stream replies with markdown, syntax-highlighted code, clickable links and file references, and red/green diffs for every edit. Copy rendered text or raw markdown. Nothing is fetched at startup.

ahi tui
02

One file decides what the model may touch

Tools are off until the working directory has an ahi.tools.yaml with an approve rule. Read, list, find, search, edit, write, and run commands are each approved separately, by path prefix and argv prefix, with ask rules that prompt in chat. Deny beats approve. Model output never creates a grant, and the file itself can never be written by a tool.

ahi tools init --write
ahi tools list
ahi tools examples show commands
03

Pre-commit checks, offline

Read the pre-commit config you already have and run the checks compiled into the binary: trailing whitespace, end of file, mixed line endings, YAML, JSON, and more. Local system hooks run only when ahi.hooks.yaml approves the exact entry. No runtimes are downloaded and no hook repository is cloned.

ahi run
ahi run --all-files --fix
ahi migrate
04

A container when you want a boundary

Open the working directory in a published development image through podman or docker. Run the chat inside it and approved commands run there instead of on the host.

ahi dev shell
ahi dev run -- cargo test
05

Open source, one crate

MIT licensed. Published to crates.io with attested release binaries. unsafe is forbidden in the main crate; the one platform shim that needs it lives in its own small crate in the same workspace.

cargo install ahi --locked
06

Questions

Is the model sandboxed?
No. The builtin file tools refuse absolute paths, .., and symbolic links and never leave the working directory. A command approved by a command rule runs on the host with the operator's access. Run ahi tui inside ahi dev run for a container boundary.
Which providers work?
OpenAI through the browser login, and any OpenAI-compatible or Anthropic Messages gateway registered in models.json. Tool calls go through one policy-gated loop on every protocol.
Does it replace pre-commit?
For the fast builtin checks, yes, and it reads the same config file. Remote hook repositories are never fetched or run; ahi migrate suggests the builtin ids that replace them.
Where is the policy for this repository?
In ahi.tools.yaml at the directory ahi tui starts in. ahi tools list shows it with every rule painted approve, ask, or deny; ahi doctor summarises it.

Start in a fresh repository

cargo install ahi --locked
cd your-repo
ahi tools init --write
ahi tui

Read the guide →