Quick Reference
Installation & Setup
Section titled “Installation & Setup”Install Plugin
Section titled “Install Plugin”// ~/.config/opencode/opencode.json or .opencode/opencode.json{ "$schema": "https://opencode.ai/config.json", "plugin": ["@pantheon-ai/opencode-warcraft-notifications"]}Configure Faction
Section titled “Configure Faction”// ~/.config/opencode/plugin.json or .opencode/plugin.json{ "@pantheon-ai/opencode-warcraft-notifications": { "faction": "alliance" // or "horde" or "both" }}Custom Sound Directory
Section titled “Custom Sound Directory”{ "@pantheon-ai/opencode-warcraft-notifications": { "soundsDir": "/custom/path/to/sounds", "faction": "both" }}Common Commands
Section titled “Common Commands”Development
Section titled “Development”# Install dependenciesbun install
# Run testsbun test
# Run tests with coveragebun test --coverage
# Watch modebun test --watch
# Type checkingbun run type-check
# Lintingbun run lint
# Format codebun run format
# Check formattingbun run format:check
# Clean build artifactsbun run clean
# Buildbun run build
# Development modebun run devTesting Specific Modules
Section titled “Testing Specific Modules”# Test specific filebun test src/sounds.test.ts
# Test with patternbun test --test-name-pattern="faction"
# Verbose outputbun run test:verboseDocumentation
Section titled “Documentation”# Navigate to docs directorycd docs
# Install dependenciesbun install
# Start dev serverbun run dev
# Build documentationbun run build
# Preview buildbun run previewFile Locations
Section titled “File Locations”Configuration Files
Section titled “Configuration Files”| File | Location | Purpose |
|---|---|---|
| OpenCode Config | ~/.config/opencode/opencode.json | Global OpenCode configuration |
| Plugin Config | ~/.config/opencode/plugin.json | Global plugin configuration |
| Project OpenCode Config | .opencode/opencode.json | Project-specific OpenCode config |
| Project Plugin Config | .opencode/plugin.json | Project-specific plugin config |
Data Directories
Section titled “Data Directories”| Platform | Default Location |
|---|---|
| macOS | ~/Library/Application Support/opencode/storage/plugin/opencode-warcraft-notifications/sounds/ |
| Linux | ~/.local/share/opencode/storage/plugin/opencode-warcraft-notifications/sounds/ |
| Windows | %APPDATA%\opencode\storage\plugin\opencode-warcraft-notifications\ |
Sound Files
Section titled “Sound Files”<data-directory>/├── alliance/│ ├── human_selected1.wav│ ├── human_acknowledge1.wav│ ├── elf_selected1.wav│ ├── dwarf_selected1.wav│ ├── knight_selected1.wav│ ├── mage_selected1.wav│ ├── peasant_selected1.wav│ ├── ship_selected1.wav│ ├── work_completed.wav│ └── jobs_done.wav└── horde/ ├── orc_selected1.wav ├── orc_acknowledge1.wav ├── death_knight_selected1.wav ├── dragon_selected1.wav ├── goblin_sapper_selected1.wav ├── ogre_selected1.wav ├── ogre_mage_selected1.wav ├── troll_selected1.wav ├── horde_ship_selected1.wav └── orc_work_completed.wavEnvironment Variables
Section titled “Environment Variables”| Variable | Purpose | Default |
|---|---|---|
DEBUG_OPENCODE | Enable debug logging | false |
SOUNDS_DATA_DIR | Override data directory | Platform-specific |
SOUNDS_BASE_URL | Legacy: Base URL for downloads | N/A (bundled) |
# Enable debug modeDEBUG_OPENCODE=1 opencode
# Custom data directorySOUNDS_DATA_DIR=/custom/path opencodeAPI Quick Reference
Section titled “API Quick Reference”Sound Selection
Section titled “Sound Selection”import { getRandomSoundPathFromFaction } from './sounds.js';
// Get random sound from factionconst soundPath = getRandomSoundPathFromFaction('alliance');// Returns: '/path/to/data/alliance/human_selected1.wav'
// Get random sound from both factionsconst anySoundPath = getRandomSoundPathFromFaction('both');Configuration
Section titled “Configuration”import { loadPluginConfig } from './plugin-config.js';
// Load plugin configurationconst config = await loadPluginConfig('@pantheon-ai/opencode-warcraft-notifications');// Returns: { faction?: 'alliance' | 'horde' | 'both', soundsDir?: string }Sound Validation
Section titled “Sound Validation”import { soundExists } from './sounds.js';
// Check if sound existsconst exists = await soundExists('human_selected1.wav', 'alliance');// Returns: booleanBundled Sounds
Section titled “Bundled Sounds”import { installBundledSoundsIfMissing } from './bundled-sounds.js';
// Install bundled sounds if missingawait installBundledSoundsIfMissing('/custom/data/dir');Configuration Schema
Section titled “Configuration Schema”Full Configuration Example
Section titled “Full Configuration Example”{ "@pantheon-ai/opencode-warcraft-notifications": { "faction": "both", "soundsDir": "/custom/path/to/sounds" }}Schema Definition
Section titled “Schema Definition”interface WarcraftNotificationConfig { /** Which faction sounds to use */ faction?: 'alliance' | 'horde' | 'both';
/** Custom directory for sound files */ soundsDir?: string;}Validation
Section titled “Validation”Configuration is validated using Zod:
const WarcraftNotificationConfigSchema = z.object({ soundsDir: z.string().optional(), faction: z.enum(['alliance', 'horde', 'both']).optional(),});Troubleshooting Quick Fixes
Section titled “Troubleshooting Quick Fixes”No Sound Playing
Section titled “No Sound Playing”# Check sound files existls -la ~/.local/share/opencode/storage/plugin/opencode-warcraft-notifications/sounds/
# Reinstall plugincd ~ && sed -i.bak '/"@pantheon-ai\/opencode-warcraft-notifications"/d' .cache/opencode/package.jsonrm -rf .cache/opencode/node_modules/@pantheon-ai/opencode-warcraft-notificationsopencodeConfiguration Not Working
Section titled “Configuration Not Working”# Verify configuration filecat ~/.config/opencode/plugin.json
# Check for validation errorsDEBUG_OPENCODE=1 opencodemacOS Audio Issues
Section titled “macOS Audio Issues”# Test audio manuallyafplay /System/Library/Sounds/Glass.aiff
# Check permissionsls -la ~/Library/Application\ Support/opencode/Linux Audio Issues
Section titled “Linux Audio Issues”# Test audio manuallycanberra-gtk-play --id=message
# Install audio tools if missingsudo apt-get install libcanberra-gtk-modulePlatform-Specific Commands
Section titled “Platform-Specific Commands”# Play soundafplay /path/to/sound.wav
# Show notificationosascript -e 'display notification "message" with title "title"'
# Check data directoryls -la ~/Library/Application\ Support/opencode/storage/plugin/opencode-warcraft-notifications/sounds/# Play soundcanberra-gtk-play --id=message
# Show notificationnotify-send 'title' 'message'
# Check data directoryls -la ~/.local/share/opencode/storage/plugin/opencode-warcraft-notifications/sounds/Git Workflow
Section titled “Git Workflow”Create Feature Branch
Section titled “Create Feature Branch”git checkout maingit pull upstream maingit checkout -b feature/your-feature-nameCommit Changes
Section titled “Commit Changes”# Stage changesgit add .
# Commit with conventional commit messagegit commit -m "feat(sounds): add rare sound category"
# Push to forkgit push origin feature/your-feature-nameConventional Commit Types
Section titled “Conventional Commit Types”feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test changeschore: Maintenance tasksperf: Performance improvements
CI/CD Quick Reference
Section titled “CI/CD Quick Reference”Workflows
Section titled “Workflows”| Workflow | Trigger | Purpose |
|---|---|---|
| PR Validation | Pull request | Run tests and linting |
| Smart Version Bump | Push to main | Determine version bump |
| Release & Publish | Version bump PR merged | Create release and publish |
| Auto-Merge Bot | PR approved | Auto-merge approved PRs |
| Cleanup Merged Branches | Branch merged | Delete merged branches |
| Cleanup Old Releases | Schedule | Remove old releases |
| Deploy Docs | Push to main | Deploy documentation |
Manual Workflow Triggers
Section titled “Manual Workflow Triggers”# Trigger workflow manually (GitHub CLI)gh workflow run smart-version-bump.yml
# View workflow runsgh run list
# View workflow detailsgh run view <run-id>Useful Links
Section titled “Useful Links”Documentation
Section titled “Documentation”- Home - Project overview
- User Guide - Installation and usage
- Development Guide - Development setup
- API Documentation - API reference
- Architecture - System design
- Troubleshooting - Common issues
External Resources
Section titled “External Resources”Keyboard Shortcuts (Documentation Site)
Section titled “Keyboard Shortcuts (Documentation Site)”| Shortcut | Action |
|---|---|
/ | Focus search |
Ctrl/Cmd + K | Open command palette |
Esc | Close search/modals |
“Work complete!” - Warcraft II Peasant
”Zug zug!” - Warcraft II Orc
Last Updated: 2025-11-11