Ode is a Slack bot that bridges chat messages to OpenCode, enabling AI-assisted coding directly from Slack channels.
- Slack Socket Mode: Secure real-time messaging without webhooks
- OpenCode Integration: Execute AI coding tasks via OpenCode's HTTP API
- Per-Channel Agents.md: Custom system instructions per Slack channel
- Thread Tracking: Maintains context within conversation threads
- OAuth Flow: Connect OpenAI Codex for provider authentication
- Auto-Restart: Built-in nodemon integration for reliability
- Bun runtime
- OpenCode installed and in PATH
- Slack App with Socket Mode enabled
bun installCopy .env.example to .env and fill in your Slack credentials:
cp .env.example .envRequired environment variables:
SLACK_BOT_TOKEN- Bot User OAuth Token (xoxb-...)SLACK_APP_TOKEN- App-Level Token with Socket Mode (xapp-...)SLACK_SIGNING_SECRET- Signing secret from Slack app settings
Optional:
SLACK_TARGET_CHANNELS- Comma-separated channel IDs to restrict botOPENCODE_BINARY- Path to opencode (default: "opencode")OPENCODE_PORT- OpenCode server port (default: 4096)DEFAULT_CWD- Default working directory
Development mode (with hot reload):
bun run devProduction mode (with nodemon auto-restart):
./start.shCheck status:
./status.shStop:
./stop.sh/ode help- Show available commands/ode cwd [path]- View or set working directory/ode agents- View channel's agents.md/ode agents edit- Edit channel's agents.md (opens modal)/ode agents clear- Clear channel's agents.md/ode stop- Stop current operation/ode clear- Clear all sessions/ode config- View OpenCode configuration/ode config edit- Edit OpenCode config (agent, model, provider)/ode gh auth- Authenticate GitHub CLI (per Slack user, with base fallback, SSH)/ode oauth- Start OpenAI Codex OAuth flow
GitHub auth notes: Git operations use SSH, so ensure your SSH key is added to GitHub. PAT should include repo, plus read:org for org repositories, and workflow if managing Actions.
- Invite the bot to a channel
- Mention the bot or reply in an active thread
- The bot will process your message with OpenCode and reply
Use /ode agents edit to set custom system instructions for a channel. These are prepended to every OpenCode request in that channel.
src/
├── config/ # Environment configuration
├── opencode/ # OpenCode server management and HTTP client
├── slack/ # Slack app, commands, and formatting
├── storage/ # Settings and session persistence
└── index.ts # Main entry point
MIT