start
Spawn a program in a detached, persistent session and return its ID to control it across tool calls.
Instructions
Spawn a program in a new detached, persistent session and return its id.
The session survives across tool calls (a localhost-only daemon owns the live
PtySession). cmd is the command line to spawn, e.g. "python3" or
"lazygit". cwd and env configure only the controlled child process.
Returns {"ok", "sid"} on success. Use the returned sid for every other tool.
Server-side limits (violations return an error): at most 8 concurrent
sessions by default (tunable via SMARTCLI_MAX_SESSIONS); sid must be 1-64
chars matching [A-Za-z0-9][A-Za-z0-9_.-]*; env keys must be valid
identifiers and may not start with SMARTCLI_TUI_; cwd must be an existing
directory; terminal size is capped at 1000 cols x 500 rows (100000 cells).
Note: env values pass through the process command line briefly (visible
in ps) — avoid secrets.
detect_child_exit (default false) makes this session's waits END when the
child dies instead of sitting out the remaining timeout: a program that
crashes on your first input costs one poll cycle instead of the whole
ceiling. Off is exactly the previous behaviour. On, every wait tool also
reports exited (true only when the wait ended that way), and wait_ready
reports reason: "EXITED" alongside the usual MARKER/STABLE/TIMEOUT.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cmd | Yes | ||
| cwd | No | ||
| env | No | ||
| sid | No | ||
| cols | No | ||
| rows | No | ||
| detect_child_exit | No |