Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krish-r/xkcd-cli
A simple CLI to download xkcd comics.
https://github.com/krish-r/xkcd-cli
cli rust
Last synced: about 2 months ago
JSON representation
A simple CLI to download xkcd comics.
- Host: GitHub
- URL: https://github.com/krish-r/xkcd-cli
- Owner: krish-r
- License: mit
- Created: 2023-06-01T19:41:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-27T05:19:15.000Z (6 months ago)
- Last Synced: 2024-07-27T06:28:01.265Z (6 months ago)
- Topics: cli, rust
- Language: Rust
- Homepage:
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xkcd-cli
A simple CLI to download xkcd comics.
## Note
- I'm exploring the Rust language + libraries, so wanted to build something while learning.
- So you might -- see - `unwrap`'s, `expect`'s and `panic`'s instead of proper error handling in some places.
- not see - clean code or design patterns or full test coverage.- If you fancy one-liners, try this instead -
```sh
curl -sSL https://xkcd.com/info.0.json | jq '.img' | xargs curl -sSL --output "xkcd_$(date +%F).png"
```## Dependencies
- clap
- colored
- rand
- rand_chacha
- reqwest
- serde### Testing Dependencies
- assert_cmd
- insta
- predicates## Installation Instructions
```sh
# Clone the repository
git clone https://github.com/krish-r/xkcd-cli.git# Switch to the cloned directory
cd xkcd-cli# Try it without installing
cargo run -- [OPTIONS]
# For Ex.
# cargo run -- --latest
# cargo run -- --random
# cargo run -- --output="/tmp/xkcd.png"# or
# To install (the cargo bin directory `~/.cargo/bin` should be in your `$PATH`)
cargo install --path .```
## Uninstall instructions
```sh
rm -i $(which xkcd-cli)
```## Usage
```sh
xkcd-cli --help
``````sh
Usage: xkcd-cli [OPTIONS]Options:
-l, --latest latest
-r, --random random
-o, --output output
-h, --help Print help
```## Credits
- [xkcd][xkcd] - for the api.
[xkcd]: https://xkcd.com/