Skip to content

Command line

cornercase opens the window. Its other commands manage the server, or drive it from scripts and coding agents.

Terminal window
cornercase # open the UI, starting the server if needed
cornercase remote HOST # open the UI on the server of another machine, over ssh
cornercase remote --known # list this computer's machines, for a program
cornercase --remote HOST status # a command for scripts, on the server of another machine
cornercase update # install the latest release and restart the server
cornercase restart # restart the server; the session comes back with new shells, agents resume
cornercase start-server # start the server and restore the session without opening a window
cornercase kill-server # stop the server and every shell in it
cornercase logs # print the end of the server's log
cornercase --version # print the version
cornercase --help # list every command; cornercase COMMAND --help explains one

The commands for scripts and agents, status, stats, usage, context, recap, bot, ports, tunnels, tunnel, processes, worktrees, pull-request, open, clone, new-workspace, new-tab, split, setup, start, send, keys, held, read, wait, events, surface, changes, files, view, view-set, input, scroll, selection, resize, redraw, ratio, link, paste-file, requests, theme, config, account, profile, machines, issue, search, close, agents, group, move, move-pane, collapse, expand, rename, focus, go, notify, todo, queue, away, mark, skill and contract, have their own page: Scripts and agents. Among them, status --follow keeps running and prints the whole session as one JSON line each time it changes, for another UI or a script that mirrors it, status --app prints (with --follow, keeps printing) the TODO list, queue, away, update and keep awake, config pair app, browsers, telegram.chat or discord.chat prints the address a pairing dialog’s QR code holds and waits for the phone, and worktrees remove --path FOLDER… removes what worktrees list shows as the Worktrees dialog does, a closed project’s worktree included, and with --delete-branch its branch under the dialog’s rules.

config forum-server ID picks the server of the Discord forum when the app is in several of yours, from the list in status --app, for a script or another UI that has no dialog: pick the forum’s server.

open takes a folder or a VS Code .code-workspace file, which it imports as a group and prints the group’s id; --into GROUP puts either in that group.

Attaches to the server, starting it first if none is running. A new server restores your saved session, or, when there is nothing to restore, opens the folder you ran the command from as a project.

When it starts, the client asks your terminal for its foreground, background and 16 ANSI colours (it waits at most a second for the answer, then briefly drains late replies), then turns on mouse reporting, bracketed paste and unambiguous key reporting. Late replies are dropped without reaching the pane. It puts your terminal back the way it was when it exits, and detaches cleanly if terminal input ends.

A client only attaches to a server started from the same binary. After an update, the old server may still be running, so cornercase asks on the plain terminal before opening the UI:

The running cornercase server comes from another build; cornercase was probably updated.
Restarting stops every program running in cornercase's terminals. Running now: 2 agents (1 working,
1 waiting for you) and 1 other program (`npm` in orders-api › main). Your projects, workspaces, tabs and
splits come back, each tab with a new shell in its folder. 2 agent conversations resume in their tabs.
Restart it now? [y/N]

The list comes from the old server itself, so you see what it is running before you answer. A server too old to say, or one that doesn’t answer within a second, gets a general warning instead. Answer y to stop the old server and start one on the new binary: your projects, workspaces, tabs and splits come back, each pane with a new shell in its folder, and Claude Code, Codex, Gemini CLI, Grok Build, Cursor CLI, Vibe CLI and GitHub Copilot CLI resume their conversations. Any other answer leaves the old server running and exits with the message below. When the input isn’t a terminal, as in a script, it doesn’t ask.

Opens the window on the server of another machine, through your own ssh (when the other machine is older and it is declined, or there is no terminal to ask in, it exits with status 5):

Terminal window
cornercase remote devbox # a host from ~/.ssh/config, or user@host
cornercase remote devbox --command '~/tools/cornercase' # where cornercase is on that machine
cornercase remote winbox --command 'C:\tools\cornercase.exe' # on a Windows machine, its path
cornercase remote --known --json # this computer's list of machines
cornercase remote --remember me@10.0.0.5 --command '~/bin/cornercase' # add a machine to that list, not shown
cornercase remote --forget devbox # take it off

