CLI Reference
This page documents the public CLI surface. Keep it aligned with src/cli.rs.
Top-level
Section titled “Top-level”sivtr [COMMAND]If no command is provided, sivtr reads from stdin, matching pipe mode.
sivtr run <COMMAND> [ARGS...]Runs a command, captures combined output, reports the exit status, and opens the captured output.
Examples:
sivtr run cargo testsivtr run git status --shortsivtr pipeReads stdin and opens it. In normal use, piping directly to sivtr is equivalent:
cargo build 2>&1 | sivtrimport
Section titled “import”sivtr importOpens the current structured session log. Requires shell integration.
sivtr init <SHELL>Supported shell names:
powershellpwshbashzshnushellnu
sivtr copy [MODE] [SELECTOR] [OPTIONS]Modes:
| Mode | Meaning |
|---|---|
| no mode | Copy input plus output |
in | Copy input |
out | Copy output |
cmd | Copy bare command |
codex | Copy Codex session content |
Aliases:
| Alias | Expands to |
|---|---|
c | copy |
ci | copy in |
co | copy out |
cc | copy cmd |
Common options:
| Option | Meaning |
|---|---|
--ansi | Copy ANSI-decorated text when available |
--pick | Open the interactive picker |
--print | Print copied text after copying |
--regex <PATTERN> | Keep lines matching regex |
--lines <SPEC> | Keep selected 1-based lines |
Input-capable modes also support:
| Option | Meaning |
|---|---|
--prompt <TEXT> | Rewrite the copied input prompt |
Examples:
sivtr copysivtr copy 3 --printsivtr copy --prompt ":"sivtr copy in 2..4sivtr copy out --pick --regex panicsivtr copy cmd --pickcopy codex
Section titled “copy codex”sivtr copy codex [MODE] [SELECTOR] [OPTIONS]Modes:
| Mode | Meaning |
|---|---|
| no mode | Last completed user plus assistant turn |
out | Last assistant reply |
in | Last user message |
tool | Last tool output |
all | Whole parsed session |
Examples:
sivtr copy codexsivtr copy codex 2sivtr copy codex 2..4sivtr copy codex out --printsivtr copy codex out --picksivtr copy codex tool --regex errorsivtr copy codex all --lines 1:20sivtr diff <LEFT> <RIGHT> [OPTIONS]Compares two recent command blocks from the current session. Each selector must resolve to exactly one block.
Content modes:
| Option | Meaning |
|---|---|
--output | Compare output text. This is the default. |
--block | Compare input plus output |
--input | Compare input with prompt |
--cmd | Compare bare command text |
View option:
| Option | Meaning |
|---|---|
--side-by-side | Show a two-column text view |
Examples:
sivtr diff 1 2sivtr diff 3 1 --blocksivtr diff 2 1 --side-by-sidehistory
Section titled “history”sivtr history [COMMAND]Subcommands:
| Command | Meaning |
|---|---|
list [-l, --limit <N>] | List recent entries |
search <KEYWORD> [-l, --limit <N>] | Search history |
show <ID> | Show a specific entry |
If no history subcommand is provided, sivtr lists the latest 20 entries.
config
Section titled “config”sivtr config [COMMAND]Subcommands:
| Command | Meaning |
|---|---|
show | Show config path and content |
init | Create default config |
edit | Open config in editor |
If no config subcommand is provided, show is used.
hotkey
Section titled “hotkey”sivtr hotkey [COMMAND]Subcommands:
| Command | Meaning |
|---|---|
start [--chord <CHORD>] | Start Windows hotkey daemon |
status | Show daemon status |
stop | Stop daemon |
If no hotkey subcommand is provided, status is used.
sivtr clear [--all]Clears session logs. --all clears all recorded session logs and state files.
Selector syntax
Section titled “Selector syntax”| Selector | Meaning |
|---|---|
| omitted | 1 |
1 | Latest matching item |
2 | Second latest matching item |
2..4 | Recent range |
Selector semantics are shared by command-block copy, Codex copy, and diff where applicable.