Blackbird

Flight Manual · 06

Driving Blackbird from programs

Hand Blackbird work from shell scripts, CI, or other agents with --once, or attach a live stateful session over framed pipes with --application.

One-shot commands

Shell · Single turn in plain mode
blackbird --once 'Inspect this project and explain its build.' --effort medium

--once PROMPT executes one turn in plain mode and exits. The model's reply—and anything else the turn program displays—goes to stdout. Session path, status lines, tool outcomes, and warnings go to stderr, keeping piped output clean for shell scripts or agents like Claude Code.

  • Each call creates a fresh session unless you pass --session DIRECTORY. Only one process can hold a session at a time.
  • A one-shot run cannot pause to ask which reasoning effort you meant, so pass an --effort your provider supports.
  • --provider, --model, and --workflow behave the same way they do interactively.
  • SIGTERM stops the run cleanly with exit status 143.

One-shot runs have the exact same tools as an interactive session, with no confirmation prompts (details).

The application interface

For a long-lived session driven by another process, launch Blackbird with --application and exchange length-prefixed binary packets over stdin / stdout. You get the same sessions, providers, turn programs, and tools as the terminal; stdout carries only packets and diagnostics go to stderr.

Process · Framed stdio mode
blackbird --application

Each frame is a 4-byte big-endian length prefix followed by a BBM2 packet starting with magic bytes 42 42 4d 02. Packet sizes run from 5 to 4,194,304 bytes; a malformed, oversized, or truncated frame immediately closes the connection.

What you send

PacketPurpose
openMust come first. Carries id, session directory, and optional model, effort, workflow. Blackbird replies ready. Keeps the session's saved provider; new sessions default to OpenAI.
turnStarts a turn with id, objective, and optional observations (such as page captures with url, title, and text).
steerCancels the running turn and queues a replacement under a new id.
cancelStops the active turn and drops any queued replacement.
closeHalts work, flushes and saves the session, emits closed, and exits.

What you get back

PacketPayload
textChunk of the model's streamed reply.
statusWhat the engine is doing right now.
finalCloses a turn with outcome (completed, cancelled, or failed) and the displayed text.
errorCarries message and final_follows (whether a final packet for that turn is still coming).

Drain stdout continuously: Keep reading standard output until Blackbird exits—if your process stops draining the pipe, cancellation can stall. Closing stdin cancels whatever is running.

See the full application interface spec on GitHub for every field, byte limit, ordering rule, and optional host-provided tools.