A desktop application for tabletop gaming that parses and rolls on random tables using Perchance syntax.
- Perchance Table Parsing: Parse tables from markdown files using Perchance syntax
- Interactive Results: Click on subtable references in results to reroll just that part
- Subtable Resolution: Automatically resolve nested table references like
[encounter]
and[treasure]
- Spotlight Search: Fast table search with keyboard navigation and shortcuts
- Roll History: Track previous rolls with timestamps and easy rerolling
- Keyboard Shortcuts: Full keyboard navigation and quick actions
- Vault Management: Scan and manage collections of markdown files containing tables
- Cross-Platform: Built with Electron for Windows, macOS, and Linux
- Local Storage: Persistent storage of vault paths, table data, and user preferences
For most users, download the latest compiled version:
- GitHub Releases - Download for Windows, macOS, and Linux
- itch.io - Alternative download with community features
If you want to modify or contribute to Oracle:
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/script-wizards/oracle.git
cd oracle
# Install dependencies
npm install
# Run in development mode
npm run dev
- Click "load vault" in the header to choose a folder with markdown files
- The app will automatically scan and parse tables from your vault
- Use the search bar to find tables or browse the list
- Click on a table or press Enter to roll
- Click on bracketed text in results to reroll just that subtable
Try the examples: Load the examples/
folder included with Oracle to see interactive tables in action!
- Ctrl/Cmd + K: Focus search bar
- Ctrl/Cmd + L: Clear search
- Ctrl/Cmd + H: Toggle roll history
- ↑/↓ Arrow Keys: Navigate table list
- Enter: Roll selected table
- Esc: Clear selection and unfocus search
- Tab: Cycle through UI elements
- 1-9: Quick select tables (when search not focused)
- Click: Roll table or reroll subtable
- Mouse: Resize history panel by dragging the grip handle
- Spotlight-style search with real-time filtering
- Keyboard hints showing available shortcuts
- Result count and navigation indicators
- Interactive subtables: Click bracketed text like
[creature]
to reroll - Help tooltip: Hover over the ? icon for interaction tips
- Reroll entire result: Click anywhere else in the result box
- Chronological history with timestamps
- Resizable panel: Drag to adjust height
- Full interaction: Reroll entire results or individual subtables
- Toggle visibility: Use Ctrl+H or the header button
- Vault selector: Shows current vault name, click to change
- Refresh button: Rescan and reparse tables
- History toggle: Show/hide roll history
- Clear storage: Reset all data (with confirmation)
- ARCHITECTURE.md - Technical architecture and design patterns
- DEVELOPMENT.md - Development workflow and testing guide
Tables should be written in Perchance syntax within markdown code blocks:
```perchance
title
Forest Encounters
output
You encounter [encounter]
encounter
A pack of wolves
A wandering merchant
An ancient tree spirit
Bandits demanding toll
```
Tables can reference other sections or external tables:
```perchance
title
Minor Treasures
output
You find [treasure]
treasure
[gold] gold pieces
[gems]
[items]
gold
2d6
1d10+5
3d4
gems
A small ruby
An emerald shard
A polished sapphire
items
A masterwork dagger (+1 to hit)
A potion of healing
A scroll of magic missile
```
src/
├── main/ # Electron main process
├── renderer/ # React frontend
└── shared/ # Shared types and utilities
├── types.ts # TypeScript interfaces
└── utils/
├── PerchanceParser.ts # Table parsing logic
└── TableRoller.ts # Rolling and resolution logic
- Parses Perchance syntax from markdown code blocks
- Extracts table sections, entries, and subtable references
- Validates table structure and reports errors
- Rolls on tables with proper subtable resolution
- Supports both local section references and external table references
- Prevents infinite recursion with depth limits
interface Table {
id: string;
title: string;
entries: string[]; // Backward compatibility
sections?: TableSection[]; // Full section structure
subtables: string[];
filePath: string;
codeBlockIndex: number;
errors?: string[];
}
npm run dev
- Start development servernpm run build
- Build for productionnpm run dist
- Package for distributionnpm run lint
- Run ESLintnpm run test
- Run tests
- Main Process: Handles file system operations and window management
- Renderer Process: React-based UI for table management and rolling
- IPC Communication: Secure communication between main and renderer processes
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.