Repository navigation
Cozzle CLI
English | 한국어
cozzle is the command that controls the cozzle app from inside a cozzle terminal. Agents use it most, but you can type it too. This page is the reference for every command.
cozzle guide # the full agent guide
cozzle status # all workspaces and tabsWhen the app starts, it picks a free port on 127.0.0.1 and a random token (48 hexadecimal characters). It passes both only to terminals that cozzle opens, through environment variables (COZZLE_ADDR, COZZLE_TOKEN). Other users cannot control cozzle.^ipc
Terminals stay alive when cozzle restarts (after an update or a crash), so their environment still holds the old port and token. cozzle therefore also writes the current address, token, process ID and start time to app.json in the terminal host folder ($XDG_RUNTIME_DIR/cozzle or ~/Library/Caches/cozzle/pty, mode 700; the file is mode 600) each time it starts, and deletes the file when it quits. When the old address does not answer or the token is refused, cozzle reads that file and sends the command once more to the running app. It uses the file only if the folder and file belong to you, only you can open them, neither is a link, the address is on this computer, and the app process is alive. On Windows, the file is not written.^cli
Each persistent terminal also gets COZZLE_TERM, its number in the terminal host. The app maps that number to the tab that shows the terminal now, so self still means the right tab after a restart. Tab IDs printed before a restart change; run cozzle tab list again.
The cozzle command is also only on the PATH of cozzle terminals (~/.cache/cozzle/bin-<process id>/, mode 700). Outside cozzle, it prints:
cozzle: Works only in a terminal opened in the cozzle app
(It can be used only in a terminal opened by the cozzle app.)
| Result | Output |
|---|---|
A block of text (tab read, browser text and so on) |
Printed as is |
| A list or object | Printed as TOON (Token-Oriented Object Notation): the same content as JSON, in a table form that uses fewer tokens |
| No value | Nothing |
| Exit code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure. The reason goes to stderr as cozzle: …
|
| 2 | Run outside a cozzle terminal |
-
selfis the terminal tab that ran the command. Get tab IDs withcozzle tab list. - Unquoted words are joined into one text (
cozzle notify Build done all passed→ titleBuild, bodydone all passed). - In free text (
tab run,tab send,tab rename,notify,search),--optionsafter its first word belong to the text:cozzle tab run self ls --color autorunsls --color auto.--ends options for any command.tab sendstill takes a trailing--enter. - Options that take a value:
--tab --cwd --name --run --timeout --lines --max --limit --color --label --line --direction. Any other--optionis an on/off switch.^commands - Commands that do not name a workspace use the workspace of the terminal that ran them.
cozzle tab list
cozzle tab new [terminal|browser|graph] [--cwd path] [--name name] [--run command] [--split] [--new] [--focus]
cozzle tab split <id> # show that tab beside the user's view
cozzle tab unsplit # close the split (tabs stay open)
cozzle tab run <id|self> <command> # type, then Enter
cozzle tab send <id|self> <text> [--enter] # type without Enter (--enter adds Enter)
cozzle tab read <id|self> [--lines 40] # terminal screen text, last N lines
cozzle tab select <id>
cozzle tab close <id>
cozzle tab rename <id> <name> # an empty name restores the default
tab new:
- Without a type, it opens a terminal. It also accepts
shell,git,터미널,브라우저and그래프. - Without
--cwd, it opens in the workspace folder. - It only creates the tab and does not change what the user sees or where they type. The tab goes into the tab bar of another pane (or the agent's pane when there is none). A tab you do not view still starts running at once.
- With
--run, it reuses a terminal started with the same command in the same folder. If the command is still running (the terminal's foreground process group is not the shell), nothing is typed andreusedisrunning; if it has returned to the prompt, the command runs again andreusedisrerun. - With
--name, it reuses a tab of the same name and type. A terminal is reused only when its shell is idle, and--runruns in that tab (rerun;idlewithout--run). -
reusedisfalsefor a new tab. -
--newcreates a new tab even if one with the same name exists. -
--splitshows the tab beside the user's view.--focusswitches to the tab. - Result:
{ id, kind, reused, visible, pane }, andlisted: truewhen--splitfound no room and only added the tab to a tab bar.^commands
Where --split, tab split, browser open --split and open put a tab:
- The pane of the agent's terminal and the pane the user types in are not changed: their visible tab and the keyboard stay.
- The first time, that pane is cut once and keeps 60%. Later tabs go to the largest other pane, which is halved when there is room, else the tab is shown at the front of that pane.
- No pane is cut below 440×280 points, except that a single pane always gets one side pane, even in a narrow window. Side by side comes first;
--directionis ignored. At most 2 panes in a center narrower than 1600 points, 3 from 1600, 4 from 2400 (or 1800×1100). - When nothing fits, the tab is only added to a tab bar and the result says
listed: true. - The user's workspace and active tab do not change.
cozzle tab new terminal --name dev --run "pnpm dev"
cozzle tab read 7 --lines 80Tab fields in tab list and status: id, workspace (from 1), kind (terminal, browser, graph, editor, subagent), title, cwd, active, visible. visible is main (shown in the pane the user types in), split (shown in another pane) or hidden. pane is the pane number in reading order (from 1), or null when the view is not split.
cozzle workspace list
cozzle workspace open <path>
cozzle workspace select <number> # from 1
cozzle workspace close <number> # the last one is never closed
One git worktree per agent, so agents on one repository do not overwrite each other's files. The repository is the one of the calling terminal's workspace (or its original repository when called from a worktree).
cozzle worktree new [branch] [--run <command>] [--focus] # new branch (default agent-N) in <repo>.worktrees/<branch>, opened as a workspace
cozzle worktree new [branch] --agent claude|codex [--prompt <text>|-] [--count N] # start agents with a task
cozzle worktree list # branch, path, changes, workspace, base, fanout
cozzle worktree diff [branch] [--stat] # changes since the base branch
cozzle worktree compare [branch...] # one column per worktree in the repository workspace
cozzle worktree take <branch> <path> # copy one file from that worktree into this checkout
cozzle worktree merge [branch] [--close-others [--yes]] # merge into the repository's current branch, then remove the worktree and `branch -d`
cozzle worktree remove [branch] [--yes] # remove the worktree, keep the branch
Without a branch, merge, remove and diff act on the calling worktree. merge refuses uncommitted changes and stops on conflicts, opening the repository's Git graph for the user. remove refuses uncommitted changes unless --yes, which moves the folder to the Trash. Nothing is forced.
Several agents on one task (see Workspaces and tabs):
-
new --agent claude --count 3 --prompt "<task>"creates three worktrees (agent-N) from the repository's current branch and starts Claude Code in each with the task as its first message.--prompt -reads the task from standard input. A branch name works only with one agent. Without--prompt,--agentstarts the agent with no task, like--run claude. The answer listsbranch,path,workspaceand the terminaltabof each. - Limits: 1 to 4 agents per call, and at most 8 worktrees from these runs per repository. Each call shows the user a notification with the count and the start of the task.
-
diffshows the changes since the worktree left the branch it was created from (git merge-base), committed and uncommitted, then untracked files as?? <path>.--statprints the summary. -
comparewith branches opens those worktrees side by side; without one, the calling worktree and the others from the same run. -
takecopies the file at<path>(relative to the repository root) from that worktree into the calling workspace's checkout. It refuses paths outside the worktree,.git, symbolic links, and a file that has uncommitted changes in the checkout. -
merge --close-othersmerges likemerge, then closes the other worktrees of the same run (their branches stay). Ones with uncommitted changes stay open and cozzle asks the user;--yesmoves them to the Trash instead.
cozzle picks the target tab in this order:^commands
- The tab given with
--tab <id>(only that tab; if it is not a browser tab, the command fails) - The browser tab named with
--name <name>in this workspace (the name you gave it, not the page title) - The browser tab you are viewing in this workspace
- The last browser tab in this workspace
If there is no target, only open creates a new tab (with the --name name, if given). Other commands fail.
cozzle browser open <url> [--split] [--new] [--name name] [--focus] # same as goto; waits for the load. url may be file:///… or an absolute path (reads only that file's folder)
cozzle browser info # tab, url (the page shown, not one still loading), title, device
cozzle browser snapshot [--limit 300] # clickable and editable elements with refs (e1, e2...)
cozzle browser click <ref|css>
cozzle browser fill <ref|css> <text> # input, textarea, select, contenteditable
cozzle browser press [key] # Enter by default. Tab, Escape ...
cozzle browser scroll [up|down|top|bottom|ref] # down by default
cozzle browser wait <css|text:words>
cozzle browser text [--max 8000]
cozzle browser html [css] [--max 20000]
cozzle browser back | forward | reload # wait like open
cozzle browser device <fit|mobile|tablet|pc|tv>
cozzle browser extensions # installed extensions and user scripts
-
openreuses the target tab. With--new, it opens a new tab.--splitshows it beside the user's view (see Tabs); a new tab without--splitonly goes into a tab bar. - Commands that wait for the page take
--timeout <ms>(15000 by default). -
open,back,forwardandreloadanswertab,ok,urlandtitlewhen the page has loaded, or withok: falseafter the timeout. They fail with the reason (exit code 1) when the load is cancelled, for example by a lateropenon the same tab, when it fails, or when the page stays the same (a 204 answer, a download, or a page that blocks leaving).backandforwardfail when there is no page in the history. - Typical order:
open→snapshot→clickorfillwith a ref →snapshotortextagain to check. - After the page changes, get new refs with
snapshot. - Page commands fail on pages without the cozzle runtime, such as
about:pages. -
extensionsonly lists items:supported, and for extensionsid,name,version,enabledandaction, and for user scriptsfile,name,matchandenabled. The user installs them in Settings.^extensions
cozzle browser tools # name, title, description, inputSchema, annotations, frame, origin
cozzle browser call <tool> [json-object] [--max 65536] # runs the tool; returns content (or value)
- Only https and localhost pages have tools.
toolslists tools of the tab's origin, including same-origin frames (frameis the frame number fromsnapshot), up to 100. -
callchecks the input againstinputSchema(type,required,enum,properties,items,additionalProperties: false) before it runs the tool. Input is one JSON object, 64 KB at most; without input the tool gets{}. - The result is the tool's
contentarray, or its value asvalue. Results over 64 KB (or--max <bytes>, up to 8 MB) show their start withtruncated: true, the full size inbytesandpath, a JSON file with the whole result in~/.cache/cozzle/tool-results(only you can read it; files go after a day or past the newest 50). Results over 8 MB are cut there too, andnotesays so. A thrown error exits with code 1. -
callwaits for--timeout(15000 ms by default) and then cancels the tool. While the tool waits for the user (requestUserInteraction), cozzle notifies the user and waits up to 10 minutes. - Every result has
untrusted: names, descriptions and results come from the website. - After cozzle fills a saved login on the page,
toolsandcallare blocked until the page navigates.^commands
cozzle browser logins # site and username only, matchesTab
cozzle browser login [--account name] [--submit] # fill from the Keychain
cozzle browser otp [--submit] # generate and fill the two-factor code
printf '%s' "$PASSWORD" | cozzle browser login save --site <origin> --username <name> --password-stdin [--totp-secret-stdin]
-
login --submitsigns in with one call. It waits for the page to load, and on forms that ask for the username first it fills the username, goes to the next screen, waits for the password field on the same site, fills it and submits.resultissubmittedorneeds-2fa(then runotp --submit); without--submitit isfilledorusername-only. -
loginandotpnever return the password or code. They refuse pages where an agent raneval; reload the page and callloginbefore anyevalorhtml. - After a fill, only
snapshot(field values hidden),text,wait,click,hover,scroll,draw,press,type,select,check,uncheck,drag,upload,fillandperfrun on that page until it navigates away, and they take only refs ortext:targets, not CSS selectors. Everything else, includingeval,html,storage,console,network,tools,callandscreenshot, is refused. -
login savestores a login the user gave the agent. The password comes only from standard input;--passwordand other secrets in arguments are refused, because other programs can see arguments. With--totp-secret-stdin, the second line is the two-factor secret. The site is stored as its origin, as in Settings. -
login saveonly creates new entries. A site and username that already exist are refused, and agents cannot edit, delete or read saved logins. Each save appears in Notifications, and clicking it opens Settings → Browser → Logins. With Ask before agents use saved logins on, the save waits for your approval in the browser tab. Approving a save does not approve filling: the firstloginwith that account asks again.^logins
cozzle browser draw box <ref|css> [--label text]
cozzle browser draw highlight <ref|css> [--label text]
cozzle browser draw rect|ellipse|highlight|box <x> <y> <w> <h> [--label text]
cozzle browser draw arrow|line <x1> <y1> <x2> <y2> [--label text]
cozzle browser draw text <x> <y> <text>
cozzle browser draw clear
Common: --color '#FF2D55' Coordinates are CSS pixels relative to the document
Drawings do not block clicks and follow scrolling. box and highlight stay on their element as it moves, also inside scrolling boxes, same-origin iframes and fixed elements, and with page zoom or a device size. With a ref from snapshot are more accurate than guessed coordinates. When the element is gone, the drawing looks for it again about once a second and is removed after about 5 seconds.
cozzle browser console [--clear] # console.* output and JS errors (latest 500)
cozzle browser network [--clear] # fetch and XHR: method, url, status, ms (latest 300)
cozzle browser eval <js> # value of the expression (JSON)
cozzle browser storage # localStorage and sessionStorage
cozzle browser cookies # cookies for the current address (including HttpOnly)
cozzle browser perf # load time and resource count
cozzle browser devtools # opens the web inspector for the user
cozzle open <file> [--line N]
Relative paths start from the working folder of the shell that ran the command. Result: { id, kind: editor }. Details are in File editor.
cozzle agents [id|self] # subagents started by that tab's Claude Code or Codex: id, name, kind, state, elapsed, parent
cozzle agent config # Claude Code and Codex configuration of this workspace
Columns of agent config: tool (claude, codex), kind (instructions, settings, skill, command, prompt, agent, rule, mcp, plugin), scope (project, parent, user), name, detail, path. Settings and MCP entries show only names and counts, never secret values.^agent-config For the screen side, see AI agents.
cozzle settings [list|get <key>] [--scope user|workspace]
- Without a scope, it shows the values in effect (default ← user ← workspace).
-
--scope usershows the user file values.--scope workspaceshows only the keys that.cozzle/settings.jsonoverrides. - Keys are the names in
settings.json, such asterminalFontSizeandbrowser.zoom. - It only reads. It reads the settings files directly instead of asking the app, and finds the workspace from the terminal's
COZZLE_WORKSPACE(or the current folder).^cli
cozzle settings get browser.zoom
cozzle settings --scope workspaceThe agent guide tells agents not to edit settings files and to ask the user instead. The scope rules are in Settings.
cozzle search <query> # git grep in this workspace (path, line, text)
cozzle git status # changed files (path, change)
cozzle git log [--limit 20] # hash, subject, author, when, refs
cozzle panel <files|scm|search|agent|notifications|settings>
cozzle notify <title> [body] # cozzle notification + operating system notification
cozzle guide # same as help, --help, -h
-
panelalso accepts파일,소스,git,source-control,검색,에이전트,알림and설정.sessionsand세션open the Sessions tab of the Agent section. -
notifyalso shows an operating system notification unless the user turned off system notifications in Settings.
cozzle browser open localhost:3000 --name preview --split
cozzle browser device mobile
cozzle browser snapshot
cozzle browser click e4
cozzle browser text --max 2000
cozzle browser draw box e9 --label "Button is cut off"
cozzle notify "Please check" "The pay button is cut off on mobile"cozzle · MIT License · Repository · Open an issue · Report a vulnerability