{"id":13539267,"url":"https://github.com/google/gif-for-cli","last_synced_at":"2026-04-26T10:30:18.937Z","repository":{"id":37549402,"uuid":"137374686","full_name":"google/gif-for-cli","owner":"google","description":null,"archived":true,"fork":false,"pushed_at":"2023-08-05T20:33:33.000Z","size":301,"stargazers_count":2926,"open_issues_count":22,"forks_count":162,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-02-08T16:47:45.934Z","etag":null,"topics":["cli","command-line","gif","gifs","python3"],"latest_commit_sha":null,"homepage":"https://opensource.googleblog.com/2018/06/tenor-gif-for-cli.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-14T15:11:45.000Z","updated_at":"2025-02-02T16:26:08.000Z","dependencies_parsed_at":"2024-01-10T19:10:45.132Z","dependency_job_id":null,"html_url":"https://github.com/google/gif-for-cli","commit_stats":{"total_commits":25,"total_committers":3,"mean_commits":8.333333333333334,"dds":0.12,"last_synced_commit":"31f8aa2d617d6d6e941154f60e287c38dd9a74d5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgif-for-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgif-for-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgif-for-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgif-for-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/gif-for-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240058619,"owners_count":19741487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line","gif","gifs","python3"],"created_at":"2024-08-01T09:01:22.659Z","updated_at":"2026-04-26T10:30:18.889Z","avatar_url":"https://github.com/google.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003e\n    \u003cimg src=\"docs/gif-for-cli-logo.png\" alt=\"gif-for-cli logo\" width=\"256\" height=\"198\"/\u003e\n\u003c/h1\u003e\n\nTakes in a GIF, short video, or a query to the [Tenor][tenor-home] GIF API and converts it to animated ASCII art. Animation and color support are performed using ANSI escape sequences.\n\nExample use cases:\n\n* run `gif-for-cli` in your `.bashrc` or `.profile` to get an animated ASCII art image as your MOTD!\n* git hooks [;)](git-hooks/pre-push)\n\nThis script will automatically detect how many colors the current terminal uses and display the correct version:\n\n| Original GIF  | No Colors Supported | 256 Colors Supported | 256 Colors Supported (with foreground and background colors) | Truecolor Supported |\n| ------------- |:-------------------:| --------------------:| ------------------------------------------------------------:| -------------------:|\n| [![Original GIF][original-gif]][original-gif-url] | [![No Color Animated ASCII Art][no-color]][no-color-url] | [![256 Colors Animated ASCII Art][256-colors]][256-colors-url] | [![256 FG/BG Colors Animated ASCII Art][256fgbg-colors]][256fgbg-colors-url] | [![Truecolor Animated ASCII Art][truecolor]][truecolor-url] |\n\n[original-gif]: https://media1.tenor.com/images/eac7f7d8534f0843ebd707101b8ef7fd/tenor.gif?itemid=11699608\n[no-color]: https://media1.tenor.com/images/95e9551fb69b5c2f67cdc48f04c75bc7/tenor.gif?itemid=11997403\n[256-colors]: https://media1.tenor.com/images/d354ee0840d9376e2baacdbee59b6c06/tenor.gif?itemid=11997429\n[256fgbg-colors]: https://media1.tenor.com/images/f8d461c1a6e06f0b3dd6c7aff474117b/tenor.gif?itemid=12000378\n[truecolor]: https://media1.tenor.com/images/30196efdd05d816d4aab6179e41318ac/tenor.gif?itemid=11997399\n\n[original-gif-url]: https://tenor.com/view/rob-delaney-peter-deadpool-deadpool2-untitled-deadpool-sequel-gif-11699608\n[no-color-url]: https://tenor.com/view/peter-deadpool2-ascii-giffor-cli-gif-11997403\n[256-colors-url]: https://tenor.com/view/peter-deadpool2-ascii-giffor-cli-ready-gif-11997429\n[256fgbg-colors-url]: https://tenor.com/view/peter-deadpool2-ascii-giffor-cli-ready-gif-12000378\n[truecolor-url]: https://tenor.com/view/peter-deadpool2-ascii-giffor-cli-ready-gif-11997399\n\n## Installation\n\nRequires Python 3 (with setuptools and pip), zlib, libjpeg, and ffmpeg, other dependencies are installed by `setup.py`.\n\n### Install dependencies:\n\n    # Debian based distros\n    sudo apt-get install ffmpeg zlib* libjpeg* python3-setuptools\n    # Mac\n    brew install ffmpeg zlib libjpeg python\n\nYour Python environment may need these installation tools:\n\n    sudo easy_install3 pip\n    # This should enable a pre-built Pillow wheel to be installed, otherwise\n    # you may need to install Python, zlib, and libjpeg development libraries\n    # so Pillow can compile from source.\n    pip3 install --user wheel\n\n### Install gif-for-cli:\n\nInstall from PyPI:\n\n    pip3 install --user gif-for-cli\n\nOr download this repo and run:\n\n    python3 setup.py install --user\n\nThe `gif-for-cli` command will likely be installed into `~/.local/bin` or similar, you may need to put that directory in your $PATH by adding this to your `.profile`:\n\n    # Linux\n    if [ -d \"$HOME/.local/bin\" ] ; then\n        PATH=\"$HOME/.local/bin:$PATH\"\n    fi\n    # Mac, adjust for Python version\n    if [ -d \"$HOME/Library/Python/3.6/bin/\" ] ; then\n        PATH=\"$HOME/Library/Python/3.6/bin/:$PATH\"\n    fi\n\n## Usage\n\n### File/URL\n\n    gif-for-cli path/to/some.gif\n    gif-for-cli http://example.com/foo.gif\n    gif-for-cli http://example.com/foo.mp4\n\nExecuting as a Python module is also supported:\n\n    python3 -m gif_for_cli path/to/some.gif\n\n### Query [Tenor's GIF API][tenor-gif-api]\n\nQueries to Tenor's GIF API can also be performed:\n\n    # get current top trending GIF\n    gif-for-cli\n\n    # get top GIF for \"Happy Birthday\"\n    gif-for-cli \"Happy Birthday\"\n\n    # get GIF with ID #11699608\n    # browse https://tenor.com/ for more!\n    gif-for-cli 11699608\n    gif-for-cli https://tenor.com/view/rob-delaney-peter-deadpool-deadpool2-untitled-deadpool-sequel-gif-11699608\n\n### Override display mode\n\n    gif-for-cli --display-mode=nocolor 11699608\n    gif-for-cli --display-mode=256 11699608\n    gif-for-cli --display-mode=256fgbg 11699608\n    gif-for-cli --display-mode=truecolor 11699608\n\n### Change max width/height\n\nThe default number of rows and columns may be too large and result in line wrapping. If you know your terminal size, you can control the output size with the following options:\n\n    gif-for-cli --rows 10 --cols 100 11699608\n\nSet to current terminal size:\n\n    gif-for-cli --rows `tput lines` --cols `tput cols` 11699608\n\nNote: Generated ASCII art is cached based on the number of rows and columns, so running that command after resizing your terminal window will likely result in the ASCII Art being regenerated.\n\n### Loop forever\n\n    gif-for-cli -l 0 11699608\n\nUse \u003ckbd\u003eCTRL\u003c/kbd\u003e + \u003ckbd\u003ec\u003c/kbd\u003e to exit.\n\n### Export/Share\n\nWant to share your generated ASCII Art outside a CLI env (e.g. social media)?\n\n    gif-for-cli 11699608 --export=foo.gif\n\n### Help\n\nSee more generation/display options:\n\n    gif-for-cli --help\n\n## About Tenor\n\nTenor is the API that delivers the most relevant GIFs for any application, anywhere in the world. We are the preferred choice for communication products of all types and the fastest growing GIF service on the market.\n\nCheck out our API Docs: [https://tenor.com/gifapi][tenor-gif-api]\n\n## Testing\n\n    python3 -m unittest discover\n\nWith coverage:\n\n    coverage run --source gif_for_cli -m unittest discover\n    coverage report -m\n\n## Development\n\nTo reuse the shared Git hooks in this repo, run:\n\n    git config core.hooksPath git-hooks\n\n## Troubleshooting\n\nIf you get an error like the following:\n\n    -bash: gif-for-cli: command not found\n\nChances are gif-for-cli was installed in a location not on your `PATH`. This can happen if running `gif-for-cli` in your `.bashrc`, but it was installed into `~/.local/bin`, and that directory hasn't been added to your `PATH`. You can either specify the full path to gif-for-cli to run it, or add its location to your $PATH.\n\n## Some of our Favorites\n\n    gif-for-cli 10988977\n    gif-for-cli 5863633\n    gif-for-cli 5437241\n\n## Module Usage\n\nTo add gifs to your cli tool include `gif-for-cli` import and call execute.\n\n```python\nimport os\nimport sys\n\nfrom gif_for_cli.execute import execute\n\nexecute(os.environ,\n    [\"https://tenor.com/view/yay-pokemon-pikachu-gif-8081211\"],\n    sys.stdout)\n```\n\n## Disclaimer\n\nThis is not an officially supported Google product.\n\n[tenor-home]: https://tenor.com/\n[tenor-gif-api]: https://tenor.com/gifapi\n","funding_links":[],"categories":["Python","Python (144)","cli","Softwares 💻","Table of Contents","\u003ca name=\"graphics\"\u003e\u003c/a\u003eGraphics"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgif-for-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fgif-for-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgif-for-cli/lists"}