Skip to content

Commands ​

Everything you type: slash commands and @ references inside ZettCode, and the zettcode command line.

Type / to see the menu; it filters as you type, and Enter or Tab fills in the highlighted name. A command with an argument takes it after a space. Only a name from the list is a command — /var/log/syslog and /tmp is full are ordinary text and go to the model like any message.

A command with a fixed first word lists the words once you type a space: /config offers add, remove, list and providers, /theme the palettes, /model the configured models. Enter runs the highlighted one, so /model ↓ Enter switches without opening the picker.

Slash commands ​

CommandWhat it doesExample
/helpList the commands and the keys./help
/newStart a fresh session; the old one stays on disk./new
/clearClear the visible conversation, keeping this session./clear
/resumeOpen a stored session: a searchable panel of recent ones, or one by id./resume 01a10b75
/continueCarry on a request that was cut short. See below./continue
/forkCarry this conversation into a new session and continue there./fork
/modelSwitch the model for later requests; plugin models are listed too./model DeepSeek Pro
/configAdd, change or remove models without editing the file./config add --model gpt-4o --token sk-… --url …
/effortSet how much the model reasons, for the next request./effort high
/permissionSet how much of the shell may run without asking./permission safe
/pluginsSwitch a plugin on or off; the change applies at the next start./plugins disable recap
/harnessThe terminal's panel browses harnesses, tools and files; the chat gets the same command's state and its gen / reset / use / save / fork words. gen takes up to 4000 characters (120 shown in the row)./harness gen a tool that lists TODOs
/btwAsk a side question that never joins the conversation./btw what is idempotent here?
/code-reviewReview the uncommitted changes; text says what to look for./code-review check error handling
/bashOpen a full-screen shell over the workspace. See below./bash git status
/themeChoose a palette; the menu previews each./theme nord
/petChoose the pet over the conversation./pet whale
/contextShow how full the context window is, what fills it, and the session's directory and file./context
/usageShow what this project's sessions have spent./usage
/hubWho is here, the daemons, and who talked to whom; the chat gets the sessions, daemons and message pairs as a document, without the graph layout./hub
/compactSummarize the conversation now, instead of waiting for the window to fill./compact
/statuslineChoose which named parts of the header and status line are shown./statusline hide ctx
/titleName this session; on its own, report the current name./title users endpoint
/exportWrite this session to a standalone HTML file./export review.html
/quit, /exitLeave; the shell prints the command that reopens the session./quit

Commands come from the shell, the agent, and any plugin that registered one, and the menu shows them in that order. A plugin cannot take a name that is already used, so /model always does what this page says.

Where a command has a panel, the keys inside it belong to the panel: Esc cancels, Enter applies. /permission and /theme choose among a few words, so they list them in the menu instead. /model and /resume open a picker, because a model name can hold spaces and a session is best chosen with its title beside it. /effort opens a rail you slide; /context a page of bars you read.

Most commands wait until the request in flight ends. These do not: /help, /plugins, /context, /usage and /theme only show something, /bash runs your own commands, /title writes a name nothing is reading, and /permission, /effort and /model change what the next request uses. /quit does not wait for the answer, and /btw and /code-review wait their turn. /new, /clear, /resume, /fork, /compact, /export and /config answer "busy".

Carrying on a cut-short request ​

/resume opens an earlier session; /continue picks up the request that did not finish in this one. What it does depends on how the request ended:

How it endedWhat /continue does
Stopped or failed before an answer, or after tools finishedAsks the model again, with nothing added.
Stopped while tools were runningNames the tools that were cut short and lets the model decide. A tool is never run again on its own.
The provider cut the reply off, or the reply hit the output limitAsks the model to continue that reply.
The provider paused itHands the turn back to the provider.
Finished, declined, or the context window is fullDoes nothing and says why; a full window needs /compact or /new.

It uses the model and effort the next message would, and shows what it will do before it does it.

Self-compaction ​

