Reference
Command line
This page lists the shell commands, the arguments and the flags of tiza. It also explains how Tiza finds the language of the code.
Open code
Give tiza a file, or send code to its standard input. For example:
tiza src/main.rs # open a file
tiza src/main.rs:12-48 # open lines 12 to 48, with their line numbers
tiza src/main.rs --follow # reload when you save the file in the editor
pbpaste | tiza --lang rs # open code from the clipboard (macOS)
tiza examples/ownership.rs.tiza --present # open a document in presentation mode
FILE is one of these:
| Argument | What Tiza opens |
|---|---|
PATH | The source file, or its document PATH.tiza when that file exists. |
PATH:A-B | Lines A to B of the source file, with their real line numbers. |
PATH:A | Line A of the source file. |
NAME.tiza | The document. |
- | Code or a document from standard input. |
- A range can also be
A..B. - Without
FILE, Tiza reads standard input when it is not a terminal. - Text on standard input that starts with
{and contains"schema"is a document. Other text is code. - With a range, Tiza saves to
FILE.A-B.tiza. When that file exists, Tiza opens it, as it opensFILE.tizawithout a range, and says so on the status bar. Another range, such asA-C, is another document. See Where the document goes. - A
.tizapath with a range opens the document and ignores the range. - When Tiza clamps a range, it saves under the clamped lines. For example,
tiza three.txt:2..9on a file of three lines saves tothree.txt.2-3.tiza. - When a range goes past the end of the file, Tiza shows the lines that exist.
Commands
| Command | What it does |
|---|---|
tiza [FILE] | Opens the code or the document in the TUI. |
tiza render [FILE] | Exports a document, or what the live instance shows, without the TUI. |
tiza check FILE | Checks a document before you record, and writes nothing. |
tiza config | Shows the config file in use, each value with its source, the personal styles and the warnings of the file. |
tiza mcp | Starts the MCP server on standard input and output. |
tiza scene get | Prints the document of the live instance as JSON. |
tiza scene list | Prints the annotations of the live instance, one on each line. |
tiza scene text | Prints the take on screen as text. |
tiza scene status | Prints the status of the live instance as JSON. |
tiza scene put FILE | Replaces the document of the live instance with FILE. |
tiza scene patch JSON | Changes part of the document of the live instance. |
tiza next | Makes the live instance go to the next step. |
tiza prev | Makes the live instance go to the previous step. |
tiza goto ID | Makes the live instance go to a named step or to a step number. |
tiza api METHOD [PARAMS] | Calls one socket method and prints the JSON reply. |
tiza schema [KIND] | Prints a JSON Schema: document for the .tiza format, or api for the socket methods. document is the default. |
tiza help [COMMAND] | Prints the help of tiza or of a command. |
- The live instance is the running TUI that agents and these commands talk to. See Global flags.
- For each flag of
tiza render, see Options oftiza render. tiza checkis in Check before you record.tiza configis in Config file.tiza mcpis in Set up an agent. The tools are in MCP tools.tiza sceneandtiza apiare in Socket API.tiza next,tiza prevandtiza gotoare in Go to a named step.
Options of the commands
| Flag | Command | What it does |
|---|---|---|
--width N | tiza check | Checks the labels and the code lines at N columns. The default is width of the config file, else 100. |
--json | tiza check | Prints the findings as JSON. |
--strict | tiza check | Exits with code 1 also for warnings. |
--width N | tiza scene text | Prints the take at N columns, in place of the width of the screen. |
--as-code | tiza scene put | Shows a file that is not a document as code, and does not refuse it. |
--out PATH | tiza schema | Writes the schema to PATH, in place of standard output. |
Nin--width Nis from 20 to 400.JSONintiza scene patchis the text of the JSON,-for standard input or@PATHfor a file.PARAMSintiza apiis the text of the JSON, or-for standard input. WithoutPARAMS, Tiza sends{}.FILEintiza scene putandtiza checkcan be-for standard input.tiza checkalso takes a source file that has a.tizadocument next to it.
For example:
tiza check demo.tiza --json
tiza api annotation.add '{"type":"note","line":4,"text":"hello"}'
tiza scene patch @change.json
tiza schema api --out api.schema.jsonFlags of the TUI
These flags work with tiza [FILE]:
| Flag | What it does |
|---|---|
--lang LANG | Sets the language of the code. |
--follow | Starts follow mode. |
--present | Starts in presentation mode. |
--step N | Opens the document at step N. |
--focus A-B | Dims all the lines except A to B. |
--theme NAME | Sets the theme. See Theme names. |
--theme-file PATH | Loads the theme tokens of a TOML file into the document. |
--padding V[,H] | Sets the blank cells around the code and its annotations for this session. |
--mouse | Starts with mouse capture on. |
--no-save | Starts in no-save mode. |
--no-socket | Starts without the socket, so agents and tiza next cannot reach this TUI. |
-h or --help | Prints the help. |
-V or --version | Prints the version and the commit. |
LANGis a language id, for examplers,tsorpy, or a full name such asrust.--step Nafter the last step opens the last step.--focusalso takesA,A..BorA:B. PressEscto clear the focus.--padding VsetsHto two timesV. Tiza does not save--paddingin the document.:padsaves it.- Follow mode is in Follow the editor.
- The themes and
--theme-fileare in Themes. - Mouse capture is in Use the mouse.
- No-save mode is in Saving.
For example:
tiza examples/ownership.rs.tiza --present --step 3
tiza src/main.rs --theme light --padding 1,4Global flags
These flags work with each command:
| Flag | What it does |
|---|---|
--socket PATH | Uses the socket at PATH. |
--session NAME | Uses the socket of the session NAME. |
Tiza picks the socket from the first of these that is set:
--socket PATH.- The variable
TIZA_SOCKET. --session NAME.- The variable
TIZA_SESSION. - The session
default.
- Use a session to run two or more instances. Each instance has its own socket.
- In a session name, Tiza changes each character to
_, except ASCII letters, digits,-and_. - An empty
TIZA_SOCKETorTIZA_SESSIONcounts as not set. An empty--sessiongives the socket.sock. tiza renderuses the socket only withoutFILE.tiza checkandtiza schemado not use it.- The folder of the socket is in The runtime folder.
- The variables are in Environment variables.
How Tiza finds the language
Tiza uses the first of these that gives a language:
--lang LANG, or:lang LANGin the TUI.- The extension of the file, when Tiza has a grammar for it.
- A well-known file name, for example
Makefile,Dockerfile,Cargo.lockor.bashrc. - A
#!line on the first line of the code. - A Vim or an Emacs modeline in the first five or the last five lines.
- Otherwise, plain text (
txt).
- Code from standard input has no file name. Thus Tiza skips items 2 and 3.
- Case does not matter in a file name or in
LANG. - When the value of
--langcontains/or\, Tiza reads it as a path. It finds the language from items 2 to 6. See The language of the selected text. - A language without a grammar shows as plain text.
--langthen writes a warning on stderr. :lang autofinds the language again from items 2 to 6. The message tells which item gave it.- A paste keeps the language of the code. When the code is plain text, a
#!line or a modeline of the pasted text gives the language.
Tiza keeps the language in the document. :lang saves it with autosave on. --lang changes it for the session. The next save writes it. A document that you open again uses its saved language.
Check report
tiza check --json prints this report.
| Field | Meaning |
|---|---|
ok | true when the check found no error. |
errors | The number of errors. |
warnings | The number of warnings. |
width | The width of the check. |
max_step | The last step of the document. It is not there when the document does not load. |
min_clean_width | The narrowest width from which no label is cut, or null. |
narrower | The narrower widths that are clean too: clean, code_fits_from and margin_from. |
findings | The list of findings. |
min_clean_widthisnullwhen the document does not load, or when no width up to 400 shows each label.narroweris there only whenwidthis undermin_clean_widthand no label is cut atwidth.- Each finding has
level,codeandmessage. It also hasid,step,file,lineandtextwhen they apply. filenames a linked file.textis the full text of a cut label, in aclipped_labelfinding.
The code of a finding is one of these:
| Code | Level | What it reports |
|---|---|---|
schema | Error | The document does not follow the .tiza format. |
code | Error | Tiza cannot read the code of the document. |
bounds | Error | A number is out of range, for example a step past the limit. |
link | Error | A linked file cannot be read. |
duplicate_id | Error | Two annotations have the same id. |
steps | Error | An entry of steps is not valid. |
steps | Warning | An entry of steps names a step past the last one, or has a key that Tiza does not know. |
move | Error | A move is not valid, or it does not apply at its step. |
move | Warning | The target of a scroll move does not match at its step, or its find matches more than one time. Or a move has an action, a value or a key that this version of Tiza does not know, also a key inside a select point or a rebind entry. See Moves from a newer version. |
rebind | Error | The rebind of a move is not valid, or its target does not match after the patch. |
stale | Error | In a live instance, a move does not match the code after a reload or a paste. |
unknown_id | Error | The ids of a spotlight name an annotation that does not exist. |
unknown_id | Warning | A rebind names an annotation that does not exist. Tiza ignores that rebind. |
unknown_file | Error | An annotation names a file that no code.link shows. |
until | Error | The until of a spotlight is before its step. Thus the spotlight never shows. |
anchor | Error | An anchor does not match at its step. |
anchor | Warning | A span or an arrow end of an annotation has a key that this version of Tiza does not know. Tiza ignores it. |
marker | Error | A marker does not match, or the end marker is only before the start marker. |
marker | Warning | A marker matches more than one time. |
unanchored | Warning | A move removes the code that an annotation is on. |
outside_window | Warning | An annotation is outside the code.link window of its step, or a later patch pushes it out. |
not_shown | Warning | An annotation belongs to a file that its own step does not show. |
empty_step | Warning | A step changes nothing. The step where a spotlight stops gets this warning only when its take is the same as the take of the step before. |
clipped_label | Warning | A label is cut, or is not drawn, at the width of the check. |
clipped_code | Warning | A code line is cut with … at the width of the check. There is one warning for each file with a cut line, and one more when a move changes which lines are cut. The warning gives the first five lines, the steps, and the width from which every code line of the take fits, or that no width up to 400 shows them whole. When a move gives the cut lines other numbers, the warning gives their numbers at its first step. |
effect | Warning | Experimental. An annotation has the enter effect draw but no stroke, or an effect that this version of Tiza does not know. It comes in with no effect. See Enter effects. |
Messages
Tiza writes these messages on stderr:
| Message | When |
|---|---|
tiza: give a file (tiza src/main.rs:12-48) or pipe code through stdin (pbpaste | tiza --lang rs) | Tiza gets no file, and its standard input is a terminal. |
tiza: empty stdin | The standard input is empty or has only blank characters. |
tiza: the TUI needs a terminal on stdout; use `tiza render` for text output | The standard output of Tiza is not a terminal. |
tiza: could not open FILE: line ranges start at 1 | The range starts at line 0. |
tiza: could not open FILE: range A-B: the first line must not be after the last | A is after B. |
tiza: could not open FILE: malformed line range `R`: use A, A-B or A..B | The text after the last : starts with a digit, or it has only digits, - and .. But it is not A, A-B or A..B. |
tiza: could not open FILE | Tiza cannot read the file. |
tiza: --padding expects V or V,H | --padding got another value. |
tiza: invalid range: R | --focus got a value that is not a range. |
tiza: width=N: use a number between 20 and 400 | tiza check --width got a number out of the range. |
tiza: FILE is not a .tiza document and has no .tiza document next to it (DOCUMENT): nothing to check | tiza check got a source file without a document next to it. |
tiza: FILE is neither a .tiza document nor a `scene get` envelope; to show it as code, pass --as-code | tiza scene put got a file that is not a document. |
tiza: FILE: … scene put sends a document as it is, so it refuses this one | tiza scene put got a document with an effect, a move or a key that this version of Tiza does not know. The key can be a key of a move or a key inside a position. Open the file in Tiza and save it, or remove them. |
tiza: could not read PATH | tiza check, tiza scene put or tiza scene patch @PATH cannot read the file. |
tiza: the patch is not valid JSON: ERROR | The JSON of tiza scene patch does not parse. |
tiza: the parameters are not valid JSON: ERROR | The PARAMS of tiza api do not parse. |
tiza: the parameters from stdin are not valid JSON: ERROR | The PARAMS of tiza api - do not parse. |
wrote PATH | tiza schema --out PATH wrote the file. |
tiza: config: PATH:LINE: WARNING | Tiza does not take an entry of the config file. The warning tells why. |
tiza: config ignored: PATH: ERROR | Tiza cannot read the config file. |
tiza: no grammar for `LANG`; the code is shown as plain text | --lang got a language that has no grammar. |
tiza: no Tiza instance is listening on PATH (open `tiza <file>` or pass --socket/--session) | A command finds no live instance. |
tiza: the Tiza instance on PATH did not answer within 75 s: it is busy or stopped; look at its terminal | A command reached the live instance, but it did not reply in time. |
tiza: the Tiza instance on PATH closed the connection before it answered: it possibly quit; look at its terminal | The live instance closed the connection before it replied. |
tiza: MESSAGE (CODE) | The live instance answers a command with an error. |
- The messages
no grammar for …andconfig ignored: …are warnings. Tiza goes on. - When the text after the last
:does not start with a digit and has other characters than digits,-and., Tiza reads the whole text as a file name, for examplea:b.rs. Then the message iscould not open FILE. - A file that is there opens as a file, also when its name has a
:and a digit, for examplenotes 12:00.md. tiza: config ignored: PATHends with the error text of the system.- The warnings of the config file are in Warnings of the config file.
- For
tiza scene text --width, the live instance checks the width. Then the message ends with(invalid_argument), as intiza: MESSAGE (CODE). could not open FILE,could not read PATHandno Tiza instance is listening on …can end with the error of the system.--padding expects V or V,Hcan end with the reason of the error.- The errors of
tiza gotoare in Messages. - On an error,
tizaexits with code 1. A wrong flag or argument exits with code 2 and prints the usage. tiza renderto MP4 or WebM withoutffmpegalso exits with code 2. See Exports.
Tiza shows these messages in the status bar:
| Message | When |
|---|---|
the file has N lines: range A-B clamped to C-D | The range goes past the end of the file. |
opened the existing PATH | The range has a FILE.A-B.tiza document from an earlier session, and Tiza opened it. |
local API disabled: an instance is already listening on PATH (use --session for another one) | A second instance starts in a session that already has an instance. |
NAME:LINE: KEY: … (N warnings: tiza config) | The config file has warnings. At start, the status bar shows the first one. See Warnings. |
N annotations outside the code and not drawn: IDS | When the document opens, annotations point at lines that the code does not have. |
tiza check gives the problem of N annotations: IDS | When the document opens, annotations are on lines of the code, but they fail another check. tiza check gives the problem. |
N entries are not known: see tiza check | The document has effects, moves or values that this version of Tiza does not know. See Moves from a newer version. |
- For a file with one line, the first message says
line, notlines. - With one annotation, the messages of the open document say
annotation. When the document has more than one of these problems at start, one message gives them, with;between them. - After
local API disabled, agents and the step commands talk to the first instance. - The other causes of
local API disabledare in The runtime folder.