Capture Terminal Output
Capture is the first step in turning terminal output into reusable text. Use the lightest capture path that matches what you need.
Choose a capture path
Section titled “Choose a capture path”| Use case | Best command | Keeps command metadata? |
|---|---|---|
| Inspect one existing command pipeline | command 2>&1 | sivtr | No |
Let sivtr run one command | sivtr run command | Partially, for the captured run |
| Browse the current shell’s recorded work | sivtr import | Yes, after shell integration |
| Copy one recent command block | sivtr copy out | Yes, after shell integration |
| Search saved output history | sivtr history search "query" | Yes, for saved captures |
Pipe mode
Section titled “Pipe mode”Pipe mode reads stdin and opens the result.
ls -la | sivtrcargo build 2>&1 | sivtrrg "TODO" . | sivtrUse pipe mode when:
- the command already exists in your shell history;
- you want normal shell behavior for pipelines and redirection;
- you do not need
sivtrto know the original command.
For commands that write important output to stderr, redirect stderr to stdout:
cargo test 2>&1 | sivtrRun mode
Section titled “Run mode”Run mode executes the command through sivtr:
sivtr run cargo testsivtr run git status --shortUse run mode when:
- you want
sivtrto execute and capture a single command; - you want the exit status printed before browsing;
- you prefer not to manage shell redirection manually.
Run mode captures stdout and stderr together. If the command produces no output, sivtr exits after reporting that nothing was captured.
Shell session import
Section titled “Shell session import”Shell integration records structured command entries over time. After installing it, open the current session log:
sivtr importThis is useful when you have been working normally and later want to browse the accumulated session as one workspace.
Install shell integration with:
sivtr init powershellsivtr init bashsivtr init zshsivtr init nushellRestart the shell after installation.
History capture
Section titled “History capture”Captured output is saved to local history when [history].auto_save is enabled. Search it later with:
sivtr history search "panic"sivtr history show 42History is separate from the current shell session log: history is a longer-lived SQLite store, while session logs are per-shell structured records for recent command blocks.