Self-compaction is the model compacting its own context when it judges the detail is no longer needed. It is on by default ([compaction] self in config.toml), /plugins shows it as the self-compaction switch, and the status line ends with self-compact while it is on. See The context window.

The shell panel ​

/bash opens a full-screen command line over the workspace, and /bash <command> opens it already running that command. It is your own shell run by your own hand: it asks no permission, the model sees nothing of it, and its output is gone when you close the panel. It opens beside a running request.

KeyWhat it does
EnterRun the command.
Tab, Shift+TabComplete the word under the cursor; press again for the next candidate.
↑ ↓, Ctrl+RWalk through, or search, earlier commands.
Ctrl+C, EscStop the running command; with nothing running, close the panel.

Each command runs in its own process in the workspace, with your own shell, and a program that asks a question gets the end of its input instead. A bare cd stays for the next command. fish starts without its configuration. History comes from bash, zsh, fish and PowerShell, and what you type here is kept in ~/.zettcode/command_history.

Token usage ​

/usage opens what this project's sessions have spent, in three views: by model, by session, and a calendar of the days. Every field, and where it differs from the status line, is in Token usage.

@ references ​

@ pulls a resource into a message: a file of the workspace by path, a skill by name, or another session.

what does @packages/zettcode/src/zettcode/cli.py do?

Type @ and the menu lists them, files with their size. A file reference sends the path, not the file: the model reads it with its own tools, so it costs a sentence of context rather than a file's worth. A directory points the model at searching. The draft you typed is what is stored, so reopening the session shows @path again. Each chip is removed with one Backspace.

The zettcode command line ​

zettcode --help lists everything the command line takes, which is short.

FlagWhat it does
-v, -V, --versionPrint the version — ZettCode, the zett-agent it runs on, and Python — and exit. Quote it when you report a problem.
-w, --workspace DIRThe directory to work in. Defaults to the current directory.
-r, --resume SESSIONOpen a stored session instead of starting a new one.
--full, --auto, --yoloRun shell commands with full access and without asking, for this run. The same as /permission full.
--dry-runRun the startup, paint one frame, and exit. Useful for profiling.

Subcommands are separate programs under the same executable:

SubcommandWhat it does
resume SESSIONThe same as --resume; -w DIR may go before or after it.
update, upgradeInstall the newest release and exit. See the FAQ.
doctorAsk every model in your config one short question and print which answer, how fast, or why not. Exits 1 if one does not.
promptSend one prompt, print the answer, exit. See below.
daemonStart, list, log, stop or kill a background agent.
brokerRun the local session broker.
gatewayServe the web gateway.
pluginInstall, remove and switch plugins.

zettcode prompt ​

zettcode prompt sends one prompt, prints the answer, and exits — for a script or a pipe. Without -m and -s it uses the first model in the config file and a new session.

bash
zettcode prompt "explain what this repository does"
git diff | zettcode prompt "review this change"
zettcode prompt -m "Claude Sonnet" -s 01a10b75 "and the tests?"
zettcode prompt --continue -s 01a10b75
OptionWhat it does
PROMPTWhat to ask. Leave it out, or give -, to read it from standard input.
-m, --model NAMEThe model, by the name /model lists.
-s, --session IDContinue a stored session.
-c, --continueNo prompt: pick up a cut-short request, as /continue does. Needs -s.
-e, --effort LEVELThe reasoning level.
-w, --workspace DIRThe directory to work in.

Standard output holds the answer and nothing else; the tools used and session: <id> go to standard error. Nobody can be asked here, so the shell permission is always auto: the model's commands run without asking. Use it only in a workspace you would trust with a shell.

Exit codes ​

CodeMeaning
0Answered.
1The run failed or stopped early. doctor also exits 1 when a model does not answer.
2Arguments that cannot be used.
3--continue found nothing to pick up.

Next steps ​

  • Sessions: where a conversation is stored, and how to come back to it.
  • The interface: what every row on the screen means.
  • Configuration: every key, and the models a command can add.
  • Plugins: the commands a plugin adds.

Released under the MIT license.