It runs ssh devbox cornercase proxy, which starts the server there if none is running. On a Windows machine it runs it through cmd or PowerShell, whichever that machine’s OpenSSH Server uses, after finding out which on the first connection (A Windows machine at the other end). If the connection drops, the window stays, says reconnecting to devbox… and tries again by itself; Esc or its quit gives up. Both machines need the same version: when they differ it says which one to update, and offers to update the other machine through ssh when that one is older. Remote machines explains it all.

--known, --remember and --forget open no window and need no server or ssh: --known prints this computer’s list of machines (machines in config.json, the one Settings › Machines manages), as the machine button offers them, --remember adds one, not shown (a window asks before it first connects to it) and --forget takes one off, as Settings’ × does.

Terminal window
cornercase --remote devbox status --json
CORNERCASE_REMOTE=devbox cornercase events --json
cornercase --remote devbox --remote-command '~/tools/cornercase' start-server

A global option of the commands for scripts and agents, start-server and stats, and of the plugin commands: it sends the command to the server of another machine, through ssh, with --remote-command as --command of cornercase remote. Without a command it opens the window there. update, restart, kill-server, logs and the plugin commands that work on its files run on that machine, as its own cornercase through ssh, and exit with its status; plugin windows refuses it with status 2. Commands accept a machine that runs the same version or a newer one, and exit with status 5 on an older one (with --json, its version and the update command as JSON). Ids last one run of the server there, so every command that takes an id (close, send, read, events, …) takes --boot BOOT, and a server that restarted since you read the id refuses with status 4 instead of acting on, or reading, whatever has it now. A message that names a command to run next names it with the same --remote and --remote-command, so it runs as written on this machine, except a command that stays on this machine (remote, skill, server, proxy, plugin windows), a command a message names for the machine it is about (… there, … here), and a command that already has its own --remote. What update, restart, kill-server and the plugin commands print there names it the same way (logs and what --json prints on stdout are data, printed as they are). See Remote machines.

Installs the latest release from any shell, without waiting for the next check:

Terminal window
cornercase update # install it, then ask whether to restart the server
cornercase update --yes # install it and restart the server without asking (-y works too)
cornercase update --check # only say whether a newer version is out
cornercase update --json # for a program: say what happened as one line of JSON, never restart

It asks GitHub for the latest release. If yours is the latest, it prints cornercase 0.5.0 is up to date and stops. Otherwise it replaces the binary the same way the update dialog does (download, checksum, a test run of the new binary) and prints updated cornercase 0.4.2 → 0.5.0. If anything fails, it says why and the old binary stays.

The server that is running still has the old version, so update then asks:

The running cornercase server still runs 0.4.2.
Restarting stops every program running in cornercase's terminals. Running now: 2 agents (1 working,
1 waiting for you) and 1 other program (`npm` in orders-api › main). Your projects, workspaces, tabs and
splits come back, each tab with a new shell in its folder. 2 agent conversations resume in their tabs.
Restart it now? [y/N]

With y or --yes, it saves your session and restarts the server. --yes prints the same list first, since it doesn’t ask, and both print what was stopped afterwards, such as stopped 2 agents and 1 other program: every attached window reopens on the new version. Your projects, workspaces, tabs and splits come back, each pane gets a new shell in its folder, and agents resume their conversations. If you say no, or when the input isn’t a terminal and --yes isn’t given, the old server keeps running until you run cornercase kill-server. update never opens the UI. Run cornercase afterwards if you want it.

You can run it inside one of cornercase’s own panes. That pane closes with the server and reopens with the rest of your session.

A server running 0.4.2 or older doesn’t know how to restart itself, so this first time update stops it instead, like kill-server, and the attached windows close. Run cornercase again to get your session back on the new version. From the next update on, the windows reopen by themselves.

When cornercase can’t replace its own binary (Homebrew installed it, you can’t write to its folder, or your platform isn’t one it knows), update changes nothing. It prints the command to run instead (brew update && brew upgrade cornercase, or the install script) and exits with status 6, so a script can tell it from a failure (1). After that command, the next cornercase offers to restart the old server.

--check prints cornercase 0.5.0 is out (you have 0.4.2). Update it with: followed by the command, or that you are up to date. It exits with status 0 whatever it finds. Builds made with cargo run refuse to update.

--json is for a program, such as another interface’s update button, or a script that updates another machine with --remote: it prints what happened as one line of JSON and nothing else, asks nothing and never restarts the server, so it refuses --yes and --when-idle (status 2); restart it afterwards with cornercase restart. See Updates from a program.

