What this repository’s CI runs today
On every pull request and on pushes to the trunk, one job runs these steps in order:-
The docs regenerate and the tree must not move.
gen:docsrebuilds the reference pages from the code, andgit diff --exit-codefails if that produced any change. A tool, scope, error code, route or CLI command that changed without a regeneration turns this red. It is the only thing stopping these pages from quietly describing an older surface. -
The CLI is not executed in CI. Nothing in that list runs a command
against a device.
typecheckcovers the CLI’s source, so it is compile checked, and the unit tests cover the argument parser, which is pure and needs no process. Neither is the same as running it. -
An end to end script exercises the whole sequence.
corepack pnpm e2e:clistarts a control plane and a stand in device, then runs the full sequence from registering a row through acquiring, observing, acting and releasing, plus the negative cases. It is run on demand rather than on every commit.
Using the CLI in your own pipeline
Nothing above stops you from running it. These are the constraints that actually apply.Install it as a package
Your pipeline does not need a checkout of anything. Install the published CLI and call it by name:npm install -g phonebase@<version>, with a version from the package’s own
npm page. phonebase --version
reports what a runner actually installed. The examples below call phonebase
directly.
Authenticate from the environment
A runner has nobody to approvephonebase login, so put an API key in a
secret and export it. PHONEBASE_API_KEY takes precedence over any key a
login stored, and the CLI never reads a credential from a flag, so a key cannot
leak into a command line that a build log echoes.
--server <url>, or set
PHONEBASE_SERVER, for any other.
The server must be https unless it is loopback. Sending a credential in the
clear to a remote host is refused rather than warned about.
Give the key only what the job needs
Issue a separate key per pipeline, scoped to what that pipeline does and, if the job only ever touches one device, narrowed to that device. A key restricted to a subset cannot see the rest of the fleet, so a mistake in a script cannot reach a device the job was never meant to touch. See Authentication.Release what you acquire
A lease is exclusive, and a job that exits without releasing blocks the next one until the lease expires on its own. Release in whatever your runner calls a cleanup step, not on the happy path.Parse the machine readable output
Use--json for anything a script reads. It prints the structured result the
tool returned, whose shape is published in the
tool reference. The default human summary is written for a
person and is free to change.
Expect to queue
Devices are exclusive and physical hardware is scarce, so a job may wait for a device rather than getting one immediately. Build for that: fail the step with a clear message rather than retrying an acquire in a tight loop.Watch a run to completion
If your job hands a goal to the agent tier rather than driving each step,run returns a run id immediately. Pass --watch to poll until the run
reaches a terminal state, and the exit code follows the outcome.
--executor phonebase in CI. An API key’s default executor is
self_hosted, which needs your own worker and a worker URL that a CI log must
not hold. From CLI 0.3.0, --watch --json refuses an
explicit self_hosted run before starting it, and cancels a run the default
made self_hosted. Both exit 2. On 0.2.1, an API key running --watch
without --executor gets a self_hosted run that stays queued until its
deadline, holding the device, because no worker ever connects.
--max-steps can only lower the budget. The control plane’s own ceiling
cannot be raised from a client. See Runs.