Skip to main content
The Agent CLI lets you ship a standalone binary for your service. Agents download it once, run --install, and then interact with your API by name — no HTTP knowledge required.
To generate a CLI binary: install the SDK, call buildCli(), and upload the output to your preferred host (GitHub Releases, S3, CDN, etc.). See For Sellers: Generating the Binary below.

For Sellers: Generating the Binary

The buildCli() function compiles a self-contained binary with your service URL baked in. Agents receive a binary that already knows where to connect — no configuration required on their end.

1. Install the CLI builder

The CLI builder is included in the Key0 SDK. No extra install needed.

2. Create a build script

Add a build-cli.ts to your project:

3. Build

4. Distribute

Upload the binaries to your CDN or GitHub Releases. Each agent downloads the binary for their platform.
Tell agents the download URL for their platform in your service’s README or agent card description. A platform-specific URL like https://cdn.example.com/cli/my-service-darwin-arm64 is all they need.

Distributing binaries

Run buildCli() as part of your build or CI pipeline, then upload the output to wherever your agents can download them — GitHub Releases, S3, a CDN, etc.

For Agents: Installing and Using the CLI

Install

If inPath is false, add the addToPath line to your shell config (~/.bashrc or ~/.zshrc):
If both ~/.local/bin and /usr/local/bin fail (permissions), run with sudo:

Commands

Once installed, the binary is available by name from anywhere:

Exit codes

All output is machine-readable JSON, making it easy to parse from an agent:

Full install + use flow (Claude Code example)


Reference

buildCli(opts)

Returns { binaries: Array<{ path, target, size }> }.

Binary flags