clnkrd(1)
β¨ clnkrd β your stdio JSONL bestie for clnkr β¨
no cap, this is clnkrd(1) from the General Commands Manual section, and we are going all the way through it, every last flag, periodt π
π NAME π
clnkrd β stdio JSONL adapter for clnkr
πΈ SYNOPSIS πΈ
clnkrd [--model name] [--base-url url] [--provider mode] [--provider-api surface] [--act-protocol protocol] [--effort level] [--thinking-budget-tokens n] [--max-output-tokens n] [--max-steps n] [--continue] [--load-messages file] [--event-log file] [--no-system-prompt] [--system-prompt-append text] [--dump-system-prompt] [--version]
π DESCRIPTION π
okay so picture this: clnkrd runs clnkr behind a newline-delimited JSON protocol on standard input and standard output. Your frontend writes one JSON command per line to stdin, and clnkrd writes one JSON event per line to stdout. that's the whole vibe. π¦
Normal diagnostics, flag errors, configuration errors, JSONL decode errors, and run errors all go to stderr. in JSONL mode, stdout is reserved for protocol events β do not touch it, it's booked π
clnkrd is a stdio adapter. it does not open sockets, authenticate clients, serve HTTP, host plugins, or manage a background service lifecycle. it's giving minimal. it's giving boundaries. we love that for it β¨
fun fact: clnkr can launch clnkrd through bash for bounded child work. in that use, clnkrd is still just a stdio JSONL process; stdout, stderr, and --event-log are the child artifact surfaces. iykyk π§
π JSONL COMMANDS π
Every stdin line is one JSON object with a type field. one line, one object, no cap.
promptβ start a run. it needstextandmode.modeisapprovalorfull_send. only onepromptcan run at a time, so no multitasking bestie π
{"type":"prompt","text":"inspect this repo","mode":"approval"}
replyβ answer a pendingapproval_requestorclarifyevent. for approval,textequal toyapproves the command batch. any other non-emptytextrejects the batch and gets sent back to the model as guidance. soyis the yes, and literally anything else is a whole conversation.
{"type":"reply","text":"y"}
compactβ compact older transcript history. optionalinstructionsget passed to the compaction summarizer, so say what you want kept.
{"type":"compact","instructions":"keep test failures and decisions"}
shutdownβ cancel an active run, drain pending events, and exit successfully. the graceful goodbye π«Ά
{"type":"shutdown"}
π JSONL EVENTS π
Every stdout event is a JSON object with type and payload fields. here's the whole roster:
debugβ diagnostic metadata and internal progress. Payload:message.responseβ accepted model turn. Payload:turn,usage, and optionalraw.usagecontainsinput_tokensandoutput_tokens.protocol_failureβ rejected model response. Payload:reasonandraw. not every message makes the cut πapproval_requestβ command batch waiting for areply. Payload:promptandcommands. Each command hascommandand optionalworkdir.clarifyβ user question waiting for areply. Payload:question.command_startβ command execution started. Payload:commandanddir.command_doneβ command execution finished. Payload:command,stdout,stderr,exit_code,feedback, and optionalerr.compactedβ transcript compaction completed. Payload:compacted_messagesandkept_messages.doneβ prompt run completed. Payload:summary.errorβ driver-visible run error. Payload:message.
π OPTIONS π
clnkrd accepts the same provider, prompt, session, and run-control options as the clnkr CLI where they apply to non-interactive operation: --model, --base-url, --provider, --provider-api, --act-protocol, --effort, --thinking-budget-tokens, --max-output-tokens, --max-steps, --continue, --load-messages, --event-log, --no-system-prompt, --system-prompt-append, --dump-system-prompt, and --version.
and listen: --event-log writes the same JSONL event stream to a file while also writing events to stdout. two places at once. she's versatile π
π¦ CHILD ORCHESTRATION EXAMPLE π¦
Run one bounded child and inspect its JSONL events:
children=$(mktemp -d /tmp/clnkr-children.$$.XXXXXX)
mkdir -p "$children/readme"
printf '%s\n' '{"type":"prompt","text":"Inspect README.md. Do not edit files. Return evidence and uncertainty.","mode":"full_send"}' |
clnkrd --event-log "$children/readme/events.jsonl" \
> "$children/readme/out.jsonl" \
2> "$children/readme/err"
sed -n '1,200p' "$children/readme/out.jsonl"
Run two independent children in parallel, then synthesize their output:
children=$(mktemp -d /tmp/clnkr-children.$$.XXXXXX)
mkdir -p "$children/code" "$children/docs"
printf '%s\n' '{"type":"prompt","text":"Review prompt.go for clnkrd child orchestration risks. Do not edit.","mode":"full_send"}' |
clnkrd --event-log "$children/code/events.jsonl" \
> "$children/code/out.jsonl" 2> "$children/code/err" & pid1=$!
printf '%s\n' '{"type":"prompt","text":"Review doc/*.1.md for child orchestration docs. Do not edit.","mode":"full_send"}' |
clnkrd --event-log "$children/docs/events.jsonl" \
> "$children/docs/out.jsonl" 2> "$children/docs/err" & pid2=$!
wait "$pid1" "$pid2"
sed -n '1,200p' "$children/code/out.jsonl"
sed -n '1,200p' "$children/docs/out.jsonl"
two children, running in parallel, minding their own business. main character energy fr fr π
β EXIT STATUS β
0β clean EOF on stdin,shutdown,--help,--version, or--dump-system-prompt. the happy endings π1β invalid flags, missing provider configuration, bad JSONL input, invalid command sequencing, session load failure, provider error, command/run error, or event write failure. a lot of ways to trip, bestie, watch your step π130β interrupted bySIGINT. Ctrl+C said "enough" π
π ENVIRONMENT π
CLNKR_API_KEYβ API key for the LLM provider.CLNKR_PROVIDERβ provider adapter semantics.CLNKR_PROVIDER_APIβ OpenAI-only API surface override.CLNKR_MODELβ default model identifier when--modelis not provided.CLNKR_BASE_URLβ default LLM endpoint when--base-urlis not provided.
π§ SEE ALSO π§
clnkr(1), clnkr(3), clnkr(7)
and that's the whole page, bestie π this one lives in the User Commands section of the manual, filed under clnkrd(1) β go read it, go run it, go slay β¨πΈ
π¦ where this page comes from
- ubuntu stonking: clnkr 0.3.11-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms