Driving Blackbird from other programs
There are two ways to use Blackbird from another program: one-shot commands, which any program that can run a shell command can use, and a framed interface over standard input and output for applications that want a live session.
One-shot commands
blackbird --once 'Inspect this project and explain its build.' --effort medium
--once PROMPT runs a single turn in plain mode and exits. The turn's displayed output, which is the model's reply and anything the turn program displays, goes to standard output. The session path, status lines, tool outcomes and warnings go to standard error. A shell script, a scheduled job, or another coding agent such as Claude Code can call it this way.
- Without
--session, each call starts a new session. Pass--session DIRECTORYto keep one conversation across calls. - Only one process can hold a session at a time, so don't run two calls against the same session at once.
- A one-shot run can't stop to ask which effort level you meant. Pass an
--effortthe provider supports. --provider,--modeland--workflowwork as they do interactively, and are saved with the session.- Sending SIGTERM to
blackbirdstops the session cleanly. The command then exits with status 143.
Piped input also selects plain mode. Each line of input is then one turn; /paste starts a multi-line message and /send ends it.
A one-shot run uses the same tools as an interactive session, without approval prompts. Read What Blackbird can do on your machine before handing it work you haven't looked at.
The application interface
An application can hold a live session by starting Blackbird with --application and exchanging packets over pipes. It gets the same session storage, provider, turn program and tools as the terminal. Standard output carries only packets; diagnostics go to standard error.
Run the native executable directly for this mode. The blackbird launcher on your PATH adds a session argument that --application refuses. With the default install prefix:
"$HOME/.local/lib/blackbird/current/bin/blackbird" --application
Each packet is a four-byte big-endian length followed by one BBM2 packet, which starts with the bytes 42 42 4d 02. A packet is 5 to 4,194,304 bytes long. Malformed, oversized or truncated frames end the connection.
Commands
opencomes first, with anid, asessiondirectory, and optionalmodel,effortandworkflow. Blackbird answersready. The session keeps its saved provider; a new session starts with OpenAI.turnstarts a turn, with anid, anobjective, and optionalobservationssuch as page captures withurl,titleandtext.steer, with a newid, cancels the running turn and queues a replacement.cancelstops the running turn and clears any queued replacement.closestops work, saves the session, sendsclosed, and exits.
Events
textcarries a piece of the model's streamed text.statuscarries the engine's current status.finalends a turn, with anoutcomeofcompleted,cancelledorfailed, and the displayed text.errorcarries amessageandfinal_follows, which says whether afinalfor that turn is still coming.
Keep reading standard output until Blackbird exits: if your application stops reading, cancellation can be delayed. Closing standard input cleanly cancels active work.
The full application interface specification covers every field, size limit and ordering rule, and the optional tools an application can offer to the model.
Platoons
Running several agents together, including outside agents, is being built and is not usable yet.