Command-Line Interface¶
Run termvisage --help to see the basic help message or termvisage --long-help
for the full help message.
Note
Some options are only applicable in a specific mode. If used with the other mode, they’re simply ignored.
Shell Completion¶
Run termvisage --completions for instructions on enabling tab completion for options
and arguments of termvisage in your preferred shell.
Options and Arguments¶
usage: termvisage [--help | --long-help] [--version] [--completions]
[--query-timeout N] [-S {auto,block,iterm2,kitty}]
[--force-style] [-C N | --auto-cell-ratio]
[--swap-win-size | --no-swap-win-size] [--cli | --tui]
[-f N] [-R N]
[--anim-cache N | --cache-all-anim | --cache-no-anim]
[--no-anim] [--no-alpha | -A N | -b [COLOR]] [--h-allow N]
[--v-allow N] [--scroll] [-O]
[-w N | -h N | --fit | --fit-to-width | --original-size | -s N | -x N | -y N]
[--no-align] [-H {left,center,right}] [--pad-width N]
[-V {top,middle,bottom}] [--pad-height N] [-a] [-r] [-d N]
[--thumbnail | --no-thumbnail] [--max-pixels N]
[--multi | --no-multi] [--config FILE | --no-config]
[-l FILE]
[--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} | -q | -v | --verbose-log | --debug]
[--kz N] [--kc N] [--itn] [--itnmb N] [--itc N] [--itjq N]
[--itnrff]
[SOURCE ...]
-- should be used to separate positional arguments that begin with a - from options/flags, to avoid ambiguity.
For example, $ termvisage [options] -- -image.jpg --image.png.
See https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html for supported image formats.
See https://termvisage.readthedocs.io/en/stable/cli.html for the complete CLI description.
Positional Arguments¶
- source¶
Image file path(s), directory path(s) and/or image URL(s); if none is specified, the current working directory is used
General Options¶
- --help¶
Show the basic help message and exit
- --long-help¶
Show this help message and exit
- --version¶
Show the program version and exit
- --completions¶
Show instructions to enable shell completions and exit
- --query-timeout <n>¶
Timeout (in seconds) for all terminal queries (default:
query timeoutconfig)
- -S {auto,block,iterm2,kitty}, --style {auto,block,iterm2,kitty}¶
Image render style (default:
styleconfig) [1]
- --force-style¶
Use the specified render style even if it’s reported as unsupported by the active terminal
- -C <n>, --cell-ratio <n>¶
The cell ratio (width-to-height ratio of a character cell) in the terminal; to preserve image aspect ratio (default:
cell ratioconfig)
- --auto-cell-ratio¶
Determine the cell ratio from the terminal emulator, if possible (default:
cell ratioconfig)
- --swap-win-size, --no-swap-win-size¶
Enable/Disable a workaround for auto cell ratio on some terminal emulators (e.g older VTE-based ones) that wrongly report window dimensions swapped (default:
swap win sizeconfig)
- --tui¶
Launch the TUI, even for a single image
Animation Options (General)¶
- -f <n>, --frame-duration <n>¶
The time (in seconds) between frames for all animated images (default: determined per image from the metadata OR 0.1)
- -R <n>, --repeat <n>¶
Number of times to repeat all frames of an animated image; A negative count implies an infinite loop (default: -1)
- --anim-cache <n>¶
Maximum frame count for animation frames to be cached (Better performance at the cost of memory) (default:
anim cacheconfig) [3]
- --cache-all-anim¶
Cache frames for all animations (beware, the higher the frame count per image, the higher the memory usage)
- --cache-no-anim¶
Disable frame caching (Less memory usage but reduces performance)
- --no-anim¶
Disable image animation. Animated images are displayed as just their first frame.
Transparency Options (General)¶
NOTE: These are mutually exclusive
- --no-alpha¶
Disable image transparency (alpha channel is removed)
- -A <n>, --alpha <n>¶
Alpha ratio above which pixels are taken as opaque (0 <= N < 1), for text-based render styles (default: 0.156863)
- -b <color>, --alpha-bg <color>¶
Hex color (without
#) to replace transparent backgrounds with (omit COLOR to use the active terminal's default BG color)
CLI-only Options¶
These options apply only when there is only one valid image source or --cli is specified
- --h-allow <n>¶
Horizontal allowance i.e minimum number of columns to leave unused (default: 0)
- --v-allow <n>¶
Vertical allowance i.e minimum number of lines to leave unused (default: 2)
- --scroll¶
Allow an image’s height to be greater than the terminal height. Not needed when
--fit-to-widthis specified.
- -O, --oversize¶
Allow an image’s size to be greater than the terminal size (To be used with
-wor--original-size)
Sizing Options (CLI-only)¶
These apply to all images and are mutually exclusive [4]
- -w <n>, --width <n>¶
Image width
- -h <n>, --height <n>¶
Image height
- --fit¶
Fit each image optimally within the available terminal size
- --fit-to-width¶
Fit each image to the available terminal width,
--v-allowhas no effect i.e vertical allowance is ignored
Alignment Options (CLI-only)¶
These apply to all images
- -H {left,center,right}, --h-align {left,center,right}¶
Horizontal alignment (default: center)
- --pad-width <n>¶
Number of columns within which to align each image (default: terminal width, minus horizontal allowance)
- -V {top,middle,bottom}, --v-align {top,middle,bottom}¶
Vertical alignment (default: middle)
- --pad-height <n>¶
Number of lines within which to align each image (default: none)
TUI-only Options¶
These options apply only when there is at least one valid directory source, multiple valid sources or --tui is specified
- -a, --all¶
Include hidden file and directories
- -r, --recursive¶
Scan for local images recursively
- -d <n>, --max-depth <n>¶
Maximum recursion depth (default: 950)
Performance Options¶
- --max-pixels <n>¶
The maximum pixel-count for images that should be rendered (default:
max pixelsconfig)
Config Options¶
NOTE: These are mutually exclusive
- --config <file>¶
The config file to use for this session (default: Searches XDG Base Dirs)
- --no-config¶
Use the default configuration
Logging Options¶
NOTE: All these, except -l, are mutually exclusive
- --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}¶
Logging level for the session (default: WARNING) [6]
- -q, --quiet¶
No notifications, except fatal errors
- -v, --verbose¶
More detailed event reporting. Also sets logging level to INFO
- --debug¶
Implies
--log-level=DEBUGwith verbosity
Kitty Style Options¶
These options apply only when the kitty render style is used
- --kz <n>, --kitty-z-index <n>¶
Image stacking order [CLI-only];
>= 0-> above text,< 0-> below text,< -(2**31)/2-> below cells with non-default background (default: 0)
- --kc <n>, --kitty-compress <n>¶
ZLIB compression level; 0 -> no compression, 1 -> best speed, 9 -> best compression (default: 4)
iTerm2 Style Options¶
These options apply only when the iterm2 render style is used
- --itn, --iterm2-native¶
Use the protocol’s animation support; animations will not be skipped [CLI-only]
- --itnmb <n>, --iterm2-native-max-bytes <n>¶
Maximum size (in bytes) of image data for native animation [CLI-only] (default: 2097152)
- --itc <n>, --iterm2-compress <n>¶
ZLIB compression level, for images re-encoded in PNG format 0 -> no compression, 1 -> best speed, 9 -> best compression (default: 4)
Footnotes