session_start
Start an interactive or long-running process in a fresh shell on the selected device and return session_id before completion. This does not automatically create a persistent shell: a one-shot command ends its session when it exits. To preserve working directory, variables, functions or an activated environment across commands, explicitly launch a shell that keeps reading stdin (for example, bash -i on Linux/macOS where available), then send subsequent commands through session_control(action=input) using the same session_id. Repeated session_start calls create independent processes. The interpreter is reported by list_clients as client_info.shell; choose a command suitable for the target platform. Linux/macOS use a PTY; Windows uses pipes without terminal emulation. Use session_read for output and session_control(action=stop) for cancellation. Shell state lasts only while that shell is alive; client disconnection terminates sessions and reconnect does not restore them. Each token retains up to six sessions. Finished records may expire after 30 minutes or be evicted when later sessions start.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for this process on the target device. | |
| env | No | Environment overrides for this command, merged with the client environment. Values must be strings. | |
| command | Yes | Shell command to execute on the target device. | |
| client_id | No | Six lowercase letters or digits from list_clients. Required for multi-device tokens, even when only one device is online; optional for single-device tokens. | |
| timeout_ms | No | Process execution timeout in milliseconds. 0 disables the timeout. | |
| client_token | Yes | Target client connection token, required with management access (including stdio and no-password mode). Device-scoped bearer access implicitly selects its own token. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cursor | Yes | Initial output byte cursor, always 0 for a new session. | |
| session_id | Yes | Session identifier used by session_read and session_control. |