GithubHelp home page GithubHelp logo

croesnick / asciinema2gif Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tav/asciinema2gif

0.0 1.0 0.0 30 KB

Generate animated GIFs from asciinema terminal recordings

Shell 40.27% JavaScript 59.73%

asciinema2gif's Introduction

asciinema2gif

Generate animated GIFs from asciinema terminal recordings.

Demo

Motivation

The asciinema tool is a wonderful way to record and share terminal sessions. Unfortunately, it's not currently possible to embed the output in places like README files on GitHub repos. This tool provides a solution for that.

Usage

asciinema2gif [options] <asciinema_id|asciinema_api_url>

  options:
    -s <size>, --size <size>      One of 'small', 'medium', 'big'
    -p <speed>, --speed <speed>   Any integer (whole number) to multiply regular speed by
    -t <theme>, --theme <theme>   One of 'asciinema', 'tango', 'solarized-dark', 'solarized-light', 'monokai'
    -o <file>, --output <file>    File to write to (defaults to 'asciicast.gif' in current directory)
    -h, --help                    Show this help.

Examples:

$ asciinema2gif --size small --speed 2 --theme solarized-dark 8332

An asciicast.gif file will then be generated for you to embed and share.

$ asciinema2gif --theme solarized-light -o "${HOME}/Desktop/another.gif" https://asciinema.org/api/asciicasts/8332

In this case an another.gif file will be generated on your Desktop. Using the full URL is useful if you want to get an asciicast not from the official website.

URL Format

asciinema2gif works by visiting the given webpage, starting the asciicast, screenshotting it repeatedly, and finally stitching it together. The /api/asciicasts/ format of an asciinema website (e.g. https://asciinema.org/api/asciicasts/8332), as opposed to the main /a/ format (e.g. https://asciinema.org/a/8332), makes this operation easier (see usage), hence why it is a requirement.

Requirements

OS X

# Requires Homebrew installed. Find it at http://brew.sh/.
# This command will install asciinema2gif and all dependencies.
brew install asciinema2gif

Ubuntu

apt-get install imagemagick gifsicle npm
npm install --global phantomjs2

Credits

License

Public domain.

— Enjoy, tav <[email protected]>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.