Go CLI / Daemon SDK
Go daemon and rensei binary.
The rensei binary is the platform's Go CLI. It ships the full donmai OSS command surface (agent, fleet, governor, queue, dashboard, status) plus platform-exclusive commands for auth, project management, daemon lifecycle, and org administration - all authenticated via rsk_live_* API keys or WorkOS browser login.
Installation
brew tap RenseiAI/tap
brew install renseiAfter install, verify:
rensei --versionThe Homebrew cask pulls notarized binaries from github.com/RenseiAI/releases. The source is closed-source; only compiled binaries are distributed.
The rensei binary imports donmai commands from the open-source donmai module via afcli.RegisterCommands. Commands documented at donmai.dev/docs/cli (agent, fleet, governor, dashboard, queue, status) are available as-is within rensei.
First-time setup
Authenticate
rensei auth add --userOpens a browser to the WorkOS hosted login page. After approval, the access token is stored in ~/.config/rensei/config.json using your OS keychain by default.
For CI environments, pipe an rsk_* API key instead:
echo "$RENSEI_API_KEY" | rensei auth add --kind org_token --token-stdinSelect your project
rensei setupInteractive TUI prompts you to pick an org and project. Sets the active project in config so subsequent commands know which project to target.
Install the local daemon
rensei host installRegisters the daemon as a launchd (macOS) or systemd (Linux) service and
prepares its local configuration. Enable the projects it may serve with
rensei host project enable <slug> after installation.
Verify
rensei statusAggregates four health signals: auth state, local daemon reachability, platform-side host registration, and org capacity pool. Shows actionable next steps if anything is misconfigured.
Command tree
Auth - rensei auth
Manages named auth contexts stored in ~/.config/rensei/config.json. Supports three kinds: user (WorkOS device flow), org_token (rsk_ key scoped to an org), and project_token (rsk_ key scoped to a project).
| Command | Description |
|---|---|
rensei auth add --user | Start browser-based WorkOS device auth flow |
rensei auth add --kind org_token --token-stdin | Register an rsk_* key as an org-token context |
rensei auth list | List all saved auth contexts |
rensei auth show <name> | Show metadata for a context |
rensei auth activate <name> | Switch the active context |
rensei auth remove <name> | Delete a saved context |
Config is stored at ~/.config/rensei/config.json. Secrets are placed in the OS keychain by default; --secret-store encrypted_file or --secret-store env are available for headless environments.
Org - rensei org
# List org members
rensei org members list
# Invite a new member
rensei org invites create alice@example.com --role member
# Create an API key
rensei org api-keys create --name "ci-deploy" --scope read --scope write
# List API keys
rensei org api-keys listProject - rensei project
# Add a GitHub repository to the active project
rensei project repo add https://github.com/acme/backend
# Connect a Linear workspace as the issue tracker
rensei project trackers connect linear
# List project tokens (worker registration keys)
rensei project tokens list
# Create a new project registration token
rensei project tokens create --name "macbook-worker"Host - rensei host
Lifecycle commands for the local daemon process and launchd/systemd service registration. rensei host is the CLI's top-level noun for "this machine" (ADR-2026-08-03). As of v0.9.0 the legacy top-level worker alias (18 leaf paths, hidden since 2026-05-06) is removed outright, not deprecated further - rensei worker host install and friends now error with "unknown command."
| Command | Description |
|---|---|
rensei host install | Install the daemon as a system service |
rensei --org <slug> host project enable <project> | Enable a project for an org-scoped host without reinstalling the service |
rensei host uninstall | Remove service registration, wipe cached JWT |
rensei host setup | Interactive first-run wizard (no token, manual config) |
rensei host run | Run daemon in the foreground (useful for CI / debugging) |
rensei host start | Start the registered service |
rensei host restart | Restart the registered service |
rensei host status [--json] | Show daemon lifecycle state, uptime, active sessions |
rensei host logs [-F] [-n 50] | Tail daemon log file (~/Library/Logs/rensei/daemon.log) |
rensei host doctor [--json] | Run health checks on service registration and binary path |
rensei host pause | Stop accepting new sessions; in-flight sessions continue |
rensei host resume | Re-enable accepting new sessions after a pause |
rensei host drain [--timeout 300] | Graceful shutdown - drain in-flight work then stop |
rensei host stop | Immediate stop (interrupts in-flight sessions) |
rensei host update | Print Homebrew upgrade guidance (see below) |
rensei host deregister <host-id|machine-id|hostname> | New in v0.9.0. Soft-delete a host from the platform's capacity inventory (409 if live or has active sessions; --force overrides) |
rensei host restore <host-id|machine-id|hostname> | New in v0.9.0. Undo a deregistration (409 if the host has no recent heartbeat) |
Linux scope flags (applicable to install, uninstall, doctor):
rensei host install --user # user-scoped systemd unit (default)
rensei host install --system # system-scoped unit, requires sudoHost capacity - rensei host capacity
This machine's capacity envelope, session counts, and workarea pool - the only surface for this local state as of v0.9.0. It used to be reachable three ways: the top-level worker capacity alias and the hidden, never-deprecated daemon stats/daemon set/daemon evict duplicate tree both forwarded to the same factories host capacity composes. Both are deleted outright, not deprecated further.
# Show local capacity, session counts, and pool stats
rensei host capacity status [--pool] [--by-machine] [--machines] [--json]
# Adjust max concurrent sessions at runtime
rensei host capacity set capacity.maxConcurrentSessions 4
# Set maximum pool disk usage (LRU eviction threshold)
rensei host capacity set capacity.poolMaxDiskGb 20
# Evict stale workarea pool members
rensei host capacity evict --repo https://github.com/acme/backend --older-than 24h--machines enriches per-machine stats with org-level fleet metadata from the platform - it and --by-machine used to be masked because daemon stats was their only documented home; now that daemon stats is gone, both flags are un-hidden here so the org-level view stays discoverable. set writes to ~/.rensei/daemon.yaml atomically and signals the running daemon to reload the affected subsystem without a restart.
For the platform-sourced view of every host and sandbox across the whole org (not just this machine), use rensei capacity show --kind persistent-host instead - see CLI: Capacity.
Global flags
All commands accept these persistent flags:
| Flag | Env var | Description |
|---|---|---|
--url <url> | RENSEI_API_URL | Override the platform base URL (default: https://app.rensei.ai) |
--org <slug> | - | Override the active organization |
--project <slug> | - | Override the active project |
--auth <name> | - | Use a named auth context instead of the active one |
--token-stdin | - | Read token from stdin (most commands) |
--json | - | Emit JSON output on commands that support it |
Configuration
Config is read from ~/.config/rensei/config.json. Key fields:
{
"apiBaseURL": "https://app.rensei.ai",
"activeAuth": "my-org",
"auths": {
"my-org": {
"kind": "org_token",
"orgSlug": "acme",
"activeProjectSlug": "backend"
}
}
}View with rensei config show, change defaults with rensei config set <key> <value>, reset to defaults with rensei config reset.
Daemon config - ~/.rensei/daemon.yaml
The daemon reads its configuration from ~/.rensei/daemon.yaml at startup. Key sections:
platform:
url: https://app.rensei.ai
capacity:
maxConcurrentSessions: 2
poolMaxDiskGb: 20
projects:
- id: backend
repository: https://github.com/acme/backend.gitThe projects allowlist must include an entry for each repository the daemon is permitted to accept work for. Bind repositories with rensei project repo add, then enable the project for the host with rensei host project enable.
Daemon HTTP API
The daemon exposes a local HTTP control API on 127.0.0.1:7734 (configurable). The rensei host commands talk to this API. You can also reach it directly:
# Status
curl http://127.0.0.1:7734/api/daemon/status
# Stats
curl http://127.0.0.1:7734/api/daemon/stats?pool=trueCredential socket protocol
The daemon mediates credential delivery to agent subprocesses over a Unix socket at $XDG_RUNTIME_DIR/rensei/credentials.sock (or /var/run/rensei/credentials.sock for system-scoped installs).
Protocol is line-delimited JSON, one connection per agent session:
Agent → Daemon: {"type":"HELLO","sessionId":"sess_..."}
Daemon → Agent: {"type":"INITIAL","env":{"ANTHROPIC_API_KEY":"sk-...","LINEAR_API_KEY":"..."}}
Daemon → Agent: {"type":"UPDATE","env":{"ANTHROPIC_API_KEY":"sk-rotated..."}} # on OAuth rotation
Agent → Daemon: {"type":"BYE"}The daemon resolves credentials at spawn time by calling POST /api/daemon/credentials/snapshot on the platform (Bearer rsk_* auth) and merges them into the child process's exec environment. The socket provides a fallback and live-rotation channel.
RENSEI_CREDENTIAL_SNAPSHOT_FAILED=1 in the child's env signals that the spawn-time snapshot failed; the agent should rely on the socket INITIAL frame.
For more details, see credential socket.
Worker registration flow
When you run rensei host install, the CLI registers the service with
launchd/systemd and prepares the local daemon configuration. Project admission
is a separate, explicit step:
- Bind each project repository with
rensei project repo add. - Enable that project on the local host with
rensei host project enable <slug>. - Use
rensei --org <slug> host project enable <project>when enabling a project for another organization on the same service.
On boot, the daemon registers through the platform's scoped credential flow. Subsequent heartbeat, polling, and session-lifecycle calls use its runtime credential.
See the worker registration reference for the full protocol.
Upgrading
brew upgrade renseiBetween versions 0.7.2 and 0.7.3 the launchd service label was renamed from dev.rensei.daemon to dev.donmai.daemon for the OSS donmai binary, while the platform rensei binary continues to use dev.rensei.daemon. If you are upgrading from a pre-0.7.3 rensei install, any stale dev.rensei.daemon plist from before 0.7.3 may conflict. Run rensei host doctor to check, and if needed:
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/dev.rensei.daemon.plist
rm ~/Library/LaunchAgents/dev.rensei.daemon.plist
rensei host install