mirror of
https://github.com/cline/cline.git
synced 2026-09-24 23:20:16 +08:00
feat(cli): add Slack socket mode support (#11245)
* feat(cli): add Slack socket mode support Add socket mode as an alternative to webhook mode for Slack connector, allowing connections without a public URL. - Introduce `--connection` flag to select webhook or socket mode - Add `--app-token` option for socket mode authentication - Make signing secret and base URL conditional on webhook mode - Add `parseSlackConnectionMode` with validation and tests - Update CLI platform definition to support hybrid connection type - Update README docs with socket mode usage examples * use base-url and remove connection flag * isSocketMode
This commit is contained in:
+20
-5
@@ -22,7 +22,7 @@ cline connect
|
||||
| Platform | Direct Command | Required Credentials |
|
||||
|----------|---------------|---------------------|
|
||||
| Telegram | `cline connect telegram` | Bot token |
|
||||
| Slack | `cline connect slack` | Bot token, signing secret, base URL |
|
||||
| Slack | `cline connect slack` | Bot token plus webhook signing secret/base URL or socket app token |
|
||||
| Discord | `cline connect discord` | Application ID, bot token, public key, base URL |
|
||||
| Google Chat | `cline connect gchat` | Service account credentials JSON, base URL |
|
||||
| WhatsApp | `cline connect whatsapp` | Phone number ID, access token, app secret, verify token, base URL |
|
||||
@@ -75,13 +75,28 @@ The `--hook-command` receives each incoming message with sender info via stdin.
|
||||
|
||||
## Slack
|
||||
|
||||
Requires a bot token, signing secret, and public base URL.
|
||||
Slack supports webhook mode and socket mode. Each Slack thread maps to an agent session, so the agent maintains conversation context within a thread.
|
||||
|
||||
Webhook mode requires a bot token, signing secret, and public base URL:
|
||||
|
||||
```bash
|
||||
cline connect slack --token <BOT-TOKEN> --signing-secret <SECRET> --base-url <URL>
|
||||
cline connect slack \
|
||||
--bot-token <BOT-TOKEN> \
|
||||
--signing-secret <SECRET> \
|
||||
--base-url <URL>
|
||||
```
|
||||
|
||||
Each Slack thread maps to an agent session, so the agent maintains conversation context within a thread.
|
||||
Configure the Slack app's event subscription and interactivity request URLs to `<URL>/api/webhooks/slack`.
|
||||
|
||||
Socket mode requires a bot token and an app-level token with the `connections:write` scope:
|
||||
|
||||
```bash
|
||||
cline connect slack \
|
||||
--bot-token <BOT-TOKEN> \
|
||||
--app-token <APP-LEVEL-TOKEN>
|
||||
```
|
||||
|
||||
Enable Socket Mode in the Slack app. Socket mode does not need a public request URL and is single-workspace only.
|
||||
|
||||
## Discord
|
||||
|
||||
@@ -257,7 +272,7 @@ Multiple connectors can run simultaneously. They all share the same hub:
|
||||
cline connect telegram -k $TELEGRAM_TOKEN
|
||||
|
||||
# Terminal 2
|
||||
cline connect slack --token $SLACK_TOKEN --signing-secret $SECRET --base-url $URL
|
||||
cline connect slack --bot-token $SLACK_TOKEN --signing-secret $SECRET --base-url $URL
|
||||
```
|
||||
|
||||
Connectors require the hub. Start it with `cline hub start` if it doesn't auto-start.
|
||||
|
||||
Reference in New Issue
Block a user