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 func,curl, or automation scripts - inspect layouts, shells, chat, or agent state
- build AI agent integrations that interact with terminal sessions
Quick start
# Run from inside a taiku shell (auto-detects session + client)
taiku func list-tiles
taiku func run "ls -la"
taiku func get-layout
# Run from outside (specify session explicitly)
taiku func --session <name> list-users
taiku func --session <name> --client <id> split-hClient targeting
Many commands operate on a specific browser client's state (layout, workspace, focus). taiku resolves the target client automatically:
| Scenario | Behavior |
|---|---|
| Running inside a taiku shell | Auto-routes to the client that owns the shell via TAIKU_SHELL_ID |
| One browser client connected | Auto-targets that client |
Multiple clients, no --client | Returns an error listing available client IDs |
--client <id> specified | Targets that specific client |
Use taiku func list-users to see connected clients and their IDs.
Authentication
All remote commands require authentication as the session owner. The CLI uses
your login credentials from taiku login, or you can pass --token <api_key>.
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) |
Response
{ "result": { ... } }On error, returns an HTTP error status with a text body.
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/chat?client=<id> | getChat |
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 a tile horizontally or vertically, creating a new shell.
taiku func split-h # Split focused tile
taiku func split-v --tile 3 # Split specific tile| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key to split (default: focused tile) |
close-tile
Close a tile from the layout.
taiku func 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 func reset-layouttoggle-direction
Toggle a split's direction between horizontal and vertical.
taiku func 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 func 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 func 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 func maximize # Maximize focused tile
taiku func maximize --tile 3 # Maximize specific tile| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
focus-tile
Focus a specific tile.
taiku func focus-tile 3| Arg | Type | Description |
|---|---|---|
key | number | Tile key to focus |
focus-direction
Focus the neighboring tile in a direction.
taiku func 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 func 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 func 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 func list-tilesget-tab-groups
List tab groups (tiles with multiple tabbed items).
taiku func get-tab-groupsTabs
Commands for switching tabs inside a tabbed tile.
select-tab
Switch to a tab by zero-based index.
taiku func select-tab 1
taiku func 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 func next-tab
taiku func 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 func prev-tab
taiku func prev-tab --tile 3| Option | Type | Description |
|---|---|---|
--tile | number? | Tile key (default: focused tile) |
show-layout / show-tree
ASCII visualization of the current layout.
taiku func show-layout # JSON pretty-print
taiku func show-tree # Indented tree viewWorkspaces
Commands for managing workspaces (virtual desktops).
list-workspaces
List workspaces.
taiku func list-workspacescreate-workspace
Create a new workspace.
taiku func create-workspaceswitch-workspace
Switch to a workspace by index.
taiku func 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 func 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 func setup --grid 2x2
taiku func setup --grid 2x2 --tiles "shell,shell,tunnel:3000,shell"
taiku func 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.
list-shells
List all shells in the session.
taiku func list-shellscreate-shell
Create a new shell. Waits for server confirmation and returns the real shell ID.
taiku func create-shell
taiku func create-shell --cwd /tmp| Option | Type | Description |
|---|---|---|
--cwd | string? | Working directory for the new shell |
close-shell
Close a shell. Non-admin users can only close their own shells.
taiku func close-shell 3| Arg | Type | Description |
|---|---|---|
id | number | Shell ID |
write-to-shell
Write data to a shell. When run from inside a taiku shell without specifying an ID, writes to the current shell.
taiku func 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 func run "ls -la"
taiku func run "npm start" --tile 2| Arg | Type | Description |
|---|---|---|
command | string | Command to execute |
| Option | Type | Description |
|---|---|---|
--tile | number? | Target tile (default: focused tile or source shell) |
get-shell-output
Get terminal output from a shell.
taiku func get-shell-output 3
taiku func get-shell-output 3 --chunks 5| Arg | Type | Description |
|---|---|---|
id | number | Shell ID |
| Option | Type | Description |
|---|---|---|
--chunks | number? | Number of output chunks |
get-terminal-names
Get shell names/titles as seen by the target client.
taiku func get-terminal-namesSession info
Commands for reading session metadata and user state.
get-session
Get session metadata (ID, name, user count, shell count).
taiku func get-sessionlist-users
List connected users/clients. Use this to find client IDs for --client.
taiku func list-usersReturns:
[
{
"id": 1,
"name": "nathanz",
"canWrite": true,
"device": "Mac Web",
"clientKind": "browser"
},
{
"id": 2,
"name": "nathanz",
"canWrite": true,
"device": "Desktop App",
"clientKind": "desktop"
}
]get-role
Get the executing client's role (admin, writer, or reader).
taiku func get-roleget-ownership
Get shell ownership info: which shells this client owns, which are owned by others, and which are unowned.
taiku func 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 func adopt-shell 5| Arg | Type | Description |
|---|---|---|
id | number | Shell ID to adopt |
Chat
get-chat
Get chat history.
taiku func get-chatsend-chat
Send a chat message.
taiku func send-chat "hello everyone"| Arg | Type | Description |
|---|---|---|
message | string | Message text |
broadcast-event
Broadcast a plugin event to all connected clients. Cannot be targeted to a single client.
taiku func 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 func list-agentsget-agent-cost
Get token usage and cost summary across all agents.
taiku func get-agent-costlist-agent-sessions
List agent sessions (distinct agent runs).
taiku func list-agent-sessionsget-agent-events
Get events from a specific agent session.
taiku func get-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 |
Tunnels
list-tunnels
List active tunnel ports.
taiku func list-tunnelsNotifications
toast
Show a toast notification on the target client.
taiku func 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 func notify "Alert" --body "Something happened"| Arg | Type | Description |
|---|---|---|
title | string | Notification title |
| Option | Type | Description |
|---|---|---|
--body | string? | Notification body text |