Skip to content

CLI Reference

This page documents the public CLI surface. The source of truth is src/cli.rs; run sivtr --help and sivtr <command> --help for installed-version help.

Terminal window
sivtr [COMMAND]

If no command is provided, sivtr reads from stdin, matching pipe mode.

Terminal window
sivtr run <COMMAND> [ARGS...]

Runs a command, captures combined stdout/stderr, reports the exit status, saves history when enabled, and opens the captured output.

Terminal window
sivtr run cargo test
sivtr run git status --short
Terminal window
sivtr pipe

Reads stdin and opens it. Piping directly to sivtr is equivalent:

Terminal window
cargo build 2>&1 | sivtr
Terminal window
sivtr import

Opens the current structured shell session log. Requires shell integration.

Terminal window
sivtr init <TARGET>

Supported targets:

TargetPurpose
powershellInstall Windows PowerShell hook
pwshAlias for PowerShell integration
bashInstall Bash hook
zshInstall Zsh hook
nushell / nuInstall Nushell hook
tmuxInstall tmux picker binding
linux-shortcutGenerate Linux desktop/terminal picker launcher
macos-shortcutGenerate macOS Terminal/LaunchAgent picker launcher
Terminal window
sivtr copy [MODE] [SELECTOR] [OPTIONS]

Command-block modes:

ModeMeaning
no modeCopy input plus output
inCopy input
outCopy output
cmdCopy bare command

Aliases:

AliasExpands to
sivtr csivtr copy
sivtr cisivtr copy in
sivtr cosivtr copy out
sivtr ccsivtr copy cmd

Common options:

OptionMeaning
--ansiCopy ANSI-decorated text when available
--pickOpen the interactive picker
--printPrint copied text after copying
--regex <PATTERN>Keep lines matching regex
--lines <SPEC>Keep selected 1-based lines

Input-capable modes also support:

OptionMeaning
--prompt <TEXT>Rewrite the copied input prompt

Examples:

Terminal window
sivtr copy
sivtr copy 3 --print
sivtr copy --prompt ":"
sivtr copy in 2..4
sivtr copy out --pick --regex panic
sivtr copy cmd --pick
Terminal window
sivtr copy <PROVIDER> [MODE] [SELECTOR] [OPTIONS]

Providers:

ProviderCommand
Codexsivtr copy codex
Claude Codesivtr copy claude
Hermessivtr copy hermes
OpenCodesivtr copy opencode
Pisivtr copy pi

Modes:

ModeMeaning
no modeLast completed user + assistant turn
inLast user message
outLast assistant reply
toolLast tool output
allWhole parsed session

Agent copy options include all common copy options plus:

OptionMeaning
`—session <NID>`

Examples:

Terminal window
sivtr copy claude
sivtr copy claude out --print
sivtr copy hermes out --print
sivtr copy claude --session 2
sivtr copy codex 2..4
sivtr copy codex out --pick
sivtr copy opencode all --lines 1:20
sivtr copy pi tool --regex error
Terminal window
sivtr diff <LEFT> <RIGHT> [OPTIONS]

Compares two recent command blocks from the current shell session. Each selector must resolve to exactly one block.

Content options:

OptionMeaning
--outputCompare output text. This is the default.
--blockCompare input plus output
--inputCompare input with prompt
--cmdCompare bare command text

View option:

OptionMeaning
--side-by-sideShow a two-column text view

Examples:

Terminal window
sivtr diff 1 2
sivtr diff 3 1 --block
sivtr diff 2 1 --side-by-side
Terminal window
sivtr search <TARGET> [OPTIONS]

Searches captured terminal records and supported AI workspace sessions. The target chooses where to search; filters choose which records match.

Targets:

TargetMeaning
terminal[/<session>[/<record>[/<line>]]]Terminal command records
agent[/<session>[/<turn>[/<line>]]]All supported AI/agent records
codex[/<session>[/<turn>[/<line>]]]Codex records
claude[/<session>[/<turn>[/<line>]]]Claude Code records
hermes[/<session>[/<turn>[/<line>]]]Hermes records
opencode[/<session>[/<turn>[/<line>]]]OpenCode records
pi[/<session>[/<turn>[/<line>]]]Pi records

Use * for wildcard path segments, for example terminal/*/3 or pi/*/*.

Options:

