#quote #command-line #rust #wikiquote

bin+lib getquotes

A simple cli tool to get quotes in your terminal using WikiQuotes

21 releases (4 breaking)

Uses new Rust 2024

new 0.5.1 Apr 27, 2025
0.5.0 Apr 27, 2025
0.4.0 Apr 13, 2025
0.3.7 Feb 26, 2025
0.1.2 Jan 17, 2025

#27 in #quote

Download history 52/week @ 2025-01-08 910/week @ 2025-01-15 10/week @ 2025-01-22 406/week @ 2025-01-29 52/week @ 2025-02-05 5/week @ 2025-02-12 136/week @ 2025-02-19 157/week @ 2025-02-26 6/week @ 2025-03-05 106/week @ 2025-04-09 17/week @ 2025-04-16

123 downloads per month

MIT license

64KB
1K SLoC

Rust 726 SLoC // 0.0% comments BASH 87 SLoC Shell 67 SLoC // 0.2% comments Pacman's makepkg 59 SLoC // 0.2% comments PowerShell 49 SLoC // 0.6% comments Elvish 46 SLoC Nushell 20 SLoC

📜 getquotes

Fetch Inspirational Quotes from the Command Line 🚀

License GitHub issues GitHub stars Last commit Repo size GitHub Release

getquotes is a powerful command-line tool written in Rust that fetches and displays inspirational quotes directly from Wikiquote. Whether you're looking for motivation, wisdom, or just a quick pick-me-up, GetQuotes has got you covered. 🌟

📖 Table of contents


🚀 Features

  • Fetch Quotes: Get random quotes from Wikiquote. 📜
  • Custom Authors: Specify authors to fetch quotes from. 🖋️
  • Rainbow Mode: Display quotes in random colors. 🌈
  • Offline Mode: Use cached quotes when offline. 📴
  • Configurable: Customize theme color, log file, and more via a TOML configuration file. 🛠️
  • Lightweight: Fast and efficient, written in Rust. ⚡

📥 Installation

Repository Command To Install Version
Crates.io cargo install getquotes Crates.io
AUR yay -S getquotes AUR
AUR (Git) yay -S getquotes-git AUR
Homebrew brew install MuntasirSZN/programs/getquotes Homebrew

[!Note] You can install getquotes from the AUR using yay or paru, or any other AUR helper.

Manual Installation

You can clone the repository and build it from source:

git clone https://github.com/MuntasirSZN/getquotes.git
cd getquotes
cargo build --release

Then, copy the binary to your PATH:

cp target/release/getquotes /usr/local/bin

Manpages are included in the repository and can be installed using:

sudo cp man/getquotes.1 /usr/share/man/man1
sudo mandb # To update the manpage database

If you are on windows, you can use the ps1xml file, which is a like a manpage for windows powershell. Use the Get-Help command to view the manpage.

copy .\man\getquotes.ps1xml $env:PSModulePath\getquotes.ps1xml
Get-Help getquotes

[!Important] If you are building for android from source, you need the Android NDK installed and the ANDROID_NDK_HOME environment variable set to the NDK path.


🧭 Configuration

getquotes can be configured using a TOML configuration file. The configuration file should adhere to the schema defined in config.schema.toml, which can be validated using Taplo. Here's an example of a configuration file:

# List of authors to fetch quotes from
authors = [
    "Albert Einstein",
    "Isaac Newton"
]

# Theme color in hex format
theme_color = "#FF5733"

# Maximum number of attempts to fetch a quote
max_tries = 50

# Log file path
log_file = "custom_getquotes.log"

# Enable rainbow mode for random colors
rainbow_mode = false

Properties

  • authors: An array of author names to fetch quotes from. At least one author must be specified.
  • theme_color: A hex color code (with or without a leading #) for theming the output.
  • max_tries: The maximum number of attempts to find a quote (between 1 and 100, default is 30).
  • log_file: The path to the log file (default is "getquotes.log").

💡 Usage

A simple cli tool to get quotes in your terminal using WikiQuotes

Usage: getquotes [OPTIONS]

Options:
  -a, --authors <AUTHORS>          Specify a list of authors to fetch quotes from
  -t, --theme-color <THEME_COLOR>  Set the theme color for the displayed quotes
  -m, --max-tries <MAX_TRIES>      Set the maximum number of tries to fetch a quote
  -l, --log-file <LOG_FILE>        Specify the log file path
  -r, --rainbow-mode               Enable rainbow mode for random quote colors
  -i, --init-cache                 Initialize the quote cache for offline mode
  -o, --offline                    Run in offline mode, using cached quotes
  -v, --version                    Print version information
  -C, --config <CONFIG>            Use a custom TOML configuration file
  -c, --completion <COMPLETION>    Generate shell completion script [possible values: bash, elvish, fish, powershell, zsh, nushell]
  -M, --migrate-config             Migrate JSON config to TOML format (will be removed in next major release)
  -h, --help                       Print help

MuntasirSZN <muntasir.joypurhat@gmail.com>

🤝 Contributing

We welcome contributions from the community! If you'd like to contribute, please follow these steps:

  1. Fork the repository. 🍴
  2. Create a new branch. 🌿
  3. Make your changes. ✏️
  4. Submit a pull request. 🚀

Please make sure to follow our Code of Conduct and Contribution Guidelines.

Configuration Schema

The configuration schema is defined in config.schema.toml. Any contributions affecting the configuration should update this schema accordingly.


📜 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

  • Wikiquote: For providing the quotes. 📖
  • Rust Community: For the amazing ecosystem and tools. 🦀
  • Inspiration: This project was inspired by the need for a simple, daily dose of inspiration. 🌟

🌟 Show Your Support

If you find this project useful, please give it a ⭐️ on GitHub!

Dependencies

~37–51MB
~1M SLoC