Add tarot command and MCP tool for Major Arcana draws#7
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tryluck tarot [N]CLI command that draws N cards (without replacement) from the 22 Major Arcana, each with a random upright/reversed orientation--jsonflag for structured{"card", "orientation"}output aimed at AI/MCP consumers (defaults to snake_case card names for tokenizer friendliness)--case snake|properflag to control card name formatting in all output modes (plain text defaults to proper case, e.g.The Fool;--jsondefaults to snake_case, e.g.the_fool)looF ehT), matching the existing CLI conventiontarotMCP tool returning the same structured JSON, snake_case by default with optionalcase: "proper"parameterTest plan
tryluck tarot 3— prints 3 unique Major Arcana cards in proper case; reversed cards appear as reversed texttryluck tarot 3 --case snake— same but snake_case namestryluck tarot 3 --json— JSON array with snake_case card names and"upright"/"reversed"orientationstryluck tarot 3 --json --case proper— JSON array with proper-case card namestryluck tarot 22— all 22 cards drawn, no duplicatestarottool — returns correct JSON via stdio transport🤖 Generated with Claude Code