Restarts the server, like settings → restart in the app. It first lists what is running in your terminals and asks Restart it now? [y/N], since restarting stops every program in them, agents included. With y or --yes, it saves your session and restarts the server: every attached window reopens, and your projects, workspaces, tabs and splits come back, each pane with a new shell in its folder and each agent in its conversation. --yes prints the list first, since it doesn’t ask, and both print what was stopped afterwards, such as stopped 1 agent and 2 other programs. If you say no, or when the input isn’t a terminal and --yes isn’t given, the server keeps running. If no server is running, it prints no cornercase server is running.

You can run it inside one of cornercase’s own panes. That pane closes with the server and reopens with the rest of your session.

An agent in the middle of a turn loses that turn when the server restarts: its conversation resumes, but not the tool call or the build it was running. --when-idle waits for the agents first, and works with update too:

Terminal window
cornercase restart --when-idle # ask, then restart once no agent is working
cornercase restart --when-idle --yes --timeout 3600 # without asking; give up after an hour
cornercase update --when-idle --yes # install now, restart on it once the agents are done

It lists what is running and asks Restart it once no agent is working? [y/N], then waits until every agent with a status has stopped working: idle, done, failed, pending review and waiting for you count as stopped, and so does a Claude Code agent whose turn is over while a shell it started in the background still runs. The server restarts in the same moment it sees that, so no agent starts a new turn in between; a prompt typed into an agent in the last two seconds, or one cornercase is still typing, holds it a moment longer. Meanwhile every window shows ↻ restart pending until 2 agents end their turn in its corner, so nobody starts a long task by surprise, and its cancel button calls the restart off.

An agent whose own turn is over while subagents it started still run holds it too. Other programs, such as a dev server, don’t hold the restart; they stop as with any restart. Neither does the pane the command runs in, so an agent can run it as its last step. --timeout SECONDS gives up after that long with status 1 and leaves the server running, as do cancel, Ctrl+C and ending the command, through --remote too. update --when-idle installs the release before it waits, so the new version is on disk whatever happens next. A server from a release without --when-idle can’t wait: the command says so, and the server keeps running.

Starts the server without opening a window, for a script or a program that drives cornercase on its own. It needs no terminal. If no server runs on the socket, it starts one; then the server restores your saved session once, as the first window would (the same projects, tabs and splits, agents resuming their conversations), or opens the folder you ran it from when there is no session. It returns once the terminals exist:

Terminal window
cornercase start-server # started: restored the session (160×48)
cornercase start-server --cols 200 --rows 60 # a size of your own
cornercase start-server --json # the answer as an object
cornercase start-server --theme dark.json # colours for the programs in the terminals

Until a window attaches, the terminals are 160 columns by 48 rows, or what --cols (90 to 1000) and --rows (10 to 500) say; a size out of range exits with status 1 and starts nothing. The first window that attaches takes the size over, as any window does, and gives the terminals its colours, unless --theme FILE (or - for standard input) gave them: JSON with the foreground, the background and the 16 ANSI colours, as cornercase theme takes. Unlike the size, --theme applies even when the server already runs. A program that asked for the colours before they were known keeps the default ones.

Run again, or with a window already attached, it starts and restores nothing, changes no size, and prints already running (window size 120×40) (or start-server size, when no window gave one yet). So it is also how a script learns that the server is ready. --json prints already, restored (a saved session was found), complete (every tab came back), cols, rows, size (window or start-server), boot, version and theme (from and scheme). restored and complete describe only the call that started the server: with already: true they are false and true, so read them from the first call. When some tabs could not be restored, or the server runs another version than the command, it says so on stderr and still exits 0. If no terminal could open at all (the shell cannot start), it exits 1 with the cause; the server keeps running, and a later call says already running.

Agents that resume their conversations are still being typed in when it returns: cornercase status and cornercase wait tell you when they are back. cornercase restart with no window attached leaves no server running: run start-server again.

Stops the server: every shell and program in every pane ends, and every attached client exits. It waits for the server to be gone before returning, then prints what it stopped when something was running, such as stopped 1 agent and 2 other programs. If no server is running on the socket, it prints no cornercase server is running.

