User GuidePluginsAPI Reference

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-h

Client 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:

ScenarioBehavior
Running inside a taiku shellAuto-routes to the client that owns the shell via TAIKU_SHELL_ID
One client connectedAuto-targets that client
Multiple clients, no --clientReturns an error listing available client IDs
--client <id> specifiedTargets that specific client
No clients connectedFails: 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

FieldTypeDescription
methodstringMethod name (e.g. getLayout, splitShell)
paramsobjectMethod-specific parameters
target_client_idnumber?Target a specific browser client
source_shell_idnumber?Shell ID for auto-routing (set automatically by the CLI)
source_shell_authstring?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:

EndpointMethod
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
OptionTypeDescription
--tilenumber?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
OptionTypeDescription
--tilenumber?Tile key to close (default: focused tile)

reset-layout

Reset the layout to a balanced grid of all current tiles.

taiku ctl reset-layout

toggle-direction

Toggle a split's direction between horizontal and vertical.

taiku ctl toggle-direction --tile 3
OptionTypeDescription
--tilenumber?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
ArgTypeDescription
ratiofloatRatio between 0.1 and 0.9
OptionTypeDescription
--tilenumber?Tile key (default: focused tile)

swap-tiles

Swap the positions of two tiles.

taiku ctl swap-tiles 1 2
ArgTypeDescription
key_anumberFirst tile key
key_bnumberSecond 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
OptionTypeDescription
--tilenumber?Tile key (default: focused tile)

focus-tile

Focus a specific tile.

taiku ctl focus-tile 3
ArgTypeDescription
keynumberTile key to focus

focus-direction

Focus the neighboring tile in a direction.

taiku ctl focus-direction left
ArgTypeDescription
directionenumleft, right, up, or down

rename-tile

Rename a tile (sets a custom label in the titlebar).

taiku ctl rename-tile "logs" 3
ArgTypeDescription
namestringNew display name
keynumber?Tile key (default: focused tile)

get-layout

Get the current layout with tile positions and sizes.

taiku ctl get-layout

Returns:

{
  "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-tiles

list-tab-groups

List tab groups (tiles with multiple tabbed items).

taiku ctl list-tab-groups

Tabs

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
ArgTypeDescription
indexnumberZero-based tab index
OptionTypeDescription
--tilenumber?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
OptionTypeDescription
--tilenumber?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
OptionTypeDescription
--tilenumber?Tile key (default: focused tile)

show-layout

Pretty-print the layout JSON from get-layout.

taiku ctl show-layout

Workspaces

Commands for managing workspaces (virtual desktops).

list-workspaces

List workspaces.

taiku ctl list-workspaces

create-workspace

Create a new workspace.

taiku ctl create-workspace

switch-workspace

Switch to a workspace by index.

taiku ctl switch-workspace 0
ArgTypeDescription
indexnumberWorkspace page index

list-user-tiles

List tiles for a specific connected client. Automatically targets the requested client.

taiku ctl list-user-tiles 2
ArgTypeDescription
user_idnumberClient 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"
OptionTypeDescription
--gridstringGrid dimensions (e.g. 2x2, 1x3)
--tilesstring?Comma-separated cell specs. Use + for tabbed items. Forms: shell[:command], tunnel:<port>, browser[:url]
--commandsstring?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-shells

create-shell

Create a new shell. Waits for server confirmation and returns the real shell ID.

taiku ctl create-shell

close-shell

Close a shell of the session owner's own.

taiku ctl close-shell 3
ArgTypeDescription
idnumberShell 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"
ArgTypeDescription
idnumberShell ID
datastringData 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
ArgTypeDescription
commandstringCommand to execute
OptionTypeDescription
--tilenumber?Target tile (default: focused tile)
--currentflagRun 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
ArgTypeDescription
idnumberShell ID
OptionTypeDescription
--chunksnumber?Number of output chunks

list-terminal-names

Get shell names/titles as seen by the target client.

taiku ctl list-terminal-names

pane-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
OptionTypeDescription
--tile / --shellnumber?Pane to read
--currentflagRead the shell this command runs in
--sourceenumvisible (default), recent, recent-unwrapped, or detection
--linesnumber?Last N lines (default: all of the source)
--formatenumtext (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 3

Session info

Commands for reading session metadata and user state.

get-session

Get session metadata (ID, name, user count, shell count).

taiku ctl get-session

list-users

List the clients connected to the session, by id, display name and kind. Use the id with --client.

taiku ctl list-users

Returns:

[
  { "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-role

get-ownership

Get shell ownership info: which shells this client owns, which are owned by others, and which are unowned.

taiku ctl get-ownership

adopt-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
ArgTypeDescription
idnumberShell 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"}'
ArgTypeDescription
typestringEvent type name
OptionTypeDescription
--datastring?JSON payload

Agents

Commands for inspecting AI agent activity.

list-agents

List active AI agents detected in the session.

taiku ctl list-agents

get-agent-cost

Get token usage and cost summary across all agents.

taiku ctl get-agent-cost

list-agent-sessions

List agent sessions (distinct agent runs).

taiku ctl list-agent-sessions

list-agent-events

Get events from a specific agent session.

taiku ctl list-agent-events abc123 --types tool_call,user_message --limit 20
ArgTypeDescription
session_idstringAgent session ID
OptionTypeDescription
--typesstring?Comma-separated event types to filter
--limitnumber?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
OptionTypeDescription
--tile / --shellnumber?The agent's pane
--currentflagThe agent in the shell this command runs in
--untilenumidle, blocked or done; repeatable (default: whichever is first)
--timeoutnumberMilliseconds (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 done

Takes 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-tunnels

Comments

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"
OptionTypeDescription
--filestringPath relative to the repo or vault root
--linestring?1-based line, or START:END
--matchstring?A quoted snippet to anchor on
--bodystringComment text
--authorstring?Name shown on the comment (default agent)
--reply-tostring?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
OptionTypeDescription
--filestringPath relative to the repo or vault root
--statusstringopen (default), resolved, or all
--jsonflagPrint 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.ts

suggest

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
ArgTypeDescription
messagestringNotification text
OptionTypeDescription
--kindstringinfo, success, or error (default: info)

notify

Send a browser/desktop notification on the target client.

taiku ctl notify "Alert" --body "Something happened"
ArgTypeDescription
titlestringNotification title
OptionTypeDescription
--bodystring?Notification body text

On this page