{"id":43221250,"url":"https://github.com/code-xhyun/disunday","last_synced_at":"2026-02-05T13:01:41.288Z","repository":{"id":335489391,"uuid":"1145948372","full_name":"code-xhyun/disunday","owner":"code-xhyun","description":"Control opencode from Discord. Say goodbye to Sundays—manage your AI coding projects 24/7 through Discord channels.","archived":false,"fork":false,"pushed_at":"2026-02-02T14:43:31.000Z","size":1976,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-02T21:38:45.566Z","etag":null,"topics":["discord-bot","opencode","opencode-discord","opencode-plugin","opencode-plugins","opencode-telegram","opencode-ui"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-xhyun.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-30T12:27:30.000Z","updated_at":"2026-02-02T14:46:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/code-xhyun/disunday","commit_stats":null,"previous_names":["code-xhyun/disunday"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/code-xhyun/disunday","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-xhyun%2Fdisunday","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-xhyun%2Fdisunday/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-xhyun%2Fdisunday/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-xhyun%2Fdisunday/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-xhyun","download_url":"https://codeload.github.com/code-xhyun/disunday/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-xhyun%2Fdisunday/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29043644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord-bot","opencode","opencode-discord","opencode-plugin","opencode-plugins","opencode-telegram","opencode-ui"],"created_at":"2026-02-01T09:01:27.298Z","updated_at":"2026-02-05T13:01:41.257Z","avatar_url":"https://github.com/code-xhyun.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n    \u003cbr/\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/code-xhyun/disunday/main/assets/logo.png\" alt=\"disunday\" width=\"480\" /\u003e\n    \u003cbr/\u003e\n    \u003cbr/\u003e\n\u003c/div\u003e\n\nDisunday is a Discord bot that lets you control [OpenCode](https://opencode.ai) coding sessions from Discord. Send a message in a Discord channel → an AI agent edits code on your machine.\n\n\u003e **Fun fact:** This project is being developed using Disunday itself - lying on a couch, controlling OpenCode through Discord on a phone.\n\n## Quick Start\n\n```bash\nnpx disunday\n```\n\nThe CLI will guide you through:\n1. Creating a Discord bot at [discord.com/developers](https://discord.com/developers/applications)\n2. Enabling required intents (Message Content, Server Members)\n3. Installing the bot to your server\n4. Linking project directories\n\n### AI Setup Prompt\n\nCopy this prompt to your AI coding agent (Claude Code, Cursor, OpenCode, etc.):\n\n```\nSet up Disunday Discord bot for me by running `npx disunday`.\n\nThe CLI will guide me through Discord bot setup, but help me with:\n- Creating a Discord bot at https://discord.com/developers/applications\n- Enabling \"MESSAGE CONTENT INTENT\" and \"SERVER MEMBERS INTENT\" in Bot settings\n- Generating invite URL with Administrator permissions\n- Getting the bot token\n\nIf any errors occur, help me troubleshoot.\n```\n\n### Development Installation\n\nFor contributing or development:\n\n```bash\ngit clone https://github.com/code-xhyun/disunday\ncd disunday\npnpm install\ncd discord \u0026\u0026 pnpm dev\n```\n\n## What is Disunday?\n\nDisunday 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:\n\n- Read and edit files\n- Run terminal commands\n- Search your codebase\n\n## Installation Options\n\n| Method                                      | Description              | Recommended For           |\n| ------------------------------------------- | ------------------------ | ------------------------- |\n| [npx disunday](#quick-start)                | One command install      | Most users                |\n| [Development Install](#development-installation) | `git clone` + `pnpm dev` | Contributors              |\n| [Auto-Start](#auto-start-on-boot)           | Auto-run on login        | Always-on personal PC     |\n| [Docker](#docker)                           | Run in container         | 24/7 server, VPS deploy   |\n\nThink of it as texting your codebase. You describe what you want, the AI does it.\n\nKeep the CLI running. It's the bridge between Discord and your machine.\n\n## Auto-Start on Boot\n\nRun the bot automatically when your computer starts:\n\n```bash\n./scripts/install-service.sh\n```\n\n**macOS**: Installs LaunchAgent (starts on login)\n**Linux**: Installs systemd user service\n\n### Service Commands\n\n**macOS:**\n\n```bash\nlaunchctl start com.disunday.bot   # Start\nlaunchctl stop com.disunday.bot    # Stop\ntail -f ~/.disunday/logs/disunday.log  # Logs\n./scripts/uninstall-service.sh     # Uninstall\n```\n\n**Linux:**\n\n```bash\nsystemctl --user start disunday    # Start\nsystemctl --user stop disunday     # Stop\njournalctl --user -u disunday -f   # Logs\n./scripts/uninstall-service.sh     # Uninstall\n```\n\n## Docker\n\n### When to Use Docker?\n\n| Situation                      | Recommended                |\n| ------------------------------ | -------------------------- |\n| Developing on my PC            | **Local install** (`pnpm dev`) |\n| Run bot only when PC is on     | **Auto-Start script**      |\n| 24/7 server operation          | **Docker**                 |\n| Run without Node.js installed  | **Docker**                 |\n| VPS/cloud server deployment    | **Docker**                 |\n\n### Quick Start\n\n```bash\n# Build and run\ndocker compose up -d\n\n# View logs\ndocker compose logs -f\n\n# Stop\ndocker compose down\n```\n\n### Volume Mounts\n\n| Path          | Description               |\n| ------------- | ------------------------- |\n| `~/.disunday` | Bot credentials, database |\n| `~/projects`  | Your project directories  |\n\nEdit `docker-compose.yml` to change mounted directories:\n\n```yaml\nvolumes:\n  - ~/.disunday:/root/.disunday\n  - ~/my-projects:/projects # Change this\n```\n\n### Manual Docker Run\n\n```bash\ndocker build -t disunday .\n\ndocker run -d \\\n  --name disunday \\\n  --restart unless-stopped \\\n  -v ~/.disunday:/root/.disunday \\\n  -v ~/projects:/projects \\\n  disunday\n```\n\n## Architecture: One Bot Per Machine\n\n**Each Discord bot you create is tied to one machine.** This is by design.\n\nWhen 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.\n\nTo control multiple machines:\n\n1. Create a separate Discord bot for each machine\n2. Run `disunday` on each machine with its own bot token\n3. Add all bots to the same Discord server\n\nEach channel shows which bot (machine) it's connected to. You can have channels from different machines in the same server, controlled by different bots.\n\n## Running Multiple Instances\n\nBy 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:\n\n```bash\n# Instance 1 - uses default ~/.disunday\ncd discord \u0026\u0026 pnpm dev\n\n# Instance 2 - separate data directory\ncd discord \u0026\u0026 pnpm dev -- --data-dir ~/work-bot\n\n# Instance 3 - another separate instance\ncd discord \u0026\u0026 pnpm dev -- --data-dir ~/personal-bot\n```\n\nEach instance has its own:\n\n- **Database** - Bot credentials, channel mappings, session history\n- **Projects directory** - Where `/create-new-project` creates new folders\n- **Lock port** - Derived from the data directory path, so instances don't conflict\n\nThis lets you run completely isolated bots on the same machine, each with their own Discord app and configuration.\n\n### Migration from Kimaki\n\nIf you previously used [Kimaki](https://github.com/remorses/kimaki), Disunday automatically detects existing data at `~/.kimaki` on first run and offers to migrate it to `~/.disunday`.\n\n**What gets migrated:**\n- Bot token and credentials\n- Channel-to-directory mappings\n- API keys (Gemini, etc.)\n\n**Manual migration (if needed):**\n```bash\ncp -r ~/.kimaki ~/.disunday\n```\n\nAfter migration, your existing Discord channels will continue to work with Disunday.\n\n## Multiple Discord Servers\n\nA 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.\n\n### Method 1: Use `/add-project` command\n\n1. Run `pnpm dev` once to set up the bot\n2. Install the bot in both servers using the install URL\n3. In **Server A**: run `/add-project` and select your project\n4. In **Server B**: run `/add-project` and select your project\n\nThe `/add-project` command creates channels in whichever server you run it from.\n\n### Method 2: Re-run CLI with `--add-channels`\n\n1. Run `pnpm dev` - set up bot, install in both servers, create channels in first server\n2. Run `pnpm dev -- --add-channels` - select projects for the second server\n\nThe setup wizard lets you pick one server at a time.\n\nYou can even link the same project to channels in multiple servers - both will point to the same directory on your machine.\n\n## Best Practices\n\n**Create a dedicated Discord server for your agents.** This keeps your coding sessions separate from other servers and gives you full control over permissions.\n\n**Add all your bots to that server.** One server, multiple machines. Each channel is clearly labeled with its project directory.\n\n**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.\n\n**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.\n\n## Required Permissions\n\nOnly users with these Discord permissions can interact with the bot:\n\n- **Server Owner** - Full access\n- **Administrator** - Full access\n- **Manage Server** - Full access\n- **\"Disunday\" role** - Create a role with this name and assign to trusted users\n\nMessages from users without these permissions are ignored.\n\n### Blocking Access with \"no-disunday\" Role\n\nCreate 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.\n\nThis 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.\n\n**Use cases:**\n\n- Prevent accidental bot triggers by owners who share servers\n- Temporarily disable access for specific users\n- Break-glass scenario: removing the role is a deliberate action\n\n## Features\n\n### Text Messages\n\nSend any message in a channel linked to a project. Disunday creates a thread and starts an OpenCode session.\n\n### File Attachments\n\nAttach images, code files, or any other files to your message. Disunday includes them in the session context.\n\n### Voice Messages\n\nRecord 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 for accuracy, recognizing function names and file paths you mention.\n\nRequires a Gemini API key (prompted during setup).\n\n### Session Management\n\n- **Resume sessions** - Continue where you left off with `/resume`\n- **Fork sessions** - Branch from any message in the conversation with `/fork`\n- **Share sessions** - Generate public URLs to share your session with `/share`\n- **Rename sessions** - Change session title with `/rename` (syncs thread name)\n- **Session info** - Get session ID and terminal command with `/session-info`\n\n### Terminal ↔ Discord Sync\n\nWork seamlessly between Discord and terminal:\n\n- **Continue in terminal**: Use `/session-info` to get the `opencode -s \u003csession_id\u003e` command\n- **Sync back to Discord**: After working in terminal, use `/sync` to pull recent messages back to Discord\n- Session titles renamed in terminal are automatically synced to Discord thread names\n\n### Message Queue\n\nUse `/queue \u003cmessage\u003e` to queue a follow-up message while the AI is still responding. The queued message sends automatically when the current response finishes. If no response is in progress, it sends immediately. Useful for chaining tasks without waiting.\n\n### Scheduled Messages (Beta)\n\nSchedule prompts to run at a specific time:\n\n```\n/schedule add prompt:\"Run tests and deploy\" time:3:00pm\n/schedule add prompt:\"Daily standup summary\" time:30m\n/schedule list\n/schedule cancel id:5\n```\n\n**Time formats:**\n- Relative: `30m`, `2h`, `1d` (minutes, hours, days from now)\n- Absolute: `3:00pm`, `14:30` (runs today, or tomorrow if time has passed)\n\nSchedules persist across bot restarts. Use `/schedule list` to see pending schedules and `/schedule cancel` to remove them.\n\n### Run Commands\n\nExecute whitelisted terminal commands directly from Discord with `/run`. Useful for quick operations like `git status`, `pnpm test`, or deployment scripts.\n\n- Configure notifications with `/run-config`\n- Run in background for long-running commands\n- Get Discord, system, or webhook notifications on completion\n\n### Bot Settings\n\nConfigure bot-wide settings using `/settings`:\n\n| Setting      | Command                                  | Description                                          |\n| ------------ | ---------------------------------------- | ---------------------------------------------------- |\n| Hub Channel  | `/settings hub-channel channel:#channel` | Central notification channel for session completions |\n| View         | `/settings view`                         | View current bot settings                            |\n\nWhen a hub channel is configured, session completions send notifications:\n\n```\n✅ **project-name** completed\n⏱ 28.6s · 73% · claude-opus-4-5\n🧵 thread-name (link)\n```\n\n### Reaction Commands (Beta)\n\nAdd emoji reactions to messages in threads to trigger quick actions:\n\n| Reaction | Action |\n| -------- | ------ |\n| 🔄 | Retry the last user prompt |\n| ❌ | Abort the current session |\n| 📌 | Pin the message |\n\nTo use: manually add the emoji reaction to any message in the thread. The bot detects the reaction and performs the action. Reactions are automatically removed after the action is triggered.\n\n### Context Menu Commands (Beta)\n\nRight-click (or long-press on mobile) on any message in a session thread, then select **Apps** to access:\n\n- **Retry this prompt** - Re-run the selected user message\n- **Fork from here** - Create a new session branching from the selected AI response\n\nNote: Context menu commands may take up to 1 hour to appear after bot restart due to Discord's global command sync.\n\n### Error Recovery Buttons\n\nWhen a session encounters an error, interactive buttons appear:\n\n| Button | Action |\n| ------ | ------ |\n| 🔄 Retry | Re-run the last user prompt |\n| Dismiss | Remove the buttons |\n\nThis makes it easy to retry after transient failures (API timeouts, rate limits) without retyping your prompt.\n\n### Update Check\n\nOn startup, the bot checks npm for newer versions. If an update is available, you'll see:\n\n```\n🔔 Update available: 1.0.1 → 1.0.2\n   Run: npx disunday@latest\n```\n\n### Progress Indicator (Beta)\n\nDuring long sessions, periodic updates show elapsed time:\n\n```\n⏳ Working... (45s)\n⏳ Working... (1m 15s)\n```\n\nUpdates appear every 30 seconds while the AI is processing.\n\n## Commands Reference\n\n### Text Interaction\n\nJust send a message in any channel linked to a project. Disunday handles the rest.\n\n### Slash Commands\n\n| Command                      | Description                                                                |\n| ---------------------------- | -------------------------------------------------------------------------- |\n| `/new-session \u003cprompt\u003e`      | Start a new session with an initial prompt                                 |\n| `/resume \u003csession\u003e`          | Resume a previous session (with autocomplete)                              |\n| `/abort` or `/stop`          | Stop the current running session                                           |\n| `/compact`                   | Summarize conversation history to reduce context                           |\n| `/add-project \u003cproject\u003e`     | Create channels for an existing OpenCode project                           |\n| `/remove-project \u003cproject\u003e`  | Remove Discord channels for a project                                      |\n| `/create-new-project \u003cname\u003e` | Create a new project folder and start a session                            |\n| `/new-worktree \u003cname\u003e`       | Create a git worktree and start a session (⬦ prefix)                       |\n| `/merge-worktree`            | Merge worktree branch into default branch                                  |\n| `/toggle-worktrees`          | Toggle automatic worktree creation for new sessions                        |\n| `/model`                     | Change the AI model for this channel or session                            |\n| `/agent`                     | Change the agent for this channel or session                               |\n| `/login`                     | Authenticate with an AI provider (OAuth or API key)                        |\n| `/share`                     | Generate a public URL to share the current session                         |\n| `/fork`                      | Fork the session from a previous message                                   |\n| `/rename \u003ctitle\u003e`            | Rename the current session (also renames thread)                           |\n| `/session-info`              | Show session ID and terminal command to continue                           |\n| `/sync`                      | Sync recent terminal activity to Discord thread                            |\n| `/queue \u003cmessage\u003e`           | Queue a message to send after current response finishes                    |\n| `/clear-queue`               | Clear all queued messages in this thread                                   |\n| `/schedule add` *(Beta)*     | Schedule a message to run at a specific time                               |\n| `/schedule list` *(Beta)*    | List pending schedules in this channel                                     |\n| `/schedule cancel \u003cid\u003e` *(Beta)* | Cancel a scheduled message                                             |\n| `/undo`                      | Undo the last assistant message (revert file changes)                      |\n| `/redo`                      | Redo the last undone message                                               |\n| `/run \u003ccommand\u003e`             | Execute a terminal command                                                 |\n| `/run-config`                | Configure /run notification settings                                       |\n| `/verbosity \u003clevel\u003e`         | Set output verbosity (tools-and-text, text-and-essential-tools, text-only) |\n| `/theme \u003cstyle\u003e`             | Set message formatting theme (default, minimal, detailed, plain)           |\n| `/restart-opencode-server`   | Restart the OpenCode server for this channel                               |\n| `/status`                    | Check bot and session status                                               |\n| `/help`                      | Show available commands                                                    |\n| `/ping`                      | Check connection latency                                                   |\n| `/context`                   | Show context window usage for current session                              |\n| `/cost`                      | Show estimated API cost for current session                                |\n| `/diff`                      | Show recent file changes in project                                        |\n| `/export`                    | Export session to markdown file                                            |\n| `/files`                     | List project files                                                         |\n\n### CLI Commands\n\nAll commands run from the `discord` directory:\n\n```bash\n# Start the bot (interactive setup on first run)\npnpm dev\n\n# Upload files to a Discord thread\npnpm tsx src/cli.ts upload-to-discord --session \u003csession-id\u003e \u003cfile1\u003e [file2...]\n\n# Start a session programmatically (useful for CI/automation)\npnpm tsx src/cli.ts send --channel \u003cchannel-id\u003e --prompt \"your prompt\"\n\n# Send notification without starting AI session (reply to start session later)\npnpm tsx src/cli.ts send --channel \u003cchannel-id\u003e --prompt \"User cancelled subscription\" --notify-only\n\n# Create Discord channels for a project directory (without starting a session)\npnpm tsx src/cli.ts add-project [directory]\n```\n\n## Add Project Channels\n\nCreate Discord channels for a project directory without starting a session. Useful for automation and scripting.\n\n```bash\n# Add current directory as a project\npnpm tsx src/cli.ts add-project\n\n# Add a specific directory\npnpm tsx src/cli.ts add-project /path/to/project\n\n# Specify guild when bot is in multiple servers\npnpm tsx src/cli.ts add-project ./myproject --guild 123456789\n\n# In CI with env var for bot token\nDISUNDAY_BOT_TOKEN=xxx pnpm tsx src/cli.ts add-project --app-id 987654321\n```\n\n### Options\n\n| Option                  | Description                                                         |\n| ----------------------- | ------------------------------------------------------------------- |\n| `[directory]`           | Project directory path (defaults to current directory)              |\n| `-g, --guild \u003cguildId\u003e` | Discord guild/server ID (auto-detects if bot is in only one server) |\n| `-a, --app-id \u003cappId\u003e`  | Bot application ID (reads from database if available)               |\n\n## Programmatically Start Sessions\n\nYou can start Disunday sessions from CI pipelines, cron jobs, or any automation. The `send` command creates a Discord thread, and the running bot on your machine picks it up.\n\n### Environment Variables\n\n| Variable             | Required    | Description       |\n| -------------------- | ----------- | ----------------- |\n| `DISUNDAY_BOT_TOKEN` | Yes (in CI) | Discord bot token |\n\n### CLI Options\n\n```bash\npnpm tsx src/cli.ts send \\\n  --channel \u003cchannel-id\u003e  # Required: Discord channel ID\n  --prompt \u003cprompt\u003e       # Required: Message content\n  --name \u003cname\u003e           # Optional: Thread name (defaults to prompt preview)\n  --app-id \u003capp-id\u003e       # Optional: Bot application ID for validation\n  --notify-only           # Optional: Create notification thread without starting AI session\n```\n\n### Example: GitHub Actions on New Issues\n\nThis workflow starts a Disunday session whenever a new issue is opened:\n\n```yaml\n# .github/workflows/investigate-issues.yml\nname: Investigate New Issues\n\non:\n  issues:\n    types: [opened]\n\njobs:\n  investigate:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Clone Disunday\n        run: git clone https://github.com/code-xhyun/disunday.git\n      - name: Install dependencies\n        run: cd disunday \u0026\u0026 pnpm install\n      - name: Start Disunday Session\n        env:\n          DISUNDAY_BOT_TOKEN: ${{ secrets.DISUNDAY_BOT_TOKEN }}\n        run: |\n          cd disunday/discord \u0026\u0026 pnpm tsx src/cli.ts send \\\n            --channel \"1234567890123456789\" \\\n            --prompt \"Investigate issue ${{ github.event.issue.html_url }} using gh cli. Try fixing it in a new worktree ./${{ github.event.issue.number }}\" \\\n            --name \"Issue #${{ github.event.issue.number }}\"\n```\n\n**Setup:**\n\n1. Add `DISUNDAY_BOT_TOKEN` to your repository secrets (Settings → Secrets → Actions)\n2. Replace `1234567890123456789` with your Discord channel ID (right-click channel → Copy Channel ID)\n3. Make sure the Disunday bot is running on your machine\n\n### How It Works\n\n1. **CI runs `send`** → Creates a Discord thread with your prompt\n2. **Running bot detects thread** → Automatically starts a session\n3. **Bot starts OpenCode session** → Uses the prompt from the thread\n4. **AI investigates** → Runs on your machine with full codebase access\n\nUse `--notify-only` for notifications that don't need immediate AI response (e.g., subscription events). Reply to the thread later to start a session with the notification as context.\n\n## How It Works\n\n**SQLite Database** - Disunday stores state in `\u003cdata-dir\u003e/discord-sessions.db` (default: `~/.disunday/discord-sessions.db`). This maps Discord threads to OpenCode sessions, channels to directories, and stores your bot credentials. Use `--data-dir` to change the location.\n\n**OpenCode Servers** - When you message a channel, Disunday spawns (or reuses) an OpenCode server for that project directory. The server handles the actual AI coding session.\n\n**Channel Metadata** - Each channel's topic contains XML metadata linking it to a directory and bot:\n\n```xml\n\u003cdisunday\u003e\u003cdirectory\u003e/path/to/project\u003c/directory\u003e\u003capp\u003ebot_id\u003c/app\u003e\u003c/disunday\u003e\n```\n\n**Session Cache** - On startup, Disunday pre-fetches session lists for all projects, making `/resume` autocomplete fast from the first use.\n\n**Voice Processing** - Voice features run in a worker thread. Audio flows: Discord Opus → Decoder → Downsample (48kHz→16kHz) → Gemini API → Response → Upsample → Opus → Discord.\n\n**Graceful Restart** - Send `SIGUSR2` to restart the bot with new code without losing connections.\n\n## Model \u0026 Agent Configuration\n\nSet the AI model in your project's `opencode.json`:\n\n```json\n{\n  \"model\": \"anthropic/claude-sonnet-4-20250514\"\n}\n```\n\nFormat: `provider/model-name`\n\n**Examples:**\n\n- `anthropic/claude-sonnet-4-20250514` - Claude Sonnet 4\n- `anthropic/claude-opus-4-20250514` - Claude Opus 4\n- `openai/gpt-4o` - GPT-4o\n- `google/gemini-2.5-pro` - Gemini 2.5 Pro\n\nOr use these Discord commands to change settings per channel/session:\n\n- `/model` - Select a different AI model\n- `/agent` - Select a different agent (if you have multiple agents configured in your project)\n- `/login` - Authenticate with providers via OAuth or API key\n\n---\n\n## Credits\n\nOriginally forked from [kimaki](https://github.com/remorses/kimaki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-xhyun%2Fdisunday","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-xhyun%2Fdisunday","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-xhyun%2Fdisunday/lists"}