Streaming vs single mode
A program can run Syntic Code in two ways. Single mode sends one prompt, waits for the whole answer and exits. Streaming mode keeps the output coming as the run happens, one JSON message at a time, and can also read its input as JSON messages.
The Syntic Code SDK packages are not released yet. This page covers the command-line behaviour that programs use today, and the same switches are what the SDK will build on.
Single mode
Add -p (or --print) to a syntic command. The run takes one prompt, does the work and prints the result:
syntic -p "list the TODO comments under src/"Choose the shape of the printed result with --output-format:
| Value | You get |
|---|---|
text (default) | The final answer as plain text. |
json | One JSON object with the answer and the run details. |
Single mode is the right choice when the program only needs the end result and can wait for it.
Streaming mode
Set --output-format stream-json and add --verbose. Syntic Code then writes one JSON message per line while the run goes on: a start record, status records, each assistant message, and a final result record.
syntic -p "review the staged changes" --output-format stream-json --verboseStreaming mode is the right choice when the program needs to show progress, react to a message as soon as it arrives, or handle a long run without waiting for it to finish. How to read those messages is covered on Streaming output.
Streaming input
--input-format stream-json makes Syntic Code read its user messages from standard input as JSON, in the same kind of message format that streaming output uses. Use it together with --output-format stream-json when your program needs to drive the conversation in its own format:
my-program | syntic -p --input-format stream-json --output-format stream-json --verboseChoosing a mode
| Your program needs | Use |
|---|---|
| One answer, then exit | Single mode, --output-format json |
| Progress while the run goes on | Streaming mode, --output-format stream-json --verbose |
| Token-by-token text | Streaming mode with --include-partial-messages |
| Messages written in your own format | Streaming input with --input-format stream-json |
Control messages
With streaming input, standard input stays open for the whole run, and the program can send more than user messages. A user message sent after a turn ends starts the next turn in the same process. Control requests have the shape {"type":"control_request","request_id":"<your id>","request":{"subtype":"..."}}, and each gets one control_response with the same id:
subtype | Effect |
|---|---|
initialize | Registers host-run hooks and in-process tool servers (sdkMcpServers). |
interrupt | Stops the current turn. Its result is reported as cancelled; the session stays open. |
set_model | Switches the model from the agent’s next step. |
set_permission_mode | Changes the permission mode from the next tool call. |
set_max_thinking_tokens | Changes the thinking budget. |
mcp_status | Lists the run’s MCP servers and their status. |
Add --permission-prompt-tool stdio to have permission questions sent to the program as can_use_tool requests. Closing standard input ends the session. Permission questions are covered on User input.
Keep a conversation going
--session-id and --resume work the same way in both modes. The run is saved under the session id, and a later run can continue it. See Scripting and CI for the full set of run options, and the CLI reference for every flag.