Disunday
Control opencode from Discord. Say goodbye to Sundays—manage your AI coding projects 24/7 through Discord channels.
Install / Use
/learn @code-xhyun/DisundayREADME
Disunday is a Discord bot that lets you control OpenCode coding sessions from Discord. Send a message in a Discord channel → an AI agent edits code on your machine.
Using Claude Code? Check out sleep-code - a sibling project that brings the same Discord-controlled coding experience to Claude Code.
Fun fact: This project is being developed using Disunday itself - lying on a couch, controlling OpenCode through Discord on a phone.
Quick Start
npx disunday@latest
The CLI will guide you through:
- Creating a Discord bot at discord.com/developers
- Enabling required intents (Message Content, Server Members)
- Installing the bot to your server
- Linking project directories
AI Setup Prompt
Copy this prompt to your AI coding agent (Claude Code, Cursor, OpenCode, etc.):
Set up Disunday Discord bot for me by running `npx disunday@latest`.
The CLI will guide me through Discord bot setup, but help me with:
- Creating a Discord bot at https://discord.com/developers/applications
- Enabling "MESSAGE CONTENT INTENT" and "SERVER MEMBERS INTENT" in Bot settings
- Generating invite URL with Administrator permissions
- Getting the bot token
If any errors occur, help me troubleshoot.
Development Installation
For contributing or development:
git clone https://github.com/code-xhyun/disunday
cd disunday
pnpm install
cd discord && pnpm dev
What is Disunday?
Disunday connects Discord to OpenCode, a coding agent similar to Claude Code. Each Discord channel is linked to a project directory on your machine. When you send a message in that channel, Disunday starts an OpenCode session that can:
- Read and edit files
- Run terminal commands
- Search your codebase
Installation Options
| Method | Description | Recommended For |
| ------------------------------------------- | ------------------------ | ------------------------- |
| npx disunday | One command install | Most users |
| Development Install | git clone + pnpm dev | Contributors |
| Auto-Start | Auto-run on login | Always-on personal PC |
| Docker | Run in container | 24/7 server, VPS deploy |
Think of it as texting your codebase. You describe what you want, the AI does it.
Keep the CLI running. It's the bridge between Discord and your machine.
Auto-Start on Boot
Run the bot automatically when your computer starts:
./scripts/install-service.sh
macOS: Installs LaunchAgent (starts on login) Linux: Installs systemd user service
Service Commands
macOS:
launchctl start com.disunday.bot # Start
launchctl stop com.disunday.bot # Stop
tail -f ~/.disunday/logs/disunday.log # Logs
./scripts/uninstall-service.sh # Uninstall
Linux:
systemctl --user start disunday # Start
systemctl --user stop disunday # Stop
journalctl --user -u disunday -f # Logs
./scripts/uninstall-service.sh # Uninstall
Docker
When to Use Docker?
| Situation | Recommended |
| ------------------------------ | -------------------------- |
| Developing on my PC | Local install (pnpm dev) |
| Run bot only when PC is on | Auto-Start script |
| 24/7 server operation | Docker |
| Run without Node.js installed | Docker |
| VPS/cloud server deployment | Docker |
Quick Start
# Build and run
docker compose up -d
# View logs
docker compose logs -f
# Stop
docker compose down
Volume Mounts
| Path | Description |
| ------------- | ------------------------- |
| ~/.disunday | Bot credentials, database |
| ~/projects | Your project directories |
Edit docker-compose.yml to change mounted directories:
volumes:
- ~/.disunday:/root/.disunday
- ~/my-projects:/projects # Change this
Manual Docker Run
docker build -t disunday .
docker run -d \
--name disunday \
--restart unless-stopped \
-v ~/.disunday:/root/.disunday \
-v ~/projects:/projects \
disunday
Architecture: One Bot Per Machine
Each Discord bot you create is tied to one machine. This is by design.
When you run disunday on a computer, it spawns OpenCode servers for projects on that machine. The bot can only access directories on the machine where it's running.
To control multiple machines:
- Create a separate Discord bot for each machine
- Run
disundayon each machine with its own bot token - Add all bots to the same Discord server
Each channel shows which bot (machine) it's connected to. You can have channels from different machines in the same server, controlled by different bots.
Running Multiple Instances
By default, Disunday stores its data in ~/.disunday. To run multiple bot instances on the same machine (e.g., for different teams or projects), use the --data-dir option:
# Instance 1 - uses default ~/.disunday
cd discord && pnpm dev
# Instance 2 - separate data directory
cd discord && pnpm dev -- --data-dir ~/work-bot
# Instance 3 - another separate instance
cd discord && pnpm dev -- --data-dir ~/personal-bot
Each instance has its own:
- Database - Bot credentials, channel mappings, session history
- Projects directory - Where
/create-new-projectcreates new folders - Lock port - Derived from the data directory path, so instances don't conflict
This lets you run completely isolated bots on the same machine, each with their own Discord app and configuration.
Migration from Kimaki
If you previously used Kimaki, Disunday automatically detects existing data at ~/.kimaki on first run and offers to migrate it to ~/.disunday.
What gets migrated:
- Bot token and credentials
- Channel-to-directory mappings
- API keys (Gemini, etc.)
Manual migration (if needed):
cp -r ~/.kimaki ~/.disunday
After migration, your existing Discord channels will continue to work with Disunday.
Multiple Discord Servers
A single Disunday instance can serve multiple Discord servers. Install the bot in each server using the install URL shown during setup, then add project channels to each server.
Method 1: Use /add-project command
- Run
pnpm devonce to set up the bot - Install the bot in both servers using the install URL
- In Server A: run
/add-projectand select your project - In Server B: run
/add-projectand select your project
The /add-project command creates channels in whichever server you run it from.
Method 2: Re-run CLI with --add-channels
- Run
pnpm dev- set up bot, install in both servers, create channels in first server - Run
pnpm dev -- --add-channels- select projects for the second server
The setup wizard lets you pick one server at a time.
You can even link the same project to channels in multiple servers - both will point to the same directory on your machine.
Best Practices
Create a dedicated Discord server for your agents. This keeps your coding sessions separate from other servers and gives you full control over permissions.
Add all your bots to that server. One server, multiple machines. Each channel is clearly labeled with its project directory.
Use the "Disunday" role for team access. Create a role named "Disunday" (case-insensitive) and assign it to users who should be able to trigger sessions.
Send long prompts as file attachments. Discord has character limits for messages. Tap the plus icon and use "Send message as file" for longer prompts. Disunday reads file attachments as your message.
Required Permissions
Only users with these Discord permissions can interact with the bot:
- Server Owner - Full access
- Administrator - Full access
- Manage Server - Full access
- "Disunday" role - Create a role with this name and assign to trusted users
Messages from users without these permissions are ignored.
Blocking Access with "no-disunday" Role
Create a role named "no-disunday" (case-insensitive) to block specific users from using the bot, even if they have other permissions like Server Owner or Administrator.
This implements the "four-eyes principle" - it adds friction to prevent accidental usage. Even if you're a server owner, you must remove this role to interact with the bot.
Use cases:
- Prevent accidental bot triggers by owners who share servers
- Temporarily disable access for specific users
- Break-glass scenario: removing the role is a deliberate action
Features
Text Messages
Send any message in a channel linked to a project. Disunday creates a thread and starts an OpenCode session.
File Attachments
Attach images, code files, or any other files to your message. Disunday includes them in the session context.
Voice Messages
Record a voice message in Discord. Disunday transcribes it using Google's Gemini API and processes it as text. The transcription uses your project's file tree f
