Remote Commands
Control a live taiku session from the CLI, scripts, or AI agents.
Remote Commands let you control a live taiku session from outside the browser.
Use them when you want to:
- drive a session from
taiku ctl,curl, or automation scripts - inspect layouts, shells, chat, or agent state
- build AI agent integrations that interact with terminal sessions
Quick start
taiku ctl is also available as taiku func; the two are the same command.
# Run from inside a taiku shell (auto-detects session + client)
taiku ctl list-tiles
taiku ctl run "ls -la"
taiku ctl get-layout
# Run from outside (specify session explicitly)
taiku ctl --session <name> list-users
taiku ctl --session <name> --client <id> split-hClient targeting
Commands run in a connected client: a browser tab, the desktop app, or the terminal client. Many operate on that client's own state (layout, workspace, focus), so taiku picks one:
| Scenario | Behavior |
|---|---|
| Running inside a taiku shell | Auto-routes to the client that owns the shell via TAIKU_SHELL_ID |
| One client connected | Auto-targets that client |
Multiple clients, no --client | Returns an error listing available client IDs |
--client <id> specified | Targets that specific client |
| No clients connected | Fails: something has to have the session open |
Commands that read session-wide state (shells, users, agents) can be answered by
any client and skip this choice. Use taiku ctl list-users to see connected
clients and their IDs.
Without --session, the CLI uses the session in TAIKU_SESSION (set inside
taiku shells), then the session you last started on this machine.
Where a tile is optional, leaving it out means the answering client's focused
tile, which can change if someone clicks elsewhere. Commands with an optional
tile also take --current, which targets the shell the command is running in
(macOS and Linux).
Authentication
All remote commands require authentication as the session owner. The CLI uses
your login credentials from taiku login. To use an API key instead, pass it
before the subcommand (taiku --token <api_key> ctl list-users) or set
TAIKU_TOKEN.
REST API
You can also send remote commands directly via HTTP:
curl -X POST https://taiku.live/api/v1/sessions/{session_id}/remote/command \
-H "X-Taiku-Token: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"method": "getLayout", "params": {}}'Request body
| Field | Type | Description |
|---|---|---|
method | string | Method name (e.g. getLayout, splitShell) |
params | object | Method-specific parameters |
target_client_id | number? | Target a specific browser client |
source_shell_id | number? | Shell ID for auto-routing (set automatically by the CLI) |
source_shell_auth | string? | Required with source_shell_id: that shell's TAIKU_SHELL_AUTH |
Response
{ "result": { ... } }On error, returns a text body with the status: 400 when the client refused the
command (the body is its error) or the request is malformed, 403 when you are
not the session owner, 404 for an unknown session or client, 503 when no
client is connected, 504 when no client answered within 5 seconds, and 410
when the session closed.
method can be any method from the
Plugin API, such as splitTile or
sendChat, and runs without plugin permission checks. The CLI commands below
cover the common ones.
GET shortcuts
Common read commands have GET shortcuts:
| Endpoint | Method |
|---|---|
GET .../remote/layout?client=<id> | getLayout |
GET .../remote/tiles?client=<id> | getTiles |
GET .../remote/workspaces?client=<id> | getWorkspaces |
GET .../remote/shells?client=<id> | getShells |
GET .../remote/users?client=<id> | getUsers |
GET .../remote/agents?client=<id> | getAgents |
GET .../remote/tunnels?client=<id> | getTunnelPorts |
Command reference
Layout
Commands that manipulate or read the target client's tiled terminal layout.
split-h / split-v
Split the tile of the shell you run it in, horizontally or vertically, creating a new shell beside it. Like the other commands that open or close a shell, it needs the Admin link (see Shells).
taiku ctl split-h # Split this shell's tile
taiku ctl split-v # The same, vertically| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key to split. Only this shell's own tile is accepted. |
close-tile
Close a tile from the layout.
taiku ctl close-tile --tile 3| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key to close (default: focused tile) |
reset-layout
Reset the layout to a balanced grid of all current tiles.
taiku ctl reset-layouttoggle-direction
Toggle a split's direction between horizontal and vertical.
taiku ctl toggle-direction --tile 3| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key whose parent split to toggle |
set-ratio
Set a split ratio (controls how space is divided between two tiles).
taiku ctl set-ratio 0.7 --tile 3| Arg | Type | Description |
|---|---|---|
ratio | float | Ratio between 0.1 and 0.9 |
| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
swap-tiles
Swap the positions of two tiles.
taiku ctl swap-tiles 1 2| Arg | Type | Description |
|---|---|---|
key_a | number | First tile key |
key_b | number | Second tile key |
maximize
Maximize a tile to fill the entire workspace.
taiku ctl maximize # Maximize focused tile
taiku ctl maximize --tile 3 # Maximize specific tile| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
focus-tile
Focus a specific tile.
taiku ctl focus-tile 3| Arg | Type | Description |
|---|---|---|
key | number | Tile key to focus |
focus-direction
Focus the neighboring tile in a direction.
taiku ctl focus-direction left| Arg | Type | Description |
|---|---|---|
direction | enum | left, right, up, or down |
rename-tile
Rename a tile (sets a custom label in the titlebar).
taiku ctl rename-tile "logs" 3| Arg | Type | Description |
|---|---|---|
name | string | New display name |
key | number? | Tile key (default: focused tile) |
get-layout
Get the current layout with tile positions and sizes.
taiku ctl get-layoutReturns:
{
"tiles": [
{ "key": 1, "type": "shell", "id": 1, "x": 0, "y": 44, "w": 756, "h": 813 },
{
"key": 2,
"type": "shell",
"id": 2,
"x": 756,
"y": 44,
"w": 756,
"h": 813
}
]
}list-tiles
List tiles on the current workspace (lighter than get-layout).
taiku ctl list-tileslist-tab-groups
List tab groups (tiles with multiple tabbed items).
taiku ctl list-tab-groupsTabs
Commands for switching tabs inside a tabbed tile. Only the terminal client
(taiku tui) answers these; the browser and the desktop app refuse them.
select-tab
Switch to a tab by zero-based index.
taiku ctl select-tab 1
taiku ctl select-tab 2 --tile 3| Arg | Type | Description |
|---|---|---|
index | number | Zero-based tab index |
| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
next-tab
Switch to the next tab in a tile.
taiku ctl next-tab
taiku ctl next-tab --tile 3| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
prev-tab
Switch to the previous tab in a tile.
taiku ctl prev-tab
taiku ctl prev-tab --tile 3| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
show-layout
Pretty-print the layout JSON from get-layout.
taiku ctl show-layoutWorkspaces
Commands for managing workspaces (virtual desktops).
list-workspaces
List workspaces.
taiku ctl list-workspacescreate-workspace
Create a new workspace.
taiku ctl create-workspaceswitch-workspace
Switch to a workspace by index.
taiku ctl switch-workspace 0| Arg | Type | Description |
|---|---|---|
index | number | Workspace page index |
list-user-tiles
List tiles for a specific connected client. Automatically targets the requested client.
taiku ctl list-user-tiles 2| Arg | Type | Description |
|---|---|---|
user_id | number | Client ID from list-users |
setup
Set up a grid layout with specific tile types.
taiku ctl setup --grid 2x2
taiku ctl setup --grid 2x2 --tiles "shell,shell,tunnel:3000,shell"
taiku ctl setup --grid 1x3 --tiles "shell,shell,shell" --commands "htop,git log,npm start"| Option | Type | Description |
|---|---|---|
--grid | string | Grid dimensions (e.g. 2x2, 1x3) |
--tiles | string? | Comma-separated cell specs. Use + for tabbed items. Forms: shell[:command], tunnel:<port>, browser[:url] |
--commands | string? | Comma-separated commands for shell tiles |
Shells
Commands for creating, reading, and writing to terminal shells.
Commands that type into a shell or read one (write-to-shell, run,
agent-prompt, rename-tile, get-shell-output, pane-read,
pane-process-info) act only on the shell you run them in, and only when the
session's owner has it open from the Admin link. If one is refused for that
reason, open the session's Admin link and run it again.
Commands that open or close a shell (create-shell, split-h, split-v,
close-shell) need the same, and run only from one of the owner's own shells. A
new shell is the owner's, opened the way a click opens one, and close-shell
closes only a shell of the owner's own.
list-shells
List all shells in the session.
taiku ctl list-shellscreate-shell
Create a new shell. Waits for server confirmation and returns the real shell ID.
taiku ctl create-shellclose-shell
Close a shell of the session owner's own.
taiku ctl close-shell 3| Arg | Type | Description |
|---|---|---|
id | number | Shell ID |
write-to-shell
Write data to a shell. To write to the shell the command runs in, pass
"$TAIKU_SHELL_ID" as the ID.
taiku ctl write-to-shell 3 "ls -la\n"| Arg | Type | Description |
|---|---|---|
id | number | Shell ID |
data | string | Data to write (use \n for enter) |
run
Execute a command (shorthand for write-to-shell with a newline appended).
taiku ctl run "ls -la"
taiku ctl run "npm start" --tile 2| Arg | Type | Description |
|---|---|---|
command | string | Command to execute |
| Option | Type | Description |
|---|---|---|
--tile | number? | Target tile (default: focused tile) |
--current | flag | Run it in the shell this command runs in |
get-shell-output
Get terminal output from a shell.
taiku ctl get-shell-output 3
taiku ctl get-shell-output 3 --chunks 5| Arg | Type | Description |
|---|---|---|
id | number | Shell ID |
| Option | Type | Description |
|---|---|---|
--chunks | number? | Number of output chunks |
list-terminal-names
Get shell names/titles as seen by the target client.
taiku ctl list-terminal-namespane-read
Read a pane's text. A browser tab answers it only for the shell the command runs in.
taiku ctl pane-read --current --source recent --lines 50| Option | Type | Description |
|---|---|---|
--tile / --shell | number? | Pane to read |
--current | flag | Read the shell this command runs in |
--source | enum | visible (default), recent, recent-unwrapped, or detection |
--lines | number? | Last N lines (default: all of the source) |
--format | enum | text (default) or ansi to keep colours |
pane-process-info
Show what is running in a pane's shell, so a script can check the pane is at a prompt before typing into it. A browser tab answers it only for the shell the command runs in, and leaves the process id, process group and tty empty.
taiku ctl pane-process-info --shell 3Session info
Commands for reading session metadata and user state.
get-session
Get session metadata (ID, name, user count, shell count).
taiku ctl get-sessionlist-users
List the clients connected to the session, by id, display name and kind. Use the
id with --client.
taiku ctl list-usersReturns:
[
{ "id": 1, "name": "nathanz", "clientKind": "browser" },
{ "id": 2, "name": "nathanz", "clientKind": "desktop" },
{ "id": 3, "name": "nathanz", "clientKind": "terminal" }
]clientKind is browser (a web browser or the mobile app), desktop (the
desktop app), terminal (a taiku tui client) or unknown. Running
taiku ctl from a shell in the session routes to the client that owns that
shell, so you rarely need to pick one.
get-role
Get the executing client's role (admin, writer, or reader).
taiku ctl get-roleget-ownership
Get shell ownership info: which shells this client owns, which are owned by others, and which are unowned.
taiku ctl get-ownershipadopt-shell
Adopt a shell into the target client's workspace. Admins adopt directly; regular writers send a request to the current owner.
taiku ctl adopt-shell 5| Arg | Type | Description |
|---|---|---|
id | number | Shell ID to adopt |
Events
Chat has no CLI command; over REST, use the getChat and sendChat methods.
broadcast-event
Broadcast a plugin event to all connected clients. Cannot be targeted to a single client.
taiku ctl broadcast-event myevent --data '{"key": "value"}'| Arg | Type | Description |
|---|---|---|
type | string | Event type name |
| Option | Type | Description |
|---|---|---|
--data | string? | JSON payload |
Agents
Commands for inspecting AI agent activity.
list-agents
List active AI agents detected in the session.
taiku ctl list-agentsget-agent-cost
Get token usage and cost summary across all agents.
taiku ctl get-agent-costlist-agent-sessions
List agent sessions (distinct agent runs).
taiku ctl list-agent-sessionslist-agent-events
Get events from a specific agent session.
taiku ctl list-agent-events abc123 --types tool_call,user_message --limit 20| Arg | Type | Description |
|---|---|---|
session_id | string | Agent session ID |
| Option | Type | Description |
|---|---|---|
--types | string? | Comma-separated event types to filter |
--limit | number? | Max events to return |
agent-wait
Wait until the agent in a pane settles, then print its state. Exits with code 4 on timeout.
taiku ctl agent-wait --tile 3 --until done| Option | Type | Description |
|---|---|---|
--tile / --shell | number? | The agent's pane |
--current | flag | The agent in the shell this command runs in |
--until | enum | idle, blocked or done; repeatable (default: whichever is first) |
--timeout | number | Milliseconds (default 120000, at most 6 hours) |
agent-prompt
Send a prompt to the agent running in a pane and check that it reacted. Fails
with agentPromptStalled if the agent's state does not change within 5 seconds.
Use run for a plain shell.
taiku ctl agent-prompt "run the tests" --tile 3 --wait --until doneTakes the same pane options as agent-wait, plus --wait to wait for the agent
to settle afterwards (--until and --timeout then apply).
Tunnels
list-tunnels
List active tunnel ports.
taiku ctl list-tunnelsComments
comment
Add a comment to a file as an agent. The file opens in a connected client so the comment can be anchored.
taiku ctl comment --file src/app.ts --line 42 --body "This can be null here"| Option | Type | Description |
|---|---|---|
--file | string | Path relative to the repo or vault root |
--line | string? | 1-based line, or START:END |
--match | string? | A quoted snippet to anchor on |
--body | string | Comment text |
--author | string? | Name shown on the comment (default agent) |
--reply-to | string? | Reply to this thread instead of starting one |
list-comments
Read back the comments on a file: each thread's status, the lines it covers, the quoted text, and every reply, plus pending suggestions. The file opens in a connected client, which decrypts the comments.
taiku ctl list-comments --file src/app.ts --json| Option | Type | Description |
|---|---|---|
--file | string | Path relative to the repo or vault root |
--status | string | open (default), resolved, or all |
--json | flag | Print JSON instead of the readable listing |
In a notebook each thread also names its cell, in a CSV file its row and column, and in a PDF its page.
resolve-comment
Resolve a thread once it has been dealt with, or reopen it with --reopen.
taiku ctl comment --file src/app.ts --reply-to <thread-id> --body "Added a null check"
taiku ctl resolve-comment <thread-id> --file src/app.tssuggest
Suggest an edit. The file is not changed until a writer accepts it.
taiku ctl suggest --file README.md --match "teh" --text "the"Takes the same --file, --line, --match and --author options as
comment, plus --kind (insert, delete, or replace, the default) and
--text for the new text.
Notifications
toast
Show a toast notification on the target client.
taiku ctl toast "Build complete" --kind success| Arg | Type | Description |
|---|---|---|
message | string | Notification text |
| Option | Type | Description |
|---|---|---|
--kind | string | info, success, or error (default: info) |
notify
Send a browser/desktop notification on the target client.
taiku ctl notify "Alert" --body "Something happened"| Arg | Type | Description |
|---|---|---|
title | string | Notification title |
| Option | Type | Description |
|---|---|---|
--body | string? | Notification body text |