Contributing
Build from source
For people changing zerohead. What to install, how to build the server and the web app, and how a release is made.
This page is for people who change zerohead. To use it, install it.
What to install
- Rust, through rustup. The repository pins its Rust version in
rust-toolchain.toml, and rustup installs it on the first build. - Node 24 and pnpm. They build the web app.
- git. Company memory is a git repository for each company. Creating a company does not need git. The first use of memory does.
- An agent's command-line tool, such as Claude Code. See Agents.
The server is one native program. It builds for Windows, macOS and Linux. Its tests pass in CI on all three, but it has not been run by hand on Windows or macOS.
Build
Run these from the repository root:
pnpm --dir web install
pnpm --dir web build
cargo build --workspace
The web app goes to web/dist. A program built this way serves it from there; only a release build carries it inside.
Start the server
cargo run -p zerohead -- serve
By default the server listens on 127.0.0.1 at port 4747. Start it from the repository root. It looks for the built app in web/dist under the folder you start it from, and serves a small placeholder page when it finds none. Use ZEROHEAD_WEB_DIR to point it elsewhere. If an installed zerohead already uses port 4747, add --port with another port, and --home with another data folder.
The settings are environment variables and flags. Settings lists them all.
To see whether a server is running:
cargo run -p zerohead -- status
Where the data lives
zerohead keeps everything in one data folder. Set it with ZEROHEAD_HOME or --home. Otherwise it is a folder called zerohead in your platform's data folder:
- Linux:
~/.local/share(or$XDG_DATA_HOME) - macOS:
~/Library/Application Support - Windows:
%LOCALAPPDATA%
An installed zerohead and one you build share it unless you give one of them --home.
Inside it, instance.sqlite holds the install. Each company has its own folder with a SQLite file, a memory repository and its run logs.
Work on the web app
While you change the app, run its dev server. It proxies the server's /ws and /api routes:
pnpm --dir web dev
Check your build
cargo test --workspace
pnpm --dir web typecheck && pnpm --dir web test
The tests never start a real agent. They use a test agent that ships in the repository.
Run Connect yourself
The Connect service (accounts and the relay) is in the connect/ folder and runs on Cloudflare Workers. connect/README.md has the steps to run it on your own machine, where it listens on http://127.0.0.1:8787. Link a server to it with cargo run -p zerohead -- connect --url http://127.0.0.1:8787; Remote access describes the rest.
Make a release
A release is made by a pull request that changes one number. Change version in Cargo.toml, run cargo update --workspace so that Cargo.lock follows, and commit both. When that pull request is merged, the release workflow (.github/workflows/release.yml) does the rest: it tags the commit, builds the release, uploads it and writes the release notes. This website deploys by itself whenever a change to it reaches main.
The tests run on your machine before you open a pull request (cargo test --workspace, pnpm --dir web test). Pull requests on GitHub only check that everything formats, lints, type-checks and builds; the full test run on Windows, macOS and Linux is the Tests workflow, started by hand.
To try the same on your own machine: scripts/release-linux.sh <folder> builds the release for Linux x86_64: the web app, then a static program (musl) with the web app inside (the embedded-web feature), packed with its SHA-256 and the latest file the install command reads. It uploads nothing. scripts/test-install.sh <folder> runs the install command against it, without touching your own install.