User input
A program gives Syntic Code its input in one of three ways: the prompt in the command arguments, text piped on standard input, or JSON messages on standard input when --input-format stream-json is set. This page covers those routes and what happens when the agent needs an answer from a person or from your program.
The Syntic Code SDK packages are not released yet. This page describes the CLI behaviour that programs use today.
Give the prompt
The prompt can come from the arguments, from standard input, or from both. Anything piped in is added after the arguments. When there are no arguments, the piped text is the whole prompt:
git diff --staged | syntic -p "write a commit message for this diff"
syntic -p < task.mdFlags can go before or after the prompt.
Send a stream of messages
With --input-format stream-json, standard input carries JSON messages instead of plain text. Each user message is sent as JSON. This is the input side of streaming mode, and it accepts the same message shape that streaming output writes.
Standard input also carries control messages: a request to interrupt the turn, change the model or the permission mode, and the program’s answers to permission questions. See Streaming vs single mode for the list.
Permission questions in a run
Unless the program answers permission questions itself (see below), a run that would normally ask for permission cannot wait for a person, so the question is settled by the run’s own rules:
- An action that an allow rule covers runs without asking.
- An action that a deny rule covers is refused.
- Anything else is refused as well, and the agent is told why.
Choose the rules before the run starts:
syntic -p "fix the failing tests" \
--permission-mode acceptEdits \
--allowed-tools "Bash(npm test:*)"A non-interactive run never waits. Each refused call returns a reason to the agent, which then tries another approach.
Answer permission questions from your program
Start a streaming-input run with --permission-prompt-tool stdio:
my-program | syntic -p --input-format stream-json --output-format stream-json --verbose \
--permission-prompt-tool stdioWhen a call needs approval, Syntic Code writes a request and the call waits for the answer:
{"type":"control_request","request_id":"cli-3-1","request":{"subtype":"can_use_tool","tool_name":"Bash","input":{"command":"git push"},"reason":"why approval is needed"}}Reply with the same request_id:
{"type":"control_response","response":{"subtype":"success","request_id":"cli-3-1","response":{"behavior":"deny","message":"not on main"}}}behavior is allow or deny. Any other answer, an interrupt or closing standard input counts as a denial, and the agent sees message as the reason. Deny rules, plan mode and the other checks still run first, so the program is asked only about calls that would otherwise need a person. The value of --permission-prompt-tool can instead name an MCP tool that makes the decision.
Questions the agent asks
The agent can ask the person a multiple-choice question with its AskUserQuestion tool. In the interactive app the answer is given by the person. In a print run the question is written to the transcript, but no person answers it. A PreToolUse hook (including one the program registers through initialize) can supply the answers. Otherwise, do not depend on the agent getting an answer in a script; rely on the permission rules above, or on the run limits, to keep it bounded.
Stop a run
A run stops when it finishes its work, when it reaches --max-turns or --max-budget-usd, when the program sends an interrupt control request (streaming input), or when the process is ended by the operating system. Use the limits to keep unattended runs bounded:
syntic -p "update the changelog" --max-turns 8 --max-budget-usd 2With streaming input, send {"type":"control_request","request_id":"stop-1","request":{"subtype":"interrupt"}} to stop the current turn. Its result is reported as cancelled, and the session stays open for the next user message. See Streaming vs single mode.