Conventions
How koshi commands pick their target, how names and ids resolve, what they print, and which output formats they support.
Every koshi subcommand works the same way from inside a session and from any other shell. What changes is how the target is chosen.
Choosing a target
- Inside koshi — an omitted target means the current session, tab, pane, or client.
- Outside koshi — give a target, unless exactly one session is running. Then koshi uses it. Zero or several running sessions fail rather than guess.
Targets are passed as --session, --tab, --pane, and --client, and take
the ids that create and list commands print.
--remote <SERVER> runs one invocation against another machine instead of this
one. Everything after that — how a session is named, how a missing name is
resolved, what is refused — runs against that machine unchanged. See
Remote commands.
One running session plus koshi new-tab puts a tab in that session. Two running
sessions plus the same command fails, because koshi cannot choose safely.
Names and ids
A flag written NAME_OR_ID takes either the target's generated name or its
printed id:
koshi kill-session amber-fox
koshi kill-session session-3f2a…A value that reads as an id is always used as an id — it never falls back to a
name lookup. A name that several targets share is refused, and the error lists
every matching id. --pane and --client take ids only.
What create commands print
| Command | Prints |
|---|---|
koshi new-pane | one pane id |
koshi run | one pane id |
koshi new-tab | its tab id and root pane id |
koshi --headless | its session id |
Ids print on stdout in creation order:
koshi new-tab
[TAB ID]: tab-<uuid>
[PANE ID]: pane-<uuid>Each line is labelled, so take the id off the end of it before reusing it:
pane=$(koshi new-pane --direction right | awk '{print $NF}')
koshi input --pane "$pane" "cargo watch -x test"Commands that create nothing print no id line.
Output format
List and inspect commands accept --format:
koshi list-panes --format table # default, for reading
koshi list-panes --format json # for scriptsLaunching
| Command | Result |
|---|---|
koshi | Start one session with one tab and shell pane, attached to this terminal |
koshi --profile <NAME> | Start from profile/<NAME>.kdl |
koshi --headless | Start a session with nothing attached, print its id, and return |
koshi --headless --allow-other-users | The same, and let this machine's other users reach the session |
The command map
Sessions
attach, detach, kill-session, --headless
Panes
new-pane, run, close-pane, resize-pane, focus-pane, input
Tabs
new-tab, close-tab, next, previous, focus, move
Discovery
list-sessions, list-tabs, list-panes, list-clients, inspect
Input lock
lock, unlock, toggle-lock
Keys and actions
keys list, describe, conflicts, validate; actions list, explain
Remote
share grant, revoke, list; remote new, edit, list, forget, set-secret; --remote
Config
config path, explain, check, migrate
Doctor
koshi doctor — one row per installation check
Debug
debug dump-state, debug dump-layout, debug events
Update
koshi update, koshi version, koshi server-version