Run from a terminal inside the server it would stop, it asks first: it lists what stops, says that this terminal closes too, and waits for y. Anything else keeps the server running. Without a terminal (an agent’s tool, a script) it refuses with status 1 unless you pass -y or --yes. To stop another server from inside cornercase, set CORNERCASE_SOCKET to its socket. With --remote it runs on that machine, through ssh.

Prints the end of the server’s log, server.log: what the server did, one line per event, as described in Troubleshooting. It reads the file directly, so it works with no server running.

Terminal window
cornercase logs # the last 200 lines
cornercase logs -n 50 # the last 50 (--lines works too)
cornercase logs --follow # then keep printing what the server writes, until Ctrl+C or until nothing reads it (-f works too)
cornercase logs --path # print only where the log is

When the log is short since it last moved to server.log.1, the lines before come from there. Without a log yet, it says so and exits with status 1. With --remote it prints that machine’s log, through ssh.

Keep several logins of Claude Code, Codex or Gemini CLI and choose which ones new agents start with: account add|list|remove (list --check asks each account whether it is logged in), account login AGENT ACCOUNT|--system (open the login tab again for an account whose login expired), account use AGENT ACCOUNT|--system (the default, for new workspaces and scripts), account restart AGENT [ACCOUNT|--system] [--pane ID]… (restart the open agents on it, in the same conversation, or with --pane also a shell at its prompt), account rename AGENT ACCOUNT|--system NAME|--clear (a name for the window; the folder stays), profile new|set|use|delete|list (a set of accounts to switch at once, for scripts), --account AGENT=ACCOUNT on start, new-tab, flow run and queue add|edit, and --profile NAME on start, new-tab and flow run. accounts_revision in status --app moves each time the accounts change. See Accounts and profiles.

Lists the other computers your work can run on, as Settings › Machines does, each with the state of the link your server keeps to its server, and changes the list:

Terminal window
cornercase machines # this computer, then each machine and its state
cornercase machines add vps ana@vps.example.com --icon server --folder '~/code'
cornercase machines add lab me@10.0.0.5 --command '~/bin/cornercase' --hidden # on the list and the button, no link
cornercase machines edit vps --name box --destination box.lan
cornercase machines edit box --command '' # no command: `cornercase` on the PATH there
cornercase machines remove vps # its server keeps running there
cornercase machines update mini # install your release on an older machine
cornercase machines retry [vps] # try one link, or every link, now
cornercase machines hide vps # keep it on the list, end its link; its server keeps running
cornercase machines show all # link every hidden machine again

--icon takes the glyph or its name (server, laptop, desktop, mini, home server, other), --folder is ~/code unless you give one, and edit changes only what you give. add refuses a name already listed and edit one that isn’t. cornercase flow sync [FLOW] [--machine NAME] sends your flows to them and prints what each got. hide and show take a name or all, and change nothing for a machine already hidden or shown (Hide a machine). Every subcommand prints the list, or with --json the machines answer, whose retry_at says when a link that fell tries next. A value the rules refuse, or an update that failed on the machine, exits with status 1 and says why. See Machines.

cornercase --remote vps clone URL '~/code' --file .env clones a repository on a machine with the git-ignored files of the repository here, read by the command, as the Clone on machine dialog does with the ones you tick; cornercase clone --list-ignored --json lists them, and needs no server.

cornercase status lists, after the projects of this computer, what each linked machine has, with paired with project N on a project that is a clone of the same repository as one here, and cornercase focus --machine vps --workspace ID picks one of its workspaces as the one shown, as a click on its row does: the window shows that workspace’s tab, streamed from the machine (with --boot, only if the machine has not restarted since you read the ids).

stats and usage read the machines too: --machine NAME prints that machine’s stats or plan limits, and --machine all this computer’s and every machine’s, the stats summed. Your server asks each machine through ssh, so the command needs it running; with --cached it asks nobody and answers at once with what it read last. See Stats and usage of each machine.

Terminal window
cornercase stats --machine vps
cornercase stats --machine all
cornercase stats --machine all --cached --json
cornercase usage --machine all --json

