Development
Build
zig build # zig-out/bin/oi (debug)
zig build -Doptimize=small # release build, stripped (2.8 MiB, fully static with -Dtarget=x86_64-linux-musl)
zig build lib # zig-out/lib/libharness.{so,dylib,dll} + zig-out/include/oi.h
zig build test # unit tests
zig build e2e # end-to-end suite against this build (offline, no API key)Requires only Zig 0.17.1 (pinned in mise.toml: mise install). Zig compiles the vendored quickjs-ng and SQLite itself, and HTTPS goes through Zig's standard library, so there is no C toolchain or libcurl to install. The end-to-end tests also use python3, curl, sqlite3 and a C compiler (for the C ABI check). -Dversion=1.2.3 stamps a version.
Any platform cross-compiles from any other: zig build -Doptimize=small -Dtarget=x86_64-windows-gnu, -Dtarget=aarch64-macos, -Dtarget=aarch64-linux-musl, and so on.
Releases
Releases. Pushing a v* tag runs .github/workflows/release.yml. One Linux runner runs the full test suite and cross-compiles every platform, each platform then runs a smoke test natively, and the job publishes the binaries, checksums.txt, latest.json (what the updater reads) and both install scripts as a GitHub release. Tags with a - suffix become prereleases, which the updater ignores. Pushes and pull requests run the same builds and tests without publishing.
Testing
zig build test runs 143 unit tests and zig build e2e runs 182 end-to-end checks. The end-to-end suite uses a scripted mock provider (OI_MOCK_SCRIPT, with every request recorded to OI_MOCK_RECORD), pty-driven terminal UI sessions (read through a small VT emulator), fake stdio and streamable-HTTP MCP servers with an OAuth authorization server, a local web server for the web tools, ACP clients, the HTTP daemon, the C ABI, Landlock, replay, and a local stand-in for all four LLM wire APIs. The stand-in covers each API's round trip and same-model reasoning replay, cross-provider conversion, retries, usage and cost normalization, and the OpenCode Zen free tier. Mock script lines can carry "agent": "<profile>" (the line answers that sub-agent) and "delay_ms" (the response settles later), so parallel sub-agents and concurrent sessions are tested deterministically.