Select your mode
Qodo CLI tool supports two communication modes with Slack:- HTTP Webhook Mode (default): Requires a public endpoint, best for production
- Socket Mode: Works behind firewalls, great for development and enterprise environments
| Features | HTTP Webhook Mode | Socket Mode |
|---|---|---|
| Public endpoint required | ✅ Yes | ❌ No |
| Works behind firewalls | ❌ No | ✅ Yes |
| Slack Marketplace compatible | ✅ Yes | ❌ No |
| Scalability | ✅ Excellent | ⚠️ Limited (10 connections) |
| Local development | ⚠️ Needs tunneling | ✅ Direct |
Prerequisites
- A Slack workspace where you have permission to install apps
- A Qodo API key (get one from Qodo Dashboard)
- Node.js and the Qodo CLI installed
Setup
Step 1: Create a Slack app
Go to Slack API Apps
Step 2: Configure OAuth & permissions
Add the following scopes:
chat:write- Send messageschat:write.public- Send messages to channels the bot isn’t inreactions:write- Add reactions to messageschannels:read- Read channel informationgroups:read- Read private channel informationim:read- Read direct message informationmpim:read- Read group direct message information
Step 3A: Configure event subscriptions (HTTP webhook mode)
Skip this step if you’re using Socket ModeSet the Request URL to:
http://your-server.com/slack/events- For local development:
http://localhost:4444/slack/events(default port) - For custom port:
http://localhost:YOUR_PORT/slack/events - For production: Use your actual server URL with HTTPS
Under “Subscribe to bot events”, add:
app_mention- When your bot is mentionedmessage.channels- Messages in public channelsmessage.groups- Messages in private channelsmessage.im- Direct messagesmessage.mpim- Group direct messages
Step 3B: Configure socket mode (socket mode only)
Skip this step if you’re using HTTP Webhook ModeUnder “Subscribe to bot events”, add:
app_mention- When your bot is mentionedmessage.channels- Messages in public channelsmessage.groups- Messages in private channelsmessage.im- Direct messagesmessage.mpim- Group direct messages
Step 4A: Get your signing secret (HTTP webhook mode only)
Skip this step if you’re using Socket ModeStep 4B: Generate app-level token (socket mode only)
Skip this step if you’re using HTTP Webhook ModeStep 5: Configure environment variables
For HTTP Webhook Mode (default):
For Socket Mode:
Step 6: Find your bot user ID (optional but recommended)
Step 7: Test your setup
Step 8: Configure your agent commands
Create an agent configuration file (e.g.,agent.toml):
Switching between modes
You can easily switch between HTTP Webhook and Socket Mode by changing your environment variables:Switch to Socket Mode:
Switch to HTTP Webhook Mode:
Troubleshooting
Bot Not Responding For HTTP Webhook Mode:- Check that your webhook URL is accessible from the internet
- Verify your bot token and signing secret are correct
- Ensure your Slack app’s Request URL is set correctly
- Verify your bot token and app-level token are correct
- Check that Socket Mode is enabled in your Slack app settings
- Ensure your app-level token has
connections:writescope
- Check the bot has the required OAuth scopes
- Make sure the bot is invited to the channel
- Verify the bot is mentioned correctly (e.g.,
@YourBotName)
- You’re in HTTP Webhook mode but missing the signing secret
- Either add the signing secret or switch to Socket Mode
- You’re in Socket Mode but missing the app-level token
- Either add the app-level token or switch to HTTP Webhook mode
- Ensure your agent configuration file is loaded
- Check that command names match exactly
- Verify the agent file syntax is correct
- Make sure the bot has the required OAuth scopes
- Check that the bot is invited to channels where you’re trying to use it
- Verify your Qodo API key is valid
- ngrok:
ngrok http 3000 - localtunnel:
lt --port 4444
Production deployment
For production:- Deploy your bot to a server with a public HTTPS URL
- Update the Request URL in your Slack app settings
- Set environment variables on your server
- Ensure your server can handle Slack’s event delivery requirements
- Consider using a process manager like PM2 to keep the bot running