Cross-Compile an Okibi CLI and Read Its Build Checks
AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.
Cross-Compile an Okibi CLI and Read Its Build Checks
An Okibi build compiles the generated CLI and runs a startup check on it before it reports success: every command must answer --help and doctor must run. This guide reads those results from the build, then cross-compiles the same source for three targets yourself. Compiling and a startup check are not a functional test of the CLI against your API, and only the Mac binary is run here.
What you will build
A check that the build's checks passed, followed by binaries cross-compiled for three platforms. Only the one built for the machine you are on is run.
okibi pipeline status -> Lint / Build / Test -> go build for linux, windows, macOS -> one binary each
AI Prompt
Using the Okibi CLI and the generated acme-orders project, show that the CLI builds for three platforms and passes the build's startup checks. Requirements: - Run `okibi clis pipeline status acme-orders --json` and report the Codegen, Lint, Build and Test results. - From the unpacked project, run `GOOS=<os> GOARCH=<arch> go build -o <file> ./cmd/acme-orders` for linux/amd64, windows/amd64 and darwin/arm64. - Report each binary's size and, for linux and windows, its file type. - Say which of the three binaries were run (only the one for your own machine can be) and that compiling and a help/doctor check do not test API behavior. - Run the verification step below before finishing.
Prerequisites
-
The Acme Orders example spec,
openapi.json(a fictional orders API). Download it into your working directory:curl -fsSLO https://raw.githubusercontent.com/heterochromatic/okibi-examples/main/acme-orders/openapi.json
-
acme-ordersgenerated from the Acme Orders example spec and pulled (okibi generate --spec ./openapi.json --name acme-orders --agent;okibi generate --agentdoes not download the CLI, so wait untilokibi status <run-id> --json(<run-id>isbuild.runIdfrom its output) shows"status": "succeeded", then runokibi pull <run-id>(the id comes fromokibi runs --agent)), with the project in./acme-orders. -
Go 1.26 or later and network access (the first cross build downloads platform dependencies).
-
Okibi CLI
0.2.11, logged in.
1. Read the build's checks
okibi clis pipeline status acme-orders --json
The build block shows the stages. On this CLI each one finished:
{
"build": {
"checks": "Lint done · Build done · Test done",
"status": "succeeded",
"statusWord": "Built",
"steps": [
{ "key": "codegen", "label": "Codegen", "shows": "done" },
{ "key": "lint", "label": "Lint", "shows": "done" },
{ "key": "build", "label": "Build", "shows": "done" },
{ "key": "test", "label": "Test", "shows": "done" }
]
}
}
When the build was created, the same stages were reported as 9 commands for codegen, no issues for lint, and 40 commands checked for the test stage, described as "Every command answers --help and doctor runs". That stage checks that commands respond, not that your API returns the right data.
2. Compile for three platforms
Run these from the project folder (the one with cmd/ and go.mod). If you are already inside it, skip the cd.
cd acme-orders GOOS=linux GOARCH=amd64 go build -o /tmp/ao-linux ./cmd/acme-orders GOOS=windows GOARCH=amd64 go build -o /tmp/ao-windows ./cmd/acme-orders GOOS=darwin GOARCH=arm64 go build -o /tmp/ao-darwin ./cmd/acme-orders ls -l /tmp/ao-* file /tmp/ao-linux /tmp/ao-windows
26397560 /tmp/ao-linux 26384384 /tmp/ao-windows 24972194 /tmp/ao-darwin /tmp/ao-linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked ... /tmp/ao-windows: PE32+ executable (console) x86-64, for MS Windows
Each target built without errors. Sizes depend on the Go version, so yours will differ slightly (a second run on another machine gave 26,403,859, 26,392,576 and 24,989,026 bytes). ls -l prints more columns than shown. The size is the column to compare. The first cross build printed go: downloading ... lines for platform-specific packages such as wincred and dbus.
Verify the result
file /tmp/ao-linux /tmp/ao-windows | cut -c1-60 rm -f /tmp/ao-linux /tmp/ao-windows /tmp/ao-darwin
Expected: an ELF 64-bit executable for Linux and a PE32+ executable for Windows.
How it works
The Okibi build compiles the project for each platform and runs a command check before it marks the run built: every command answers --help, and doctor runs. The source in ./acme-orders is standard Go, so the Go toolchain can build it for any target it supports. Different toolchains, dependency versions and build flags give binaries that differ in size and bytes, as the sizes in step 2 do, so do not expect the same binaries from different setups.
Common issues
The test stage checks help and doctor, not your data
40 commands checked means every command answered --help and doctor ran. Run your own checks against a real or staging API.
A lint warning does not stop the build
If the lint stage shows warning with a count of issues, the build and test stages can still pass. The issues are not listed in the status output. For this spec, lint was done with no issues.
The Linux and Windows binaries were compiled, not run
The Linux and Windows binaries were compiled but not executed here, since only a Mac was available. Cross-compiling shows that the source builds for those targets. It does not show that the binaries run there.
verification: status: verified tested_at: "2026-11-02" product_version: "okibi 0.2.11; acme-orders 1.0.0" command: "file /tmp/ao-linux /tmp/ao-windows" expected_result: "ELF 64-bit executable for linux and PE32+ executable for windows. The binaries were compiled, not run."