OptionMeaning
--match <REGEX>, -m <REGEX>Case-insensitive content filter
--exclude <REGEX>, -v <REGEX>Case-insensitive exclusion filter applied after matches are found
--in <FIELD>, -i <FIELD>content, title, session, input, output, command, or all; default is content
--status <STATUS>success, failure, or unknown
--exit-code <CODE>Exact terminal process exit code
--min-duration <DURATION>Minimum command duration, e.g. 500ms, 2s, 1m
--max-duration <DURATION>Maximum command duration
--sort <SORT>newest, oldest, duration, duration-asc, exit-code, or exit-code-asc
--cwd <PATH>Workspace directory used to resolve records
--since <TIME>Only include records at or after this time
--until <TIME>Only include records at or before this time
--last <DURATION>Recent time window, e.g. 30m, 2h, 7d
--latest <N>Return the latest N matching records before final sort
-l, --limit <N>Maximum result groups to print
--exclude-current, --otherExclude the current agent session from agent searches
--jsonAlias for --format workset
--refsAlias for --format refs; prints refs, one per line
--format <FORMAT>, -f <FORMAT>full, timeline, compact, md, refs, or workset; terminal stdout defaults to full, piped stdout defaults to workset

When stdout is piped and no explicit format is selected, WorkSet commands emit WorkSet JSON for the next command. Use --refs or -f timeline only at the final display step.

Time filters accept RFC3339 timestamps, Unix seconds/milliseconds, relative durations like 30m, 2h, 7d, and aliases such as today, yesterday, tomorrow, this morning, this afternoon, this evening, tonight, and now.

Examples:

Terminal window
sivtr search terminal --status failure --latest 1 --json
sivtr s terminal -m "panic|failed" -v "example|sample" --since today --refs
sivtr s terminal -m "panic|failed" | sivtr filter @ -v "demo" -i title -f timeline
sivtr search agent --match "TODO|failed|next step" --since yesterday --format md
sivtr search pi --since today --sort oldest --format timeline
sivtr search pi/019e5941 --match "cargo test" --format compact
sivtr search terminal/session_13104/3/12 --format workset
Terminal window
sivtr filter [SOURCE] [OPTIONS]

Filters a source or piped WorkSet with the same shared WorkSet filter surface used by search. If SOURCE is omitted it defaults to @, meaning WorkSet JSON from stdin.

Options:

OptionMeaning
--partsSelect matching part anchors instead of preserving the input anchor granularity
--match <REGEX>, -m <REGEX>Case-insensitive content filter
--exclude <REGEX>, -v <REGEX>Case-insensitive exclusion filter
--in <FIELD>, -i <FIELD>content, title, session, input, output, command, or all
--io <IO>With --parts, choose all, input, or output parts
--kind <KIND>Part kind filter
--status <STATUS>success, failure, or unknown
--exit-code <CODE>Exact terminal process exit code
--min-duration <DURATION>Minimum command duration
--max-duration <DURATION>Maximum command duration
--sort <SORT>newest, oldest, duration, duration-asc, exit-code, or exit-code-asc
--cwd <PATH>Workspace directory used to resolve records
--since <TIME> / --until <TIME> / --last <DURATION>Time filters
--latest <N>Return the latest N matching anchors before final sort
-l, --limit <N>Maximum result anchors to print
--exclude-current, --otherExclude the current agent session from agent searches
--jsonAlias for --format workset
--refsAlias for --format refs
--format <FORMAT>, -f <FORMAT>full, timeline, compact, md, refs, or workset
--save <NAME>Save the result WorkSet as @name

Examples:

Terminal window
sivtr search terminal --json | sivtr filter @ -m error --refs
sivtr filter terminal --status failure --refs
sivtr filter @last --parts --io output --kind tool_output --refs
Terminal window
sivtr var <COMMAND>

Manages named WorkSet variables.

CommandMeaning
set <name> [source]Save a source or piped WorkSet as @name
listList saved variables with item counts and creation time
rm <name>Remove one saved variable
merge <name> <source>...Merge sources into a saved variable, deduplicating by anchor
drop <name> <source>...Remove source anchors from a saved variable
cleanupRemove all saved variables

Examples:

