XKCD ASCII Viewer is a simple script that lets you view daily xkcd webcomics as ASCII art directly in your terminal. This idea was inspired by the feature of xkcd.com where a new comic is showcased every day. Now, there's no need to visit the xkcd website — just open your terminal and enjoy the latest comic in ASCII art.
PS: Growing up reading What If? by Randall Munroe , I developed a deep fascination for physics and computer science. I never imagined that one day I’d create a shell script to interact with xkcd comics. I can't even put into words how happy this makes me XD
![]() |
![]() |
![]() |
![]() ![]() |
- Daily xkcd Comics: Automatically fetches the latest comic from the xkcd website.
- ASCII Art: Converts the comic into a readable and nostalgic ASCII art format.
To use xkcd ASCII Viewer, you must have the following installed:
-
ascii-image-converter
- This tool is essential for converting images to ASCII art.
- Install it using Homebrew
brew install TheZoraiz/ascii-image-converter/ascii-image-converter
-
curl (for fetching the comic data).
-
Clone the repository:
git clone https://github.com/clicelee/xkcd-ascii-viewer.git cd xkcd-ascii-viewer
-
Run the install script:
chmod +x install.sh ./install.sh
-
Done! You can now run
xkcd-ascii-viewer
from anywhere in your terminal.
To view the latest �xkcd comic:
xkcd-ascii-viewer
This command fetches the comic, converts it to ASCII art, and displays it in your terminal.
- The script fetches the latest comic from the xkcd website.
- It downloads the image and converts it to ASCII art using
ascii-image-converter
with the following options:-b
: Removes the background.-n
: Displays in black and white.-H 50
: Sets the height of the output to 50 lines.--threshold 120
: Adjusts the brightness threshold for ASCII conversion.
If you encounter issues:
-
Ensure
ascii-image-converter
is installed:brew install TheZoraiz/ascii-image-converter/ascii-image-converter
-
Check if
curl
is installed:curl --version
-
Ensure you have internet access to fetch the comic.
Feel free to submit pull requests or open issues to improve this project :)
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy the daily dose of humor and creativity from xkcd, right in your terminal!