Conversation
Implements `tryluck dice` for rolling dice via CLI and MCP.
- Accepts dice notation (e.g. 3d10, d6+2, 2d8-1) or plain count as a positional argument
- `-d`/`--sides` and `-m`/`--modifier` flags for explicit CLI-style control
- Modifier implies sum output: returns `{"rolls": [...], "total": N}` as JSON
- `--sum` flag to force total output even without a modifier
- Default: 1d6, plain array output (consistent with coin and tarot)
- MCP tool with `notation`, `count`, `sides`, `modifier`, `sum` parameters
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dice notation (containing 'd', e.g. 3d10, d6+2) now always shows the total without requiring --sum, matching TRPG conventions. Plain count (e.g. `dice 3`) still returns individual rolls only. 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 dicecommand for rolling dice via CLI and MCP3d10,d6+2,2d8-1) as a positional argument, as well as CLI-style flags (-d/--sides,-m/--modifier)d) always shows{"rolls": [...], "total": N}; plain count returns a plain array (consistent withcoinandtarot)--sumflag or non-zero modifier also triggers total outputnotation,count,sides,modifier, andsumparametersTest plan
tryluck dice→ single d6 roll, plain valuetryluck dice 3→ three d6 rolls, plain arraytryluck dice 3d10→ three d10 rolls +Total:(notation implies total)tryluck dice d6→ single d6 roll +Total:(notation implies total)tryluck dice d20+5→ one d20 roll with modifier +Total:tryluck dice 2d6 -m 3→ two d6 rolls with modifier via flag +Total:tryluck dice 3d10 --json→{"rolls": [...], "total": N}tryluck dice 3 --sum --json→{"rolls": [...], "total": N}tryluck dice 3 -d 10→ three d10 rolls, plain array (CLI flags, no notation)dicetool withnotationparameter → total includeddicetool with explicitcount/sidesonly → plain array🤖 Generated with Claude Code