Carlo is a Slack bot built with Cloudflare Workers that uses AI to generate tickets from Slack conversations.
- Clone the repository
- Install dependencies:
npm install
- Set up your Cloudflare Worker environment
- Configure your Slack App settings as per the
manifest.json
file - Create a
.dev.vars
file in the project root with the following content:
# https://api.slack.com/apps/{your App ID}/general
# Settings > Basic Information > App Credentials > Signing Secret
SLACK_SIGNING_SECRET=
# https://api.slack.com/apps/{your App ID}/install-on-team
# Settings > Install App > Bot User OAuth Token
SLACK_BOT_TOKEN=
SLACK_LOGGING_LEVEL=DEBUG
Replace the empty values with your actual Slack app credentials.
name = "carlo-slack"
main = "src/index.ts"
compatibility_date = "2024-09-07"
[ai]
binding = "AI"
-
Go to https://api.slack.com/apps and click "Create New App"
-
Choose "From an app manifest" and select your workspace
-
Copy the contents of
manifest.json
from this project and paste it into the manifest editor -
Replace the placeholder URL in the manifest with your Cloudflare Worker URL:
"request_url": "https://your-worker-url.workers.dev",
-
Review and create the app
-
Once created, navigate to "Basic Information" in the app settings
-
Under "App Credentials", find and copy the "Signing Secret" - you'll need this for the
SLACK_SIGNING_SECRET
in your.dev.vars
file -
Go to "OAuth & Permissions" in the sidebar
-
Click "Install to Workspace"
-
After installation, copy the "Bot User OAuth Token" - you'll need this for the
SLACK_BOT_TOKEN
in your.dev.vars
file -
Invite the bot to the desired Slack channels by typing
/invite @YourBotName
in each channel
See manifest.json
for the full Slack App configuration.
To start the development server:
npm run start
Use ngrok to expose your local server to the internet:
ngrok http 8787
Update the Slack app configuration with the ngrok URL:
"request_url": "https://your-ngrok-url.ngrok.io",
To deploy the Worker:
npm run deploy
After deploying we need to add the secrets
wrangler secret put SLACK_SIGNING_SECRET
wrangler secret put SLACK_BOT_TOKEN
wrangler secret put SLACK_LOGGING_LEVEL # Optional
src/index.ts
: Main application logicsrc/utils.ts
: Utility functions for formatting tickets and messagespackage.json
: Project dependencies and scriptswrangler.toml
: Cloudflare Workers configurationmanifest.json
: Slack App configuration.dev.vars
: Local environment variables (do not commit this file)
- The bot listens for app mentions in Slack channels
- When mentioned in a thread, it analyzes the conversation
- Using AI, it generates a structured ticket from the conversation
- The generated ticket is posted back to the Slack thread
- Users can then create a Linear ticket with a single click