Record, share and export your terminal as a animated SVG image.

Record, share and export your terminal as a animated SVG image.


golangci-lint pre-commit GitHub release (latest SemVer) Go Reference


Overview

TermSVG is an all in one cli tool to record, replay and export your terminal session to svg. It uses the same format as asciinema so you can convert asciicast files to SVG or use the asciinema player with a TermSVG recording.

Installation

Manually

You can download a pre compiled binary directly from the releases for your OS/Architecture.

Go cli

If you already have Go in your system you can use go install

go install github.com/mrmarble/termsvg/cmd/termsvg@latest # or target a specific version @v0.6.0

Install script

I made an installation script that should download the latest available version corresponding to your OS and architecture. sudo is needed to copy the binary to /usr/local/bin

curl -sL https://raw.githubusercontent.com/MrMarble/termsvg/master/scripts/install-termsvg.sh | sudo -E bash -
# or with wget
wget -O - https://raw.githubusercontent.com/MrMarble/termsvg/master/scripts/install-termsvg.sh | sudo -E bash -

Usage

termsvg is composed of multiple commands, similar to git, docker or asciinema.

When you run termsvg with no arguments help message is displayed, listing all available commands with their options.

rec <filename>

Record terminal session.

By running termsvg rec <filename> you start a new recording session. The command (process) that is recorded can be specified with -c option (see below), and defaults to $SHELL which is what you want in most cases.

You can temporarily pause recording of terminal by pressing Ctrl+P. This is useful when you want to execute some commands during the recording session that should not be captured (e.g. pasting secrets). Resume by pressing Ctrl+P again.

Recording finishes when you exit the shell (hit Ctrl+D or type exit). If the recorded process is not a shell then recording finishes when the process exits.

The resulting recording (called asciicast) is saved to a local file. It can later be replayed with termsvg play <filename> and/or exported to svg with termsvg export -i <filename>.

Available options:

  • -c, --command=<command> - Specify command to record, defaults to $SHELL

play <filename>

Replay recorded asciicast in a terminal.

This command replays given asciicast (as recorded by rec command) directly in your terminal.

Playing from a local file:

termsvg play /path/to/asciicast.cast

Available options:

  • -i, --idle-time-limit=<sec> - Limit replayed terminal inactivity to max <sec> seconds
  • -s, --speed=<factor> - Playback speed (can be fractional)

For the best playback experience it is recommended to run termsvg play in a terminal of dimensions not smaller than the one used for recording, as there's no "transcoding" of control sequences for new terminal size.

export <filename>

Export recorded asciicast to svg.

This command exports given asciicast (as recorded by rec command) to svg.

Exporting from a local file:

termsvg export /path/to/asciicast.cast

Available options:

  • -o, --output=<file> - Output svg to be created. Defaults to [input].svg
  • -m, --minify - Minify svg using Minify

Example

Asciinema recording inverted pendulum inverted pendulum

More at the examples folder

Contributing

If you want to contribute to this project check out CONTRIBUTING.md.

License

All code is licensed under the GPL, v3 or later. See LICENSE file for details.

Owner
Alvaro Tinoco
Full Stack Developer
Alvaro Tinoco
Similar Resources

Build event-driven and event streaming applications with ease

Commander 🚀 Commander is Go library for writing event-driven applications. Enabling event sourcing, RPC over messages, SAGA's, bidirectional streamin

Dec 19, 2022

Emits events in Go way, with wildcard, predicates, cancellation possibilities and many other good wins

Emitter The emitter package implements a channel-based pubsub pattern. The design goals are to use Golang concurrency model instead of flat callbacks

Jan 4, 2023

Glue - Robust Go and Javascript Socket Library (Alternative to Socket.io)

Glue - Robust Go and Javascript Socket Library Glue is a real-time bidirectional socket library. It is a clean, robust and efficient alternative to so

Nov 25, 2022

Declare AMQP entities like queues, producers, and consumers in a declarative way. Can be used to work with RabbitMQ.

About This package provides an ability to encapsulate creation and configuration of RabbitMQ([AMQP])(https://www.amqp.org) entities like queues, excha

Dec 28, 2022

Abstraction layer for simple rabbitMQ connection, messaging and administration

Abstraction layer for simple rabbitMQ connection, messaging and administration

Jazz Abstraction layer for quick and simple rabbitMQ connection, messaging and administration. Inspired by Jazz Jackrabbit and his eternal hatred towa

Dec 12, 2022

Server-sent live updates: protocol and reference implementation

Server-sent live updates: protocol and reference implementation

Protocol and Reference Implementation Mercure is a protocol allowing to push data updates to web browsers and other HTTP clients in a convenient, fast

Jan 1, 2023

A tiny wrapper around NSQ topic and channel :rocket:

Event Bus NSQ A tiny wrapper around go-nsq topic and channel. Protect nsq calls with gobreaker. Installation go get -u github.com/rafaeljesus/nsq-even

Sep 27, 2022

A tiny wrapper over amqp exchanges and queues 🚌 ✨

Rabbus 🚌 ✨ A tiny wrapper over amqp exchanges and queues. In memory retries with exponential backoff for sending messages. Protect producer calls wit

Dec 18, 2022

RabbitMQ wire tap and swiss army knife

RabbitMQ wire tap and swiss army knife

rabtap - RabbitMQ wire tap Swiss army knife for RabbitMQ. Tap/Pub/Sub messages, create/delete/bind queues and exchanges, inspect broker. Contents Feat

Dec 28, 2022
cisasntyi: check iphone stock and send notification to your iphone

for buy iphone 13 notification cisasntyi: check iphone stock and send notification to your iphone install Bark app in your iphone first before you run

Aug 3, 2022
Imagine a simple, beautiful, secure, and freaking fast way to broadcast your events throw the internet

Event Superintendent Imagine a simple, beautiful, secure, and freaking fast way to broadcast your events throw the internet. That's exactly why you sh

Jul 18, 2022
An opinionated package that helps you print user-friendly output messages from your Go command line applications.

github.com/eth-p/clout (Command Line Output) clout is a package that helps you print user-friendly output messages from your Go command line applicati

Jan 15, 2022
Bark is an iOS App which allows you to push customed notifications to your iPhone.
Bark is an iOS App which allows you to push customed notifications to your iPhone.

Bark is an iOS App which allows you to push customed notifications to your iPhone.

Jan 3, 2023
Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Cadence Visit cadenceworkflow.io to learn about Cadence. This repo contains the source code of the Cadence server. To implement workflows, activities

Jan 9, 2023
The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which can provide developers with stable, reliable, and efficient push services.

Go-Push-API MiPush、JiPush、UMeng MiPush The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which c

Oct 20, 2022
May 11, 2023
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol.

APNS/2 APNS/2 is a go package designed for simple, flexible and fast Apple Push Notifications on iOS, OSX and Safari using the new HTTP/2 Push provide

Jan 1, 2023
Asynq: simple, reliable, and efficient distributed task queue in Go
Asynq: simple, reliable, and efficient distributed task queue in Go

Asynq Overview Asynq is a Go library for queueing tasks and processing them asynchronously with workers. It's backed by Redis and is designed to be sc

Dec 30, 2022
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Jan 1, 2023