What is sub-bot?
sub-bot is a self-hosted coding agent server written in Rust. Other bots call it over HTTP and server-sent events, or over stdio JSONL. It is not tied to one repository. Each bot has a token, and that token maps to the profiles it may use.
Which machines does it run on?
macOS and Linux, on arm64 and x86_64. It ships as one binary. TLS uses rustls, so OpenSSL is not required. Windows is not a supported target. The Linux release archives are musl builds.
How do I install it?
Run brew tap dickwu/tap, then brew install dickwu/tap/sub-bot. Once the tap is installed, the tap README also lists brew install sub-bot. The formula installs the binary and an example config at $(brew --prefix)/share/sub-bot/sub-bot.example.json. Release archives are on GitHub.
How does another bot call it?
The server listens on 127.0.0.1:7878 by default. The bot sends an Authorization: Bearer token to POST /v1/chat. Set stream to true for server-sent events. The same routes are served on a Unix socket, and a user mapped in localClients can call that socket with no token. sub-bot rpc speaks one JSON command per line on stdin and writes events on stdout.
What happens to a session after a restart?
serve, run, and rpc write each session to its own JSONL file. When the same client asks for that id, the server loads the file. A different client gets 404. The working directory must still sit inside the profile's workspace roots. A tool call that was in progress is marked interrupted and is not run again.
Where do API keys live?
In a file, in an environment variable, or on macOS in the login keychain. sub-bot keys set stores a key and does not print it. On Linux it writes a mode 0600 file under the config directory. No API returns a key, and logs do not record one.
Which tools does the agent get?
The default set is read, write, edit, ls, grep, find, and bash. grep and find use an embedded ripgrep engine, so the host does not need rg installed. The readonly preset drops write, edit, and bash. toolApproval can allow, ask, or deny a call before it runs.
Is it free?
Yes. You may use it under the MIT license or the Apache License 2.0, at your option. Source, design notes, and releases are at github.com/dickwu/sub-bot.