Skip to content

Copy Command Blocks

sivtr copy reads the structured shell session log created by shell integration. It does not require opening the browser.

Install shell integration first if command-block copy has no data:

Terminal window
sivtr init powershell
# or: sivtr init bash / zsh / nushell

Restart the shell after installation.

Terminal window
sivtr copy
sivtr copy in
sivtr copy out
sivtr copy cmd
CommandCopies
sivtr copyInput plus output
sivtr copy inInput only, including prompt by default
sivtr copy outOutput only
sivtr copy cmdBare command only

Aliases:

AliasFull command
sivtr csivtr copy
sivtr cisivtr copy in
sivtr cosivtr copy out
sivtr ccsivtr copy cmd

Selectors are relative to the newest command block:

Terminal window
sivtr copy 1
sivtr copy out 2
sivtr copy in 2..4

1 is the latest block. 2 is the previous block. 2..4 selects several recent blocks. See Selectors and Filters for the shared syntax.

Use --print to see what was copied:

Terminal window
sivtr copy out --print

The text is still copied to the clipboard.

Use --ansi when you want colored terminal sequences preserved:

Terminal window
sivtr copy out --ansi

This only has an effect when the session entry has ANSI-preserved output.

Input-copying modes preserve the original prompt by default. Override it with --prompt:

Terminal window
sivtr copy in --prompt ":"
sivtr copy --prompt ">"

If the prompt does not end with whitespace, sivtr inserts one space before the command.

Filters run after selected blocks are assembled.

Terminal window
sivtr copy out --regex panic
sivtr copy out --lines 10:20
sivtr copy out --lines 1,3,8:12

If both filters are set, --regex runs first and --lines runs on the filtered result.

Open an interactive picker:

Terminal window
sivtr copy --pick
sivtr copy out --pick
sivtr copy cmd --pick

Useful picker keys:

KeyAction
j / kMove
SpaceToggle current entry
vMark range anchor
aToggle all
:Start a temporary line filter for the next copy
pToggle preview
tOpen Vim-style full view
EnterConfirm
BackspaceEdit the pending line filter
EscCancel

The Vim-style full view supports [[ and ]] to jump blocks, myy / myi / myo / myc to copy, and mvv / mvi / mvo to select.