Skip to main content

Get your daily dose of xkcd directly from the terminal! 🤩

Project description

xkcd cli tool

Get your daily dose of xkcd directly from the terminal! 🤩

xkcd is a webcomic created by Randall Munroe. It is a comic of Language, Math, Romance and Sarcasm and a couple of other categories.

If kitty is used as the terminal, the xkcd comic will be rendered directly in the terminal, otherwise the default viewer for PNG images is used. This tool requires fzf to be installed on the machine to filter available comics by their title.

Installation

Install this package directly from the Python Package Index (PyPI). The CLI tool requires Python >= 3.8 to be installed.

$ pip install dcs-xkcd-cli

Usage

Search by title

$ xkcd show

This functionality requires fzf to be installed.

Show latest xkcd comic

$ xkcd show --latest

Show random xkcd comic

$ xkcd show --random

Show xkcd comic by its ID

$ xkcd show --comic-id 207

Enforce render optimizations for kitty terminal

$ xkcd show --use-kitty

Use this command if the auto-detection of the kitty terminal does not work as expected. Kitty is auto-detected by inspecting if the $TERM variable includes the term kitty.

By default the image is upscaled to the terminal width. Use the --no-kitty-scale-up flag to disable this feature if needed.

Disable or update cache

Under the hood this tool uses a cache which is updated once per day transparently. The cache is used to remember the list of xkcd comics from the archive.

To disable the cache, use the following command

$ xkcd show --no-cache

To update the cache manually, use the following command

$ xkcd update-cache

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

dcs-xkcd-cli-0.1.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

dcs_xkcd_cli-0.1.1-py3-none-any.whl (7.3 kB view hashes)

Uploaded Python 3

Supported by

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