Discord Rich Presence plugin for OpenCode - Display your current AI agent, model, and status in Discord
npm install opencode-discord-presence

한국어 | English
Display your current OpenCode session status in Discord Rich Presence. Show which AI agent you're using, the current model, session time, and more.
- Real-time agent display - Shows which AI agent (Claude, Prometheus, etc.) you're currently using
- Model information - Displays the active model (Claude Sonnet, GPT-4, etc.)
- Session time tracking - Shows how long you've been coding
- Korean language support - Proper Korean particle handling (을/를, 은/는)
- Idle detection - Automatically shows when you're taking a break
``bashUsing bun
bun add opencode-discord-presence
Quick Start
Add the plugin to your
opencode.json:`json
{
"plugins": ["opencode-discord-presence"]
}
`That's it! The plugin will automatically connect to Discord and display your session status.
Configuration
Create a
.discord-presence.json file in your home directory or project root:`json
{
"enabled": true,
"applicationId": "YOUR_DISCORD_APP_ID",
"language": "ko"
}
`Or use environment variables:
`bash
OPENCODE_DISCORD_ENABLED=true
OPENCODE_DISCORD_CLIENT_ID=YOUR_APP_ID
OPENCODE_DISCORD_LANGUAGE=ko
`$3
| Option | Type | Default | Description |
|--------|------|---------|-------------|
|
enabled | boolean | true | Enable or disable the plugin |
| applicationId | string | (built-in) | Custom Discord Application ID for your own branding |
| language | string | "en" | Display language ("en" or "ko") |$3
1. Project directory:
.discord-presence.json
2. Home directory: ~/.discord-presence.json
3. Environment variablesCustom Discord Application
For custom branding (your own images and app name):
1. Go to Discord Developer Portal
2. Click "New Application" and give it a name
3. Go to "Rich Presence" → "Art Assets"
4. Upload your images (at least one named
opencode-logo)
5. Copy the Application ID from "General Information"
6. Add it to your config:`json
{
"discordPresence": {
"applicationId": "YOUR_APPLICATION_ID"
}
}
`How It Works
The plugin hooks into OpenCode's event system:
- chat.message - Updates presence when you send/receive messages, tracking the current agent and model
- event - Listens for session state changes (idle, active)
$3
| State | English | Korean | Description |
|-------|---------|--------|-------------|
| Active | "Working with Prometheus" | "Prometheus를 갈구는중" | You're actively coding with an agent |
| Idle | "Prometheus is idle" | "Prometheus는 휴식중" | Session is idle |
Korean particles (을/를, 은/는) are automatically selected based on whether the agent name ends with a consonant (받침).
Development
`bash
Install dependencies
bun installRun tests
bun testRun tests in watch mode
bun test --watchType check
bun run typecheckLint
bun run lintFormat
bun run formatBuild
bun run build
`Architecture
`
src/
├── index.ts # Main entry point & exports
├── plugin.ts # Core plugin implementation
├── config.ts # Configuration management
├── types/
│ └── index.ts # TypeScript type definitions
├── services/
│ └── discord-rpc.ts # Discord RPC service (singleton)
└── utils/
└── particle.ts # Korean particle handling (을/를, 은/는)
`Contributing
Contributions are welcome! Please read our Contributing Guide for details.
$3
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Run tests (bun test)
4. Commit your changes (git commit -m 'feat: add amazing feature')
5. Push to the branch (git push origin feature/amazing-feature`)MIT License - see LICENSE for details.
- OpenCode - The AI coding assistant this plugin extends
- @xhayper/discord-rpc - Discord RPC library used by this plugin
See CHANGELOG.md for release history.