Liking cljdoc? Tell your friends :D

koine.process

Subprocesses, portable.

sh (run-to-completion) works on every host. spawn (a long-lived child with piped stdin/stdout) is the one MCP stdio transports need, and is the known gap on cljgo — see the cljgo work item in toolnexus ADR 0009.

Subprocesses, portable.

`sh` (run-to-completion) works on every host. `spawn` (a long-lived child
with piped stdin/stdout) is the one MCP stdio transports need, and is the
known gap on cljgo — see the cljgo work item in toolnexus ADR 0009.
raw docstring

alive?clj/s

(alive? child)

True while the child is running.

True while the child is running.
raw docstring

close!clj/s

(close! child)

Close the child's stdin, wait for it to exit, and return the exit code.

Close the child's stdin, wait for it to exit, and return the exit code.
raw docstring

read-line!clj/s

(read-line! child)

Block for one line from the child's stdout, WITHOUT the terminator. nil at EOF.

Block for one line from the child's stdout, WITHOUT the terminator.
nil at EOF.
raw docstring

send-line!clj/s

(send-line! child s)

Write s + newline to the child's stdin and flush. Returns nil.

Write `s` + newline to the child's stdin and flush. Returns nil.
raw docstring

shclj/s

(sh command)
(sh command {:keys [in dir env] :as opts})

Run command (a vector) to completion. Returns {:out :err :exit}. Never throws on a non-zero exit — that is a normal result. opts: :in (string on stdin) :dir :env

Run `command` (a vector) to completion. Returns {:out :err :exit}.
Never throws on a non-zero exit — that is a normal result.
opts: :in (string on stdin) :dir :env
raw docstring

spawnclj/s

(spawn command)
(spawn command {:keys [dir env]})

Start command (a vector) as a LONG-LIVED child with piped stdin/stdout and return a child handle — a map of closures, see above. This is what a line-delimited JSON-RPC transport (MCP stdio) requires; sh cannot express it.

opts: :dir :env

Start `command` (a vector) as a LONG-LIVED child with piped stdin/stdout and
return a child handle — a map of closures, see above. This is what a
line-delimited JSON-RPC transport (MCP stdio) requires; `sh` cannot express it.

opts: :dir :env
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close