start, new-workspace and flow run take --machine NAME too: your server sends the command to that machine’s server, which starts the agent, the workspace or the flow there, with its own accounts, agents and trackers. --project and --workspace, and the ids printed, are the machine’s, as status lists them under it; --focus shows what started once the machine lists it, and --wait, --until and --timeout are refused; --boot with --machine is the boot of that machine’s entry in status --json, and a machine that restarted since is refused with status 4. When the machine refuses, a command its message says to run names it: --machine NAME for the commands that take it, there after any other, and cornercase status as it is, since yours lists the machine’s ids under it. start --placed, here or there, answers as soon as the tab is open, with the same ids, even while the agent asks whether to trust the folder: for a program that shows the new tab itself. See Start work on a machine and Start an agent.

Terminal window
cornercase start claude --issue '#482' --project 2 --machine vps --focus
cornercase start claude --issue '#482' --project 2 --machine vps --placed --json
cornercase flow run Quick --prompt 'Fix the login form' --project 2 --machine vps
cornercase start claude --issue '#482' --project 2 --machine auto

start and flow run also take --machine auto: your server picks this computer or the linked machine that has the project and the most free memory, counting what the start needs (a flow’s memory, else default_memory), and says which on standard error, auto → torre (11.3 GB free). Its ids are this computer’s. When no machine has room it starts nothing and exits with status 8 (error: no machine has 6 GB free (best: mac, 4.1 GB)). See Start work on a machine.

Shows the guided tour in the window, where it stopped. tour start TOUR starts another one (--step at a step), next, back, skip and end move it, complete TOUR STEP marks a step done, and reset [TOUR] forgets the progress. tour list prints every tour and its steps with your progress; with --json the steps come as data (ids, texts, what each points at and what completes it), so another UI can draw the same tour, and start --no-card keeps the window’s card hidden for it.

Prints what the running server supports: its version, the version of the contract it speaks, which start of the server it is (boot), and its requests and streams. --json prints it as an object, for programs that talk to cornercase. A server too old to have it says so. See Contract and compatibility.

Installs, adds, lists and turns on and off plugins. It reads and writes plugins.json directly, so it works with no server running, except status, actions, run and popup-close, which ask the running server; a running server picks up the change within a second. With --remote every plugin command but windows acts on that machine’s plugins, and the folders of link and install are that machine’s.

Terminal window
cornercase plugin install acme/notes # fetch it, show what it runs, ask, install it turned off
cornercase plugin install acme/notes@v1.2 # the same, at a tag, branch or commit
cornercase plugin install acme/tools/notes # a plugin in the notes folder of acme/tools
cornercase plugin install acme/notes --preview --json # what it would run, as JSON; installs nothing
cornercase plugin install acme/notes --commit "$commit" --yes # install exactly the commit the preview showed
cornercase plugin update # fetch installed plugins again; ask before installing a change
cornercase plugin remove notes # turn it off, wait for it to stop, delete its copy
cornercase plugin link ~/code/my-plugin # add the plugin in that folder, turned off
cornercase plugin unlink my-plugin # forget it; its folder stays
cornercase plugin list # every plugin, on or off, and what it runs (--json for scripts)
cornercase plugin status # the same rows Settings › Plugins shows, with each service (asks the server)
cornercase plugin status --json # that answer: state, note, services, revision and problem
cornercase plugin actions --context pane # the actions plugins add to the menus (asks the server)
cornercase plugin run acme.notes note --pane 5 # run one as its menu entry does, wait, print how it ended
cornercase plugin run acme.notes browse # a button action: on what the window shows, as its button does
cornercase plugin run acme.notes browse --view 21 # the same on what a view shows; its popup needs no window
cornercase plugin popup-close # close the plugin popup that is open (asks the server)
cornercase plugin windows # keep window processes running until it ends, beside a window of your own
cornercase plugin enable my-plugin # turn it on: says what it asks for, then runs it
cornercase plugin disable my-plugin # turn it off: its service and window processes stop
cornercase plugin logs my-plugin # what its commands printed; -n, --follow and --path as for logs

install takes owner/repo (GitHub), an https:// git address or a git folder. A plugin in a folder of the repository is owner/repo/folder on GitHub, and address//folder for any other address or a folder on your machine. With no terminal to ask in, install and update need --yes, or --preview, which prints what they would run and exits without installing; --json prints it as one JSON object (for update, with an ID), and --commit then installs, or updates to, exactly the commit it printed, and fails once the plugin gives another. A plugin whose manifest cannot be read, or whose command leads out of its folder, is listed with the reason, and cannot be turned on. An unknown id exits with status 1.

