LoopCLI

Slack Connector

Keep teams in the loop with timely Slack messages triggered by LoopCLI.

Required secrets

Vault key Use case
slack-webhook Incoming webhook URL for channels
slack-bot-token Bot token for chat.postMessage

CLI commands:

loopcli secret add slack-webhook --value https://hooks.slack.com/services/...
loopcli secret add slack-bot-token --value xoxb-...

Common automations

  • Incident escalation with run logs attached.
  • Approval workflows that wait for emoji reactions or slash commands.
  • Shipping alerts summarizing new deployments or migrations.

Example loop

name: slack-incident-alert
steps:
  - id: summarize
    name: Summarize failure
    type: http
    config:
      url: https://api.anthropic.com/v1/messages
      method: POST
      headers:
        Authorization: "Bearer {{secret:anthropic-api-key}}"
        Content-Type: application/json
      body:
        model: claude-3-sonnet
        max_tokens: 400
        messages:
          - role: user
            content: "Summarize this incident:\n{{run.logs}}"
  - id: notify
    name: Send to Slack
    type: http
    config:
      url: https://slack.com/api/chat.postMessage
      method: POST
      headers:
        Authorization: "Bearer {{secret:slack-bot-token}}"
        Content-Type: application/json
      body:
        channel: "#incidents"
        text: "⚠️ Incident detected\n{{steps.summarize.response.body.content[0].text}}"
        unfurl_links: false
        unfurl_media: false

Block kit payloads

For richer layouts, author a JSON block in a separate file and load it:

- id: notify
  type: cli
  config:
    command: curl
    args:
      - -X
      - POST
      - https://hooks.slack.com/services/...
      - -H
      - "Content-Type: application/json"
      - -d
      - "@/workdir/payloads/slack-block.json"

Templates

Helpful links

Related Documentation

Continue learning with these related topics