Skip to content

Add tarot command and MCP tool for Major Arcana draws#7

Merged
fluo10 merged 1 commit intomainfrom
feat/tarot
Mar 14, 2026
Merged

Add tarot command and MCP tool for Major Arcana draws#7
fluo10 merged 1 commit intomainfrom
feat/tarot

Conversation

@fluo10
Copy link
Owner

@fluo10 fluo10 commented Mar 14, 2026

Summary

  • Implements tryluck tarot [N] CLI command that draws N cards (without replacement) from the 22 Major Arcana, each with a random upright/reversed orientation
  • Adds --json flag for structured {"card", "orientation"} output aimed at AI/MCP consumers (defaults to snake_case card names for tokenizer friendliness)
  • Adds --case snake|proper flag to control card name formatting in all output modes (plain text defaults to proper case, e.g. The Fool; --json defaults to snake_case, e.g. the_fool)
  • Reversed cards in plain text mode are displayed as reversed characters (e.g. looF ehT), matching the existing CLI convention
  • Exposes a tarot MCP tool returning the same structured JSON, snake_case by default with optional case: "proper" parameter

Test plan

  • tryluck tarot 3 — prints 3 unique Major Arcana cards in proper case; reversed cards appear as reversed text
  • tryluck tarot 3 --case snake — same but snake_case names
  • tryluck tarot 3 --json — JSON array with snake_case card names and "upright" / "reversed" orientations
  • tryluck tarot 3 --json --case proper — JSON array with proper-case card names
  • tryluck tarot 22 — all 22 cards drawn, no duplicates
  • MCP tarot tool — returns correct JSON via stdio transport

🤖 Generated with Claude Code

Implements the `tryluck tarot` CLI command and a corresponding MCP tool
that draws cards from the 22 Major Arcana without replacement, with
upright/reversed orientation for each card.

- Add `src/commands/tarot.rs` with card data, `draw()`, and `run()`
- CLI: `tryluck tarot [N]` prints proper-case names by default (e.g. "The Fool");
  reversed cards are shown as reversed characters (e.g. "looF ehT")
- CLI: `--json` outputs a JSON array of `{card, orientation}` objects,
  defaulting to snake_case names for AI/tokenizer friendliness
- CLI: `--case snake|proper` overrides the name format in any output mode
- MCP: new `tarot` tool returning the same structured JSON (snake_case default)
- Add `serde_json` dependency for CLI JSON serialization

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fluo10 fluo10 merged commit c60ea6c into main Mar 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant