npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-discord-rpc

v1.0.1

Published

Discord Rich Presence plugin for OpenCode - Show your coding activity in Discord

Downloads

20

Readme

opencode-discord-rpc

Discord Rich Presence plugin for OpenCode - Show your AI-assisted coding activity in Discord!

Discord Rich Presence Preview

Features

  • Shows your current AI model being used (GPT-4, Claude, etc.)
  • Displays session duration (elapsed time)
  • Shows activity status (Coding/Idle/Thinking)
  • Clickable button to visit OpenCode.ai
  • Auto-reconnects if Discord restarts
  • Zero configuration needed

Installation

Add the plugin to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-discord-rpc"]
}

For global installation, add it to ~/.config/opencode/opencode.json.

That's it! Restart OpenCode and your Discord Rich Presence will appear.

How It Works

Once installed, the plugin automatically:

  1. Connects to Discord when OpenCode starts
  2. Displays your current activity in Discord's Rich Presence
  3. Updates in real-time as you code:
    • Coding... - When tools are executing or you're actively working
    • Thinking... - When the AI is generating a response
    • Waiting for input... - When the session is waiting for your input
    • Idle - When no session is active

Rich Presence Display

┌─────────────────────────────────────────┐
│ [OpenCode Logo]                         │
│                                         │
│ Using gpt-4o                            │
│ Coding...                               │
│ 01:23:45 elapsed                        │
│                                         │
│ [ Visit OpenCode.ai ]                   │
└─────────────────────────────────────────┘

Configuration

The plugin works out of the box with no configuration needed.

For advanced users, you can customize behavior with environment variables:

| Variable | Description | Default | |----------|-------------|---------| | OPENCODE_DISCORD_ENABLED | Set to "false" to disable | "true" | | OPENCODE_DISCORD_CLIENT_ID | Use your own Discord Application | Built-in | | OPENCODE_DISCORD_RETRY_INTERVAL | Reconnect interval (ms) | 15000 | | OPENCODE_DISCORD_MAX_RETRIES | Max reconnection attempts | 5 |

Requirements

  • OpenCode v1.0+
  • Discord Desktop App (must be running)

Troubleshooting

Rich Presence not showing

  1. Make sure Discord is running - The desktop app must be open
  2. Check Activity Status is enabled - In Discord Settings > Activity Privacy, ensure "Display current activity as a status message" is ON
  3. Restart OpenCode - The plugin connects on startup

Connection errors in logs

The plugin will automatically retry if Discord isn't available. Common messages:

  • "Discord is not running or not accessible" - Discord desktop app is closed
  • "Max retry attempts reached" - Discord wasn't found after multiple attempts; restart OpenCode when Discord is running

Privacy

This plugin does not display:

  • Your project name or path
  • File names or contents
  • Any code or conversation content

It only shows:

  • The AI model being used
  • Your activity status
  • How long the session has been active

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

# Clone the repository
git clone https://github.com/phoenixak/opencode-discord-rpc.git
cd opencode-discord-rpc

# Install dependencies
npm install

# Build
npm run build

# Watch mode for development
npm run dev

License

MIT License - see LICENSE for details.

Credits