A simple CLI application to download and display xkcd comics.
Used urfave/cli for the cli magic.
{% alert(fact=true) %}
I originally planned to use cobra for this project. However, on the day I started development, a dependency of cobra was down (the developer was hosting it on a private server), preventing me from downloading it. So, I started with urfave/cli instead.
{% end %}
Usage
Display Command
Display the latest comic using your system's default image viewer:
xkcd-cli display latest
Display a specific comic by number:
xkcd-cli display 42
Display a random comic:
xkcd-cli display random
Get Command
Download the latest comic to the current directory:
xkcd-cli get latest
Download a specific comic:
xkcd-cli get 42
Download a random comic:
xkcd-cli get random
Installation
Prebuilt Binaries
Download the binary for your system in Releases Page
Install via Go
go install github.com/AliGaygisiz/xkcd-cli@latest
Build from Source
git clone https://github.com/AliGaygisiz/xkcd-cli.git
cd xkcd-cli
go build .
To install the binary to your $GOPATH/bin:
go install .