Before you start
- The CLI is installed and signed in:
jaccard auth statusshows your organization. See Install and sign in. - The agent is deployed and exposed, which is the default. Slack sends events to the agent’s URL, so an agent deployed with
--no-exposecan’t be connected. - You can create apps in the Slack workspace. Some workspaces allow only admins to: ask for the Create apps permission, or for an admin to approve the app.
Connect
1
Start channel add
2
Create the Slack app from the manifest
- Open api.slack.com/apps and click Create New App.
- Choose From a manifest.
- Pick the workspace the agent should live in and click Next.
- Switch the editor to YAML, replace its contents with the contents of
slack-app-manifest.yaml, and click Next. - Review the summary and click Create.
3
Install the app to the workspace
On Basic Information, under Install your app, click Install to Workspace and then Allow. If the button is missing, open OAuth & Permissions in the sidebar and click Install to Workspace there.Installing is what creates the bot token. The next step cannot finish without it.
4
Paste the two credentials
Back in the terminal, give the CLI what it asked for, in this order:The CLI checks the token with Slack before storing anything, so a wrong token fails here, not later. The credentials are stored on the platform, not in your project or in
- Signing Secret. On Basic Information, under App Credentials, click Show next to Signing Secret, copy it, and paste it at the prompt. It is a 32-character value.
- Bot User OAuth Token. Open OAuth & Permissions. Under OAuth Tokens, copy the Bot User OAuth Token, which starts with
xoxb-, and paste it at the second prompt.
jaccard env.5
Deploy the channel file
agent/channels/slack.ts, which channel add wrote into the project. Until it finishes, the agent can’t answer Slack.Commit agent/channels/slack.ts, since it’s part of the agent. slack-app-manifest.yaml is only needed to create or update the app, so committing it is up to you.6
Verify the Request URL
Slack checks the Request URL by posting a challenge to it, and the agent answers only once the deploy above is serving.
- In the app’s settings, open Event Subscriptions.
- Next to the Request URL, click Retry. It should change to Verified. If it does not, wait for the deploy to finish and retry.
- If Slack shows a Save Changes button, click it.
reachable no with a 404 means the running image does not have the channel file yet.7
Talk to the agent
- In a channel: invite the bot with
/invite @my-agent, then mention it:@my-agent summarise last week's signups. The agent replies in a thread under your message. Keep asking in that thread without mentioning it again. - By DM: open the app from Apps in the Slack sidebar, or click its name and choose Message. Every top-level DM starts a new conversation. Follow-ups go in the thread under the agent’s reply.
- Files: the bot has
files:readandfiles:write, so it can read attachments you share and upload its own.
What the channel file does
channel add writes this file. The hooks decide which Slack messages reach the agent:
agent/channels/slack.ts
onDirectMessageruns for DMs and admits all of them.onMessageruns for every channel message the app receives. It admits a message that mentions the bot, or one in a thread the agent already has a conversation in (isSubscribed()), and drops the rest, including messages from other bots.- Returning an object sends the message to the agent. Returning
nulldrops it.
channel add wrote, channel rm leaves it in place rather than deleting it.
Private channels
The default app receives public channel messages only. To let the agent follow threads in private channels:- Add
message.groupstosettings.event_subscriptions.bot_eventsandgroups:historytooauth_config.scopes.botinslack-app-manifest.yaml. - In the app’s settings, open App Manifest, paste the updated manifest, and save.
- Reinstall the app: OAuth & Permissions, Reinstall to Workspace, Allow. New scopes take effect only after a reinstall. The bot token stays the same, so the platform needs nothing.
jaccard channel manifest slack prints the default manifest again if you want to start over from it.
Rotate the credentials
If you regenerate the signing secret or reinstall the app with a new token, runjaccard channel add slack again and paste the new values. The command keeps your manifest and channel file, replaces the stored credentials, and restarts the agent so the new values take effect. The output says channel updated.
Disconnect
rm removes the channel and its credentials from the platform and deletes agent/channels/slack.ts if it is still the file channel add wrote. The deploy ships the agent without the channel. The Slack app is yours: delete it from api.slack.com/apps under Basic Information, Delete App, or keep it for later.