Skip to main content

A simple and lightweight static GIF generator.

Project description


Logo

termgif

Contributors Stars Forks Issues PRs CommitCount PyPI Size Welcome License

A simple and lightweight static GIF generator!
Explore the docs »

View Demo · Report Bug · Request Feature

📖 Table of Contents
  1. 🔹 About The Project
  2. 🔹 Getting Started
  3. 🔹 Usage
  4. 🔹 Roadmap
  5. 🔹 Contributing
  6. 🔹 License
  7. 🔹 Contact
  8. 🔹 Acknowledgments

🎬 About The Project

"Creating clean, visually appealing demo screenshots for command-line tutorials can often be a tedious hassle—working with asciinema and ffmpeg involves a convoluted workflow. In reality, however, simply feeding it an API will resolve all such issues."

termgif is a cross-platform lightweight terminal GIF recorder for Windows, macOS and Linux. It captures live terminal command execution via pixel recording and exports directly to an animated GIF.

The goal is simple: create clean, shareable command-line demo GIFs with minimal dependencies.

Main flow:

  1. 🎥 Record: Launch target terminal commands, capture live screen frames (platform-aware window/region capture)
  2. 🔄 Stream: Continuously collect pixel frames while the command runs
  3. 🧩 Generate: Encode frames and export a final animated GIF on Ctrl+C

🔝back to top

📸 Screenshot

Screenshot

🛠️ Built With

  • Python3.14
  • Ruff
  • Black
  • MyPy

🔝back to top

🚀 Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

✅ Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • Hatch (if exists)
    # print all dependencies
    hatch dep show
    # print dependencies on group dep
    hatch dep show dev
    

See pyproject.toml for complete content.

📦 Installation

Install with PIP:

# Don't use termgif, it's registered; use term2gif instead.
pip install term2gif

🔝back to top

💡 Usage

import os
import subprocess as sp

import termgif

GIF_PATH: str = f"{os.path.dirname(__file__)}/dist.gif"
termgif.make_gif(
    'cmd /c "echo hello world!"', GIF_PATH # Specify the command to execute.
)
_ = sp.run([GIF_PATH], shell=True)  # Open it with the default program.

For more examples, please refer to the Documentation or Examples

🔝back to top

🗺️ Roadmap

  • v0.1.0: Basic recording for Windows
  • v0.2.0:
    • Support for macOS and Linux
    • Support for recording live inputting text on console (stdin)
    • Support recording live console (with echo and color)

See the open issues for a full list of proposed features (and known issues).

🔝back to top

🤝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

🔝back to top

🌟 Top contributors:

contrib.rocks image

📃 License

Distributed under the project_license. See LICENSE for more information.

🔝back to top

📬 Contact

Nicola Grey - popxh@outlook.com

Project Link: https://github.com/FishgameStudio/termgif

🔝back to top

🙏 Acknowledgments

🔝back to top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

term2gif-0.2.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

term2gif-0.2.1-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file term2gif-0.2.1.tar.gz.

File metadata

  • Download URL: term2gif-0.2.1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for term2gif-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6cba2966836dafdc7c41fe633c29e304fead00935c7ed8f53dba5358ce4e07e9
MD5 eb7ed17a9defd320c44ac4301356a38a
BLAKE2b-256 8e497f0595129b7aad0147f5df7b294c3601df1eec33741e64914f939fba2fee

See more details on using hashes here.

File details

Details for the file term2gif-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: term2gif-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for term2gif-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b9befdd7451e973b385b8f552308ce5a851c1ba48873451930c5bd27bbefd3
MD5 a99cfffa45f74cfbc4be44519b6f6349
BLAKE2b-256 f1f062408ede99cf8734dacc2cff5db7cbbf41304c9bb3a0729989abdd386985

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page