| Crates.io | tarot |
| lib.rs | tarot |
| version | 0.4.0 |
| created_at | 2025-12-02 02:57:30.838235+00 |
| updated_at | 2025-12-02 02:57:30.838235+00 |
| description | A command-line tarot card reading application |
| homepage | |
| repository | https://gitlab.com/dump-stuff/tarot |
| max_upload_size | |
| id | 1961060 |
| size | 91,600 |
A beautiful command-line tarot card reading application written in Rust. Draw random tarot cards and receive mystical insights with colorful, formatted output.
git clone https://gitlab.com/dump-stuff/tarot.git
cd tarot
cargo build --release
cargo run
# Draw a random tarot card with beautiful formatting
tarot
# Example output:
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โฆ TAROT CARD READING โฆ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# Card: The Fool
# Type: Major Arcana
# Position: Upright
# Meaning: Folly, mania, extravagance, intoxication, delirium, frenzy, bewrayment
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Flag | Short | Description |
|---|---|---|
--help |
-h |
Show help message and usage information |
--version |
-v |
Display version information |
--json |
-j |
Output reading in JSON format |
--number |
-n |
Set the number of cards to draw (default: 1) |
# Show help
tarot --help
# Show version
tarot --version
# Get JSON output for programmatic use
tarot --json
# Draw 3 cards
tarot --number 3
# Short flags work too
tarot -h
tarot -v
tarot -j
tarot -n 5
Complete set of Major Arcana cards with detailed meanings:
Four suits with 14 cards each:
Each suit contains: Ace, 2-10, Page, Knight, Queen, King
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_get_tarot_meaning_valid_card
This project includes a comprehensive GitLab CI/CD pipeline (.gitlab-ci.yml) that:
tarot/
โโโ src/
โ โโโ main.rs # Main application code
โโโ cards.json # Tarot card meanings data
โโโ .gitlab-ci.yml # GitLab CI/CD pipeline configuration
โโโ Cargo.toml # Dependencies and metadata
โโโ Cargo.lock # Dependency lock file
โโโ README.md # This file
โโโ target/ # Build artifacts
rand = "0.8" - Random number generation for card drawingcolored = "2.0" - Terminal color and stylingserde = "1.0" - Serialization frameworkserde_json = "1.0" - JSON serialization supportonce_cell = "1.19.0" - Lazy initialization of static dataThe project includes comprehensive tests covering:
Run cargo test to execute the full test suite.
get_tarot_meaning(card_name: &str) -> Result<CardMeaning, String>Retrieves the meaning for a specific tarot card.
draw_random_tarot_cards(count: usize) -> Vec<(String, &'static str)>Draws a specified number of unique random cards from the full 78-card deck.
CardMeaningpub struct CardMeaning {
pub upright: String,
pub reversed: String,
}
TarotReading (JSON output)struct TarotReading {
card: String,
arcana_type: String,
position: String,
meaning: String,
}
# Get a daily reading in JSON format
READING=$(tarot --json)
echo "Today's card: $(echo $READING | jq -r '.card')"
tarot -n 2 --json)[
{
"card": "The Fool",
"arcana_type": "Major Arcana",
"position": "Upright",
"meaning": "Folly, mania, extravagance, intoxication, delirium, frenzy, bewrayment"
},
{
"card": "Three of Cups",
"arcana_type": "Minor Arcana",
"position": "Reversed",
"meaning": "Independence, alone time, hardcore partying"
}
]
git checkout -b feature/amazing-feature)cargo test)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
What this means:
This license ensures the software remains free and open source while preventing proprietary commercialization.
colored crate"The cards don't lie, but they do speak in riddles." ๐ฎ