svg-term-cli

repository·master·Indexed 26 days ago

https://github.com/marionebl/svg-term-cli

A tool that renders asciinema terminal recordings into high-quality animated SVGs. It allows users to share terminal sessions in environments where JavaScript-based players are not supported, such as GitHub READMEs or npm registry pages. It supports converting asciicasts via cast ID, JSON files, or stdin, and can record new sessions using the --command flag.

Tokens
1.4K
Snippets
3
Records
8
Agent score
38%

What's inside svg-term-cli

  1. Convert asciicast to animated SVG

    master

    You can generate an animated SVG from an existing asciinema cast using the --cast flag. You can specify an output file with --out and add window decorations with --window.

    svg-term --cast=113643 --out examples/parrot.svg --window
  2. Configure terminal profiles with --term and --profile

    master

    To ensure the SVG matches your terminal's appearance, you can specify the terminal type and a specific profile. Note that when using these flags, they must be used together.

    Supported --term formats include: iterm2, xrdb, xresources, terminator, konsole, terminal, remmina, termite, tilda, xcfe.

    If --profile points to a file path, the CLI will attempt to parse it using the specified --term parser. If it is a name, the CLI will attempt to look up that profile within your terminal's configuration (primarily supported on macOS).

  3. Record a new session using --command

    master
    You can record a new terminal session directly using the --command flag. This requires asciinema to be installed on your system. The CLI will use asciinema rec to capture the session and then process it into an SVG.
  4. Reference the svg-term CLI options

    master

    The svg-term command accepts several options to control the rendering of terminal sessions into SVG format:

    OptionDescription
    --at <number>timestamp of frame to render in ms
    --cast <string>asciinema cast id to download (required if no stdin provided)
    --command <string>command to record
    --from <number>lower range of timeline to render in ms
    --height <number>height in lines
    --helpprint this help
    --in <string>json file to use as input
    --no-cursordisable cursor rendering
    --no-optimizedisable svgo optimization
    --out <string>output file (emits to stdout if omitted)
    --padding <number>distance between text and image bounds
    --padding-x <number>distance between text and image bounds on x axis
    --padding-y <number>distance between text and image bounds on y axis
    --profile <string>terminal profile file to use (requires --term)
    --term <string>terminal profile format (iterm2, xrdb, xresources, terminator, konsole, terminal, remmina, termite, tilda, xcfe) (requires --profile)
    --to <number>upper range of timeline to render in ms
    --width <number>width in columns
    --windowrender with window decorations
  5. Reference svg-term CLI options

    master

    The following flags are available for the svg-term command line interface:

    Options
        --at            timestamp of frame to render in ms [number]
        --cast          asciinema cast id to download [string], required if no stdin provided [string]
        --command       command to record [string]
        --from          lower range of timeline to render in ms [number]
        --height        height in lines [number]
        --help          print this help [boolean]
        --in            json file to use as input [string]
        --no-cursor     disable cursor rendering [boolean]
        --no-optimize   disable svgo optimization [boolean]
        --out           output file, emits to stdout if omitted, [string]
        --padding       distance between text and image bounds, [number]
        --padding-x     distance between text and image bounds on x axis [number]
        --padding-y     distance between text and image bounds on y axis [number]
        --profile       terminal profile file to use, requires --term [string]
        --term          terminal profile format [iterm2, xrdb, xresources, terminator, konsole, terminal, remmina, termite, tilda, xcfe], requires --profile [string]
        --to            upper range of timeline to render in ms [number]
        --width         width in columns [number]
        --window        render with window decorations [boolean]