A Slack bot that integrates with OpenHands using Socket Mode (no domain required).
🇺🇸 English | 🇯🇵 日本語
OpenHands is a powerful AI development assistant, but traditionally requires web UI interaction. This bot brings OpenHands functionality directly into Slack, where teams already collaborate daily.
- Accessibility: Direct OpenHands access from Slack without opening web UI
- Team Collaboration: Project management through Slack's threading system
- Easy Setup: No domain configuration required with Socket Mode
- Context Continuity: Maintains conversation context for ongoing development
- Code review requests
- Bug fixing consultations
- New feature implementation support
- Documentation generation
- Team pair programming sessions
- 🤖 Chat with OpenHands directly from Slack
- 🧵 Thread-based conversations (each thread = separate project)
- 💬 Direct message support
- 🔌 Socket Mode (no webhook/domain setup needed)
- ⚡ Real-time responses from OpenHands
- Node.js 18+ installed
- OpenHands running on
http://localhost:3000 - Slack workspace with admin permissions
- Go to https://api.slack.com/apps
- Click "Create New App" → "From scratch"
- Name your app (e.g., "OpenHands Bot") and select workspace
In your Slack app:
OAuth & Permissions → Bot Token Scopes:
app_mentions:readchat:writeim:readim:writecommands
Socket Mode:
- Enable Socket Mode
- Create App-Level Token with scope:
connections:write
npm installCreate .env file:
# Get from "OAuth & Permissions" → Bot User OAuth Token
SLACK_BOT_TOKEN=xoxb-your-bot-token
# Get from "Basic Information" → Signing Secret
SLACK_SIGNING_SECRET=your-signing-secret
# Get from "Socket Mode" → App-Level Token
SLACK_APP_TOKEN=xapp-your-app-token
# OpenHands configuration
OPENHANDS_API_URL=http://localhost:3000
PORT=3001In Slack, type /invite @your-bot-name in channels where you want to use it.
npm start@openhands-bot Create a Python script that reads a CSV file
Once a conversation starts, you can continue in the same thread for the same project context.
Send direct messages to the bot for private conversations.
/openhands-help- Show help/openhands-status- Check OpenHands connection/openhands-conversations- List active conversations/openhands-open- Get OpenHands WebUI link
- Thread Management: Each Slack thread maps to an OpenHands conversation
- Real-time Sync: Socket connection streams OpenHands responses to Slack
- Context Preservation: Conversations maintain context within threads
- No Domain Required: Uses Slack's Socket Mode instead of webhooks
Default configuration in src/config.js:
- Model:
lm_studio/devstral-small-2505 - Base URL:
http://host.docker.internal:1234/v1/ - Agent:
CodeActAgent
| Variable | Description | Required |
|---|---|---|
SLACK_BOT_TOKEN |
Bot User OAuth Token | ✅ |
SLACK_SIGNING_SECRET |
App Signing Secret | ✅ |
SLACK_APP_TOKEN |
App-Level Token for Socket Mode | ✅ |
OPENHANDS_API_URL |
OpenHands base URL | ✅ |
OPENHANDS_MODEL |
LLM model to use | ❌ |
OPENHANDS_AGENT |
Agent type | ❌ |
PORT |
Server port | ❌ |
- Check OpenHands is running:
/openhands-status - Verify bot is invited to channel
- Check console logs for errors
- Ensure all required OAuth scopes are added
- Reinstall bot to workspace after scope changes
- Verify
SLACK_APP_TOKENis correct - Ensure Socket Mode is enabled in Slack app settings
# Development mode with auto-restart
npm run dev
# Test OpenHands connection
npm run test-connectionMIT License - feel free to modify and distribute!
- Fork the repository
- Create your feature branch
- Submit a pull request
Made with ❤️ for the OpenHands community