Control Yardmaster from scripts (CLI API)
Yardmaster answers commands from programs on this computer at 127.0.0.1:19519. A secret token unlocks them, so treat it like a password.
While it runs, Yardmaster listens for commands from other programs on this computer, at http://127.0.0.1:19519. Scripts, other AI tools and your own agents use it to list sessions, start one, send a message or change a setting. A secret token unlocks every command except a simple health check.
Find your token#
Open Settings > CLI Control.
On the CLI Control Token card, click Show to see it, or Copy to copy it.
Yardmaster also saves the token in a file, ~/.yardmaster/cli-token (in your home folder), so your scripts can read it from there instead of pasting it. It keeps a second copy at ~/.amc/cli-token for older scripts.
Change the token#
Click Regenerate Token on the same card and confirm. The old token stops working at once, so every script using it fails until you give it the new one. The card shows when the token was created, and the date turns amber once it is more than 90 days old: a good time to regenerate.
Choose what waits for your approval#
Under Approval requirements, each kind of action has its own switch: when it is on, a request from outside waits in your Inbox until you approve it. Most kinds start on, such as changing settings, running a recipe, sending email or texts, and installing plugins. Pausing, snoozing or archiving a session starts off.
Starting a new session is controlled by Require approval for AI session spawn, which starts off, so a script can start sessions without asking. Turn it on if you want to approve each one.
Recent CLI Activity on the same page lists what was done through the API, so you can check what a script or agent did.
Try it#
From a Mac or Linux terminal, this lists your sessions:
curl -H "Authorization: Bearer $(cat ~/.yardmaster/cli-token)" http://127.0.0.1:19519/sessionsOnly this computer. The server listens on 127.0.0.1, so other computers on your network cannot reach it. Only
/statusand/pinganswer without the token.Your agents get a narrower pass. Each session Yardmaster starts receives its own token that works only for that session and is refused on sensitive commands. It can still read the full token from the file, like any program running as you.
Spawns need a source. Require a source session for command-line spawns (on at first) rejects a new-session request unless it says which session asked for it, so plain scripts are refused until they send it. Turning it off lets plain scripts start sessions; a few other commands, such as sending a message to a session or running a recipe, always need the source session.
Spawned sessions follow their parent. A session started by an agent runs on the same engine, model and thinking level as the session that started it, unless the request names an engine. This beats the project's default engine. With no parent session (a plain script, a schedule) the project default applies as before. This covers both ways an agent starts a session: a new session, and a helper session it asks you to approve (
POST /agent/sessions).A parent engine that can't run is skipped. If the parent's engine can't start in the target project (it is turned off or not installed), the new session uses the project default instead of failing. A dedicated engine project, such as the Antigravity project, always runs its own engine and its own default model.
A few commands:
GET /sessions,GET /session/:id,POST /session/:id/message,POST /project/:name/new(start a session),POST /recipes/run,GET /settings,GET /search/fts,GET /cron/jobs.A different port. Set the
AMC_CLI_PORTenvironment variable before starting Yardmaster.Phone access uses its own pairing, not this token; see Mobile access.
Related
- Receive messages from your own tools with webhooksGive a script, build tool or monitor a private address on this computer, and each message it sends shows up in Yardmaster.
- Let agents use your other apps through ZapierConnect your own Zapier account and your Claude agents can read from and act in the apps you link there, such as spreadsheets, chat and email.