windows is for a program that draws cornercase itself: it runs what plugins declare as [[window]] for as long as it runs, as a window of cornercase does, needs no server, and prints each change (--json for a program). It stops them all when it gets a signal or when the reader of its output leaves. It takes no --remote, since those processes run on the machine that shows the window. See Window processes beside your own window.

Prints the version, such as cornercase 0.1.0, and exits. It doesn’t touch the server.

cornercase proxy is what cornercase remote runs on the other machine; it passes the window’s messages, or the request of a --remote command, to the server there, and starts the server only for a window or start-server. cornercase server runs the server itself. You don’t need either: cornercase remote runs the proxy, and cornercase and cornercase start-server start the server in the background for you, with its output going to server.log. They are listed here so you recognise them in your process list.

The commands find the server through the same socket: CORNERCASE_SOCKET if it is set, otherwise server.sock in $XDG_STATE_HOME/cornercase/ (~/.local/state/cornercase/ without it), next to your session. Set CORNERCASE_SOCKET on every command to work with a separate server:

Terminal window
CORNERCASE_SOCKET=/tmp/cc-demo/server.sock cornercase
CORNERCASE_SOCKET=/tmp/cc-demo/server.sock cornercase kill-server

cornercase contract says what the server on it supports, and a program of your own can talk to the socket without cornercase: see Contract and compatibility.

Message Meaning
cornercase is already running in this terminal; nesting it is not supported You ran cornercase inside one of its own panes. Use another terminal. The other commands work in a pane.
the running cornercase server comes from another build. Run cornercase kill-server (it closes all its terminals) and start cornercase again You updated or rebuilt cornercase while the old server kept running, and didn’t restart it.
the running cornercase server is incompatible with this build. Run cornercase kill-server … Same cause, detected while talking to the server.
this terminal runs inside the cornercase server, so kill-server would stop the server it runs in; pass --yes … You ran kill-server without a terminal inside one of the server’s own panes. Pass --yes to stop it anyway, or set CORNERCASE_SOCKET to the other server’s socket.
failed to start the cornercase server; see <log> The server didn’t come up within a few seconds. The log next to the socket says why.
a cornercase server is already running on <socket> Printed by cornercase server when another server holds the socket’s lock.
the restart was cancelled in the window; the server keeps running Someone pressed cancel on the window’s notice while restart --when-idle or update --when-idle waited.
timed out after …: the agent in pane … has not ended its turn, so the server keeps running --when-idle reached its --timeout before every agent stopped working.
the running cornercase server is too old to wait for its agents … The server predates --when-idle. Run cornercase restart once no agent is working.
this is a development build; `cornercase update` only updates released builds You ran update from a build made with cargo run. Pull and build again instead.
no server is waiting to be picked: … config forum-server when the forum’s setup is not waiting for a server; the end of the line is the step left, what failed or where the forum is.
could not reach cornercase on `<host>`: … cornercase remote or --remote couldn’t connect; the end of the line is what ssh said.
cornercase was not found on `<host>` … The other machine has no cornercase where it looks; install it there, or give its path with --command (--remote-command for --remote).
no cornercase server is running on `<host>` A --remote command reached the machine, but no server runs there.
`plugin windows` runs on the machine that shows the window, so it takes no --remote … Window processes belong to the machine that shows the window (status 2). Run it there, without --remote or CORNERCASE_REMOTE.
`<host>` runs cornercase <version> and this computer <version>. Update it from here with … A --remote command found an older cornercase there; run the command the message gives to update it (status 5).
the cornercase on `<host>` is too old to attach to from another machine … The other machine’s cornercase predates cornercase remote. Update it there (status 5).
`<host>` runs cornercase <version> and this computer <version> … The two machines run different versions; the message says which one to update (status 5 when the other machine is the older one).
error: unrecognized subcommand '…' There is no such command; cornercase --help lists them.
error: unexpected argument '…' found The command has no such option; cornercase COMMAND --help lists its options.

On any of these, cornercase exits with a non-zero status: 2 for the last two, which are mistakes in how it was called, 5 for the ones that say the other machine’s cornercase is older, and 1 for the others.