seance ctl
CLI reference for the Séance socket API. All commands communicate with the running Séance instance over a Unix domain socket.
seance ctl [global-flags] <command> [args...]Global Flags
| Flag | Description |
|---|---|
--socket PATH | Override the Unix socket path (default: $SEANCE_SOCKET_PATH) |
--json | Output results as JSON |
--workspace N | Specify workspace context by ID |
--surface N | Specify surface/pane context by ID |
System Commands
ping
Health check. Returns pong if the server is running.
seance ctl pingidentify
Show the current pane, group, workspace, and window context.
seance ctl identifycapabilities
List all supported API methods.
seance ctl capabilitiestree
Print the full hierarchy: windows > workspaces > groups > surfaces.
seance ctl treeWindow Commands
list-windows
List all open windows.
seance ctl list-windowsnew-window
Create a new window.
seance ctl new-windowclose-window
Close a window. Defaults to the active window.
seance ctl close-window [INDEX]Workspace Commands
list-workspaces
List all workspaces, optionally filtered by window.
seance ctl list-workspaces [--window N]new-workspace
Create a new workspace with an optional title.
seance ctl new-workspace [--title TITLE]select-workspace
Focus/switch to a workspace by ID.
seance ctl select-workspace IDclose-workspace
Close a workspace by ID.
seance ctl close-workspace IDrename-workspace
Rename a workspace.
seance ctl rename-workspace ID TITLEreorder-workspace
Reorder a workspace. Supports --index, --before ID, or --after ID.
seance ctl reorder-workspace ID --index N
seance ctl reorder-workspace ID --before OTHER_ID
seance ctl reorder-workspace ID --after OTHER_IDmove-workspace
Move a workspace to another window.
seance ctl move-workspace ID --window INDEXlast-workspace
Switch to the last-active workspace.
seance ctl last-workspaceColumn Commands
move-column
Swap a column's position within its workspace.
seance ctl move-column --direction left|right [--workspace N]resize-column
Resize the active column.
seance ctl resize-column --wider|--narrower|--maximizeSurface (Pane) Commands
list-surfaces
List all panes, optionally filtered by workspace.
seance ctl list-surfaces [--workspace N]split
Create a new pane. Default direction is vertical (side-by-side).
seance ctl split [--direction vertical|horizontal]With --json, returns:
| Field | Description |
|---|---|
surface_id | ID of the newly created pane |
close-surface
Close a pane by ID.
seance ctl close-surface IDsend
Send text input to a pane.
seance ctl send "TEXT" [--surface N]Include \n to execute commands.
send-key
Send a key event to a pane.
seance ctl send-key KEY [--surface N]Supported keys: enter, ctrl+c, tab, escape, backspace, delete, up, down, left, right, etc.
read-screen
Read terminal output from a pane. Default: last 50 lines.
seance ctl read-screen [--lines N] [--surface N]With --json, returns:
| Field | Description |
|---|---|
text | Visible terminal text (last N lines) |
shell_state | "prompt" (idle), "running" (command in progress), or "unknown" |
cursor_row | Current cursor row position |
cursor_col | Current cursor column position |
rows | Terminal height in rows |
cols | Terminal width in columns |
expel-pane
Move a pane to a new or adjacent column.
seance ctl expel-pane --direction left|right [--surface N]resize-row
Resize pane height in a stacked column.
seance ctl resize-row --taller|--shorter [--surface N]reorder-surface
Reorder a tab within a column. Supports --index, --before ID, or --after ID.
seance ctl reorder-surface ID --index N
seance ctl reorder-surface ID --before OTHER_ID
seance ctl reorder-surface ID --after OTHER_IDlast-pane
Switch to the last-focused pane.
seance ctl last-pane [--workspace N]Notification Commands
notify
Send a desktop notification.
seance ctl notify --title "TITLE" --body "BODY" [--subtitle S] [--workspace N] [--surface N]list-notifications
List all notifications.
seance ctl list-notificationsclear-notifications
Clear all notifications.
seance ctl clear-notificationsBrowser Commands
browser-open
Open a URL in a new browser panel.
seance ctl browser-open URLWith --json, returns:
| Field | Description |
|---|---|
panel_id | ID of the newly created browser panel |
browser-navigate
Navigate an existing browser panel to a URL.
seance ctl browser-navigate URL [--panel ID]browser-reload
Reload the current page in a browser panel.
seance ctl browser-reload [--panel ID]browser-back
Navigate back in browser history.
seance ctl browser-back [--panel ID]browser-forward
Navigate forward in browser history.
seance ctl browser-forward [--panel ID]browser-get-url
Get the current URL of a browser panel.
seance ctl browser-get-url [--panel ID]With --json, returns:
| Field | Description |
|---|---|
url | Current page URL |
browser-list
List all open browser panels.
seance ctl browser-listWith --json, returns:
| Field | Description |
|---|---|
panels | Array of browser panel objects |
panels[].id | Panel ID |
panels[].url | Current URL |
browser-get-title
Get the page title of a browser panel.
seance ctl browser-get-title [--panel ID]With --json, returns:
| Field | Description |
|---|---|
title | Current page title |
browser-get-zoom
Get the zoom level of a browser panel.
seance ctl browser-get-zoom [--panel ID]With --json, returns:
| Field | Description |
|---|---|
zoom_level | Current zoom level (1.0 = 100%) |
browser-set-zoom
Set the zoom level of a browser panel.
seance ctl browser-set-zoom LEVEL [--panel ID]browser-is-loading
Check if a browser panel is currently loading.
seance ctl browser-is-loading [--panel ID]With --json, returns:
| Field | Description |
|---|---|
loading | true if loading, false otherwise |
browser-get-progress
Get the estimated load progress of a browser panel.
seance ctl browser-get-progress [--panel ID]With --json, returns:
| Field | Description |
|---|---|
progress | Load progress from 0.0 to 1.0 |
browser-eval
Evaluate JavaScript in a browser panel and return the result.
seance ctl browser-eval SCRIPT [--panel ID]Evaluates the script synchronously (pumps the glib main loop until the result is ready, up to 5 seconds).
With --json, returns:
| Field | Description |
|---|---|
result | JSON-serialized result of the JavaScript expression |
browser-close
Close a browser panel.
seance ctl browser-close [--panel ID]JSON Output Schemas
read-screen
{
"text": "string",
"shell_state": "prompt | running | unknown",
"cursor_row": 0,
"cursor_col": 0,
"rows": 24,
"cols": 80
}identify
{
"window_index": 0,
"workspace_id": 1,
"workspace_index": 0,
"pane_group_id": 5,
"surface_id": 12,
"browser_panel_id": null
}When the focused panel is a browser, surface_id is null and browser_panel_id contains the browser panel ID.
split
{
"surface_id": "string"
}Examples
Run a command in a separate pane
# Create a pane
SURFACE_ID=$(seance ctl --json split | python3 -c "import sys,json; print(json.load(sys.stdin)['surface_id'])")
# Run a command
seance ctl send "make test\n" --surface $SURFACE_ID
# Poll until complete
seance ctl --json read-screen --surface $SURFACE_ID
# Read the final output
seance ctl read-screen --surface $SURFACE_ID --lines 200
# Clean up
seance ctl close-surface $SURFACE_IDOrganize work across workspaces
# Create a workspace for tests
WS_ID=$(seance ctl --json new-workspace --title "tests" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
# Switch to it
seance ctl select-workspace $WS_ID
# Create panes within it
seance ctl split --direction vertical
# Switch back to previous workspace
seance ctl last-workspaceRead shell state before acting
# Check if the shell is idle before sending input
STATE=$(seance ctl --json read-screen --surface $SURFACE_ID | python3 -c "import sys,json; print(json.load(sys.stdin)['shell_state'])")
if [ "$STATE" = "prompt" ]; then
seance ctl send "npm install\n" --surface $SURFACE_ID
fiOpen a URL and read page content
# Open a URL in the browser
PANEL_ID=$(seance ctl --json browser-open "https://docs.example.com" | python3 -c "import sys,json; print(json.load(sys.stdin)['panel_id'])")
# Wait for the page to load
while [ "$(seance ctl --json browser-is-loading --panel $PANEL_ID | python3 -c "import sys,json; print(json.load(sys.stdin)['loading'])")" = "true" ]; do
sleep 0.5
done
# Read the page title
seance ctl browser-get-title --panel $PANEL_ID
# Extract text content via JavaScript
seance ctl browser-eval "document.body.innerText" --panel $PANEL_ID
# Clean up
seance ctl browser-close --panel $PANEL_ID