Create your own stories together β Dungeons & Dragons is a collaborative way to bring out your imagination offline or online.
A comprehensive command-line interface tool for Dungeons & Dragons 5th Edition game masters and players. Built with functional programming principles for reliability and maintainability.
- Character Generator: Create new player characters with randomly generated stats
- NPC Generator: Generate detailed NPCs with personalities, backgrounds, and motivations
- Initiative Tracker: Manage combat turns and track initiative order with multiple tracking modes
- Dice Roller: Roll any combination of dice with modifiers (e.g., 2d6+3)
- Loot Generator: Generate treasure hoards and magic items appropriate for any challenge rating
- Weather Generator: Create realistic weather conditions for different climates and seasons
- Tarokka Reading: Perform card readings using the Tarokka deck (standard and custom readings)
- Wild Magic Effects: Generate Wild Magic Surge effects with various trigger methods (Standard, Escalating, Spell-Level, Critical)
# Clone the repository
git clone https://github.com/bittricky/dnd-cli.git
# Install dependencies
cd dnd-cli
npm install
# Link for development
npm link# Start the interactive CLI
dnd-cli
# Or use the shorter alias
dndGenerate a new player character with random stats:
- Rolls ability scores using 4d6 drop lowest
- Calculates ability modifiers
- Generates basic character stats
- Saves character sheets for future reference
Create detailed NPCs with:
- Personality traits, ideals, bonds, and flaws
- Physical appearance and mannerisms
- Background and occupation
- Motivations and goals
- Save NPC details for future use
Roll any combination of dice:
- Supports standard dice (d4, d6, d8, d10, d12, d20, d100)
- Add/subtract modifiers
- Roll with advantage/disadvantage
- Roll multiple dice at once
Generate treasure appropriate for any challenge rating:
- Individual treasure drops
- Hoard treasure
- Magic items by rarity
- Calculate total value in gold
Track combat with multiple variants:
- Standard: Traditional d20 + DEX modifier
- Advantage: Support for features like Alert feat
- Group: Roll once for each type of creature
- Speed Factor: Modified initiative based on action type and weapon size Features include:
- Add/remove combatants dynamically
- Track conditions and durations
- Automatic condition cleanup
- Combat round management
Create weather conditions with:
- Temperature based on climate and season
- Precipitation and wind conditions
- Special weather events
- Seasonal effects
Perform card readings using the Tarokka deck:
- Full readings with High and Common decks
- Custom table support
- Save and load custom card meanings
- Multiple reading types (single card, three-card spread, full reading)
Generate Wild Magic Surge effects with multiple trigger methods:
- Standard: Classic 1-in-20 chance
- Escalating: Increasing probability after each non-surge
- Spell-Level: Surge chance based on spell level
- Critical: Surge on natural 1s or 20s Features include:
- PHB and Tasha's Cauldron effects
- Custom effect table support
- Surge tracking and statistics
- Save and load custom tables
The project follows functional programming principles:
- Pure functions for predictable behavior
- Immutable state management
- Clear separation of concerns
- Modular command structure
dnd-cli/
βββ src/
β βββ commands/ # Individual command implementations
β βββ data/ # Game data and tables
β βββ menu.js # Main menu interface
βββ test/ # Test files
βββ utils/ # Utility files
βββ custom-tables/ # User-created custom tables (gitignored)
This project follows the Trunk Based Development workflow.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Write tests for your changes
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Playing Dungeons and Dragons (D&D) at any age provides a holistic therapeutic experience that benefits emotional, social, and cognitive well-being along side a healthy amount of physical exercise, if traditional sports aren't your thing.
Below is a summary of some of the key advantages:
- Self-Expression and Emotional Regulation: Role-playing and improvisation provide a safe space for individuals to explore different aspects of their personality, allowing them to tap into various traits and emotions outside the games setting even to the extent where they could recognize those traits in others broadening their perspective. This practice fosters emotional resilience by offering a creative outlet for self-expression and stress relief.
- Confidence Building: Making decisions and solving challenges within the game fosters a sense of accomplishment and self-assurance.
- Stress Reduction: The immersive, creative nature of the game provides healthy escapism, helping to alleviate daily stressors.
- Improved Social Skills: Encourages teamwork, communication, and empathy, offering a structured way to practice these essential interpersonal abilities as you explore different situations of morality.
- Community and Belonging: Playing in a group fosters connection and reduces feelings of loneliness, creating a sense of camaraderie and mutual support.
- Conflict Resolution: Engaging in cooperative storytelling enhances the ability to navigate disagreements constructively.
- Problem-Solving and Strategic Thinking: Players are required to think critically, plan, and adapt, strengthening cognitive flexibility.
- Creativity: Storytelling and character development stimulate imagination, fostering mental flexibility and innovation.
- Enhanced Executive Function: Keeping track of character stats, planning strategies, and solving puzzles bolster memory and focus.
D&D is particularly effective for people managing mental health challenges such as anxiety, trauma, or any other medically recognized form of neurodivergence. It provides:
- A judgment-free space to process emotions and develop coping strategies.
- A sense of empowerment and control through character-driven narratives.
- A growing community to connect with others.
- Opportunities to practice real-world skills in a low-pressure, stress-free, and imaginative environment that can be applied in a real-life setting.
- Narrative Therapy and Mental Health: Studies like the (Blackmon, 2016; Rosselet & Stauffer, 2013) show that role-playing games can empower individuals and build emotional resilience.
- Mental Health and Community: Research from University College Cork (UCC) highlights D&D's role in fostering mental health through creativity, escapism, and social connection.
- Therapeutic Applications: As detailed by Therapy Unlocked, D&D offers structured opportunities for emotional exploration, social bonding, and personal growth.
- Drama Therapy also acknowledges D&D's therapeutic potential, highlighting its ability to foster empathy, creativity, and self-awareness.
D&D provides a unique and engaging way for people to address their emotional, social, and cognitive needs. Its provides a combination of storytelling, strategy, and collaboration that creates a powerful tool for personal growth, development of skills to support positive mental health, and opportunities to foster meaningful connections. Math and Science are very important, but sometimes the arts are just as important. It is also just nice to not look at a screen.
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is a fan-made project and is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC. Dungeons & Dragons are trademarks of Wizards of the Coast LLC. In addition, if you are experiencing mental health challenges of any kind please seek out professional medical help from a certified provider who can guide you through the healing process.