Docs for the latest release, v0.2.0.
Tiza GitHub

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:

ArgumentWhat Tiza opens
PATHThe source file, or its document PATH.tiza when that file exists.
PATH:A-BLines A to B of the source file, with their real line numbers.
PATH:ALine A of the source file.
NAME.tizaThe 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 opens FILE.tiza without a range, and says so on the status bar. Another range, such as A-C, is another document. See Where the document goes.
  • A .tiza path 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..9 on a file of three lines saves to three.txt.2-3.tiza.
  • When a range goes past the end of the file, Tiza shows the lines that exist.

Commands

CommandWhat 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 FILEChecks a document before you record, and writes nothing.
tiza configShows the config file in use, each value with its source, the personal styles and the warnings of the file.
tiza mcpStarts the MCP server on standard input and output.
tiza scene getPrints the document of the live instance as JSON.
tiza scene listPrints the annotations of the live instance, one on each line.
tiza scene textPrints the take on screen as text.
tiza scene statusPrints the status of the live instance as JSON.
tiza scene put FILEReplaces the document of the live instance with FILE.
tiza scene patch JSONChanges part of the document of the live instance.
tiza nextMakes the live instance go to the next step.
tiza prevMakes the live instance go to the previous step.
tiza goto IDMakes 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.

Options of the commands

FlagCommandWhat it does
--width Ntiza checkChecks the labels and the code lines at N columns. The default is width of the config file, else 100.
--jsontiza checkPrints the findings as JSON.
--stricttiza checkExits with code 1 also for warnings.
--width Ntiza scene textPrints the take at N columns, in place of the width of the screen.
--as-codetiza scene putShows a file that is not a document as code, and does not refuse it.
--out PATHtiza schemaWrites the schema to PATH, in place of standard output.
  • N in --width N is from 20 to 400.
  • JSON in tiza scene patch is the text of the JSON, - for standard input or @PATH for a file.
  • PARAMS in tiza api is the text of the JSON, or - for standard input. Without PARAMS, Tiza sends {}.
  • FILE in tiza scene put and tiza check can be - for standard input.
  • tiza check also takes a source file that has a .tiza document 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.json

Flags of the TUI

These flags work with tiza [FILE]:

FlagWhat it does
--lang LANGSets the language of the code.
--followStarts follow mode.
--presentStarts in presentation mode.
--step NOpens the document at step N.
--focus A-BDims all the lines except A to B.
--theme NAMESets the theme. See Theme names.
--theme-file PATHLoads 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.
--mouseStarts with mouse capture on.
--no-saveStarts in no-save mode.
--no-socketStarts without the socket, so agents and tiza next cannot reach this TUI.
-h or --helpPrints the help.
-V or --versionPrints the version and the commit.
  • LANG is a language id, for example rs, ts or py, or a full name such as rust.
  • --step N after the last step opens the last step.
  • --focus also takes A, A..B or A:B. Press Esc to clear the focus.
  • --padding V sets H to two times V. Tiza does not save --padding in the document. :pad saves it.
  • Follow mode is in Follow the editor.
  • The themes and --theme-file are 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,4

Global flags

These flags work with each command:

FlagWhat it does
--socket PATHUses the socket at PATH.
--session NAMEUses the socket of the session NAME.

Tiza picks the socket from the first of these that is set:

  1. --socket PATH.
  2. The variable TIZA_SOCKET.
  3. --session NAME.
  4. The variable TIZA_SESSION.
  5. 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_SOCKET or TIZA_SESSION counts as not set. An empty --session gives the socket .sock.
  • tiza render uses the socket only without FILE. tiza check and tiza schema do 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:

  1. --lang LANG, or :lang LANG in the TUI.
  2. The extension of the file, when Tiza has a grammar for it.
  3. A well-known file name, for example Makefile, Dockerfile, Cargo.lock or .bashrc.
  4. A #! line on the first line of the code.
  5. A Vim or an Emacs modeline in the first five or the last five lines.
  6. 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 --lang contains / 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. --lang then writes a warning on stderr.
  • :lang auto finds 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.

FieldMeaning
oktrue when the check found no error.
errorsThe number of errors.
warningsThe number of warnings.
widthThe width of the check.
max_stepThe last step of the document. It is not there when the document does not load.
min_clean_widthThe narrowest width from which no label is cut, or null.
narrowerThe narrower widths that are clean too: clean, code_fits_from and margin_from.
findingsThe list of findings.
  • min_clean_width is null when the document does not load, or when no width up to 400 shows each label.
  • narrower is there only when width is under min_clean_width and no label is cut at width.
  • Each finding has level, code and message. It also has id, step, file, line and text when they apply.
  • file names a linked file. text is the full text of a cut label, in a clipped_label finding.

The code of a finding is one of these:

CodeLevelWhat it reports
schemaErrorThe document does not follow the .tiza format.
codeErrorTiza cannot read the code of the document.
boundsErrorA number is out of range, for example a step past the limit.
linkErrorA linked file cannot be read.
duplicate_idErrorTwo annotations have the same id.
stepsErrorAn entry of steps is not valid.
stepsWarningAn entry of steps names a step past the last one, or has a key that Tiza does not know.
moveErrorA move is not valid, or it does not apply at its step.
moveWarningThe 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.
rebindErrorThe rebind of a move is not valid, or its target does not match after the patch.
staleErrorIn a live instance, a move does not match the code after a reload or a paste.
unknown_idErrorThe ids of a spotlight name an annotation that does not exist.
unknown_idWarningA rebind names an annotation that does not exist. Tiza ignores that rebind.
unknown_fileErrorAn annotation names a file that no code.link shows.
untilErrorThe until of a spotlight is before its step. Thus the spotlight never shows.
anchorErrorAn anchor does not match at its step.
anchorWarningA span or an arrow end of an annotation has a key that this version of Tiza does not know. Tiza ignores it.
markerErrorA marker does not match, or the end marker is only before the start marker.
markerWarningA marker matches more than one time.
unanchoredWarningA move removes the code that an annotation is on.
outside_windowWarningAn annotation is outside the code.link window of its step, or a later patch pushes it out.
not_shownWarningAn annotation belongs to a file that its own step does not show.
empty_stepWarningA 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_labelWarningA label is cut, or is not drawn, at the width of the check.
clipped_codeWarningA 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.
effectWarningExperimental. 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:

MessageWhen
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 stdinThe standard input is empty or has only blank characters.
tiza: the TUI needs a terminal on stdout; use `tiza render` for text outputThe standard output of Tiza is not a terminal.
tiza: could not open FILE: line ranges start at 1The range starts at line 0.
tiza: could not open FILE: range A-B: the first line must not be after the lastA is after B.
tiza: could not open FILE: malformed line range `R`: use A, A-B or A..BThe 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 FILETiza 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 400tiza 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 checktiza 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-codetiza scene put got a file that is not a document.
tiza: FILE: … scene put sends a document as it is, so it refuses this onetiza 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 PATHtiza check, tiza scene put or tiza scene patch @PATH cannot read the file.
tiza: the patch is not valid JSON: ERRORThe JSON of tiza scene patch does not parse.
tiza: the parameters are not valid JSON: ERRORThe PARAMS of tiza api do not parse.
tiza: the parameters from stdin are not valid JSON: ERRORThe PARAMS of tiza api - do not parse.
wrote PATHtiza schema --out PATH wrote the file.
tiza: config: PATH:LINE: WARNINGTiza does not take an entry of the config file. The warning tells why.
tiza: config ignored: PATH: ERRORTiza 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 terminalA 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 terminalThe 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 … and config 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 example a:b.rs. Then the message is could not open FILE.
  • A file that is there opens as a file, also when its name has a : and a digit, for example notes 12:00.md.
  • tiza: config ignored: PATH ends 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 in tiza: MESSAGE (CODE).
  • could not open FILE, could not read PATH and no Tiza instance is listening on … can end with the error of the system. --padding expects V or V,H can end with the reason of the error.
  • The errors of tiza goto are in Messages.
  • On an error, tiza exits with code 1. A wrong flag or argument exits with code 2 and prints the usage.
  • tiza render to MP4 or WebM without ffmpeg also exits with code 2. See Exports.

Tiza shows these messages in the status bar:

MessageWhen
the file has N lines: range A-B clamped to C-DThe range goes past the end of the file.
opened the existing PATHThe 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: IDSWhen the document opens, annotations point at lines that the code does not have.
tiza check gives the problem of N annotations: IDSWhen 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 checkThe 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, not lines.
  • 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 disabled are in The runtime folder.