Terminal window
sivtr var set ctx @last
sivtr filter terminal -m panic --json | sivtr var set failures
sivtr var list
sivtr var merge ctx @failures @last[1]
sivtr var drop ctx @noise
Terminal window
sivtr nav <SOURCE> <MOTION> [OPTIONS]

Moves WorkSet anchors deterministically through record/part/session structure. nav does not default-expand children; child movement must specify a 1-based index with >N.

Motion tokens compose left-to-right:

TokenMeaning
<Parent. Part/line to record; record to containing session records.
>NNth child, 1-based. Record children are its parts.
+NNext sibling by N at the current level.
-NPrevious sibling by N at the current level.
[A..B]Sibling window at the current level, relative to the current anchor.
~Containing session records.

Options:

OptionMeaning
--cwd <PATH>Workspace directory used to resolve records
--jsonAlias for --format workset
--refsAlias for --format refs
--format <FORMAT>, -f <FORMAT>full, timeline, compact, md, refs, or workset

Examples:

Terminal window
sivtr nav @hit '<' --refs
sivtr nav @hit '>1' --refs
sivtr nav @hit '<+1>1' --refs
sivtr nav @hit '<[-2..+2]' --refs
sivtr nav @hit '~' --refs

Use zoom for simple neighboring record context. Use nav when the exact movement path matters.

Terminal window
sivtr show <SOURCE> [OPTIONS]

Prints a workspace ref or WorkSet source such as @last, @name, or @.

Ref syntax:

source/session[/dialogue[/line]]

Options:

OptionMeaning
--cwd <PATH>Workspace directory used to resolve sessions
--jsonAlias for --format workset
--refsAlias for --format refs
--fullAlias for --format full
--format <FORMAT>, -f <FORMAT>full, timeline, compact, md, refs, or workset

Examples:

Terminal window
sivtr show claude/<session-id>
sivtr show claude/<session-id>/3
sivtr show claude/<session-id>/3/7 --json
sivtr show terminal/current/2
sivtr show @last --full
sivtr show @ctx -f timeline
Terminal window
sivtr version [--verbose]

Prints the Sivtr version. Use --verbose to diagnose which binary is running and whether it differs from the local debug build in the current repository.

Terminal window
sivtr version
sivtr version --verbose

Verbose output includes:

  • package version;
  • binary path;
  • current working directory;
  • debug/release profile;
  • git commit and build time when available;
  • detected repo root;
  • local target/debug/sivtr binary status;
  • a warning when a different global binary is being used inside the repo.
Terminal window
sivtr history [COMMAND]

Subcommands:

CommandMeaning
list [-l, --limit <N>]List recent entries
search <KEYWORD> [-l, --limit <N>]Search saved capture history
show <ID>Show a specific history entry

If no history subcommand is provided, list is used.

Terminal window
sivtr config [COMMAND]

Subcommands:

CommandMeaning
showShow config path and content
initCreate default config
editOpen config in editor

If no config subcommand is provided, show is used.

Terminal window
sivtr hotkey [COMMAND]

Subcommands:

CommandMeaning
start [--chord <CHORD>] [--provider <PROVIDER>]Start Windows global hotkey daemon
statusShow daemon status
stopStop daemon

If no hotkey subcommand is provided, status is used.

Examples:

Terminal window
sivtr hotkey start
sivtr hotkey start --chord alt+y
sivtr hotkey start --provider claude
sivtr hotkey status
sivtr hotkey stop
Terminal window
sivtr codex export --dest <PATH> [OPTIONS]

Exports local Codex rollout JSONL files into a target directory containing a sessions/ tree.

Options:

OptionMeaning
--dest <PATH>Destination directory that will receive the sessions/ tree
--limit <N>Keep only newest N session files; 0 means export all
--watchContinue mirroring local sessions
--interval <SECONDS>Seconds between sync passes when watching; default is 1
--interval-ms <MILLISECONDS>Milliseconds between sync passes; overrides --interval

Examples:

Terminal window
sivtr codex export --dest /srv/sivtr/root-codex
sivtr codex export --dest /srv/sivtr/root-codex --watch
sivtr codex export --dest /srv/sivtr/root-codex --limit 100
Terminal window
sivtr clear [--all]

Clears current shell session logs. --all clears all recorded session logs and state files managed by sivtr.

See Selectors and Filters for recency selectors, --session, providers, --regex, --lines, --ansi, --print, and workspace refs.