Skip to content

CI/CD recipes · Developers

Drop-in recipes to notify Dailybot from any pipeline. Same pattern the Dailybot release workflows use: one curl call against the public REST API — no runtime to install, no CLI to keep in sync.

Every CI vendor supports environment variables and secrets — that is all you need to talk to Dailybot. The recipes below use plain `curl` + `jq` against the public REST API, the same pattern Dailybot's own release workflows use. Prefer a CLI? Skip to the CLI section.

Which endpoint?

Two endpoints cover the vast majority of CI/CD use cases. Both accept an X-API-KEY header and return JSON.

MethodPathWhen
POST/v1/send-message/Notify a channel, user, or team on your connected chat platform (Slack, MS Teams, Discord, Google Chat). Best for deploy started / deploy live / build failed alerts.
POST/v1/agent-reports/File a standup-style progress entry as an agent identity. Best for nightly cron summaries, per-deploy reports, and any recurring "what happened today" update.

API-first recipes

Every snippet is non-blocking: if Dailybot is briefly unreachable, the pipeline keeps going. Timeouts (--connect-timeout 10 --max-time 30) match the pattern in this website's own workflows.

GitHub Actions — notify a channel

# .github/workflows/notify-deploy.yml
name: Notify deploy
on:
  workflow_run:
    workflows: ["release"]
    types: [completed]

jobs:
  notify:
    runs-on: ubuntu-latest
    timeout-minutes: 3
    steps:
      - name: Install jq
        run: sudo apt-get update && sudo apt-get install -y jq

      - name: Post to Dailybot
        env:
          # Channel UUID from your Dailybot workspace.
          DAILYBOT_CHANNEL: ${{ vars.DAILYBOT_DEPLOY_CHANNEL }}
        run: |
          MESSAGE=$'✅ *Deploy live*\n> commit: `'"${GITHUB_SHA:0:8}"'`\n> actor: '"$GITHUB_ACTOR"
          BODY=$(jq -n --arg msg "$MESSAGE" --arg ch "$DAILYBOT_CHANNEL" \
            '{message: $msg, target_channels: [$ch]}')
          curl --fail --show-error --connect-timeout 10 --max-time 30 \
            'https://api.dailybot.com/v1/send-message/' \
            -H "X-API-KEY: ${{ secrets.DAILYBOT_API_KEY }}" \
            -H 'Content-Type: application/json' \
            -d "$BODY" \
            || echo "Dailybot notification failed; continuing."

GitHub Actions — file an agent report

# .github/workflows/nightly-report.yml
name: Nightly agent report
on:
  schedule:
    - cron: "0 23 * * *"

jobs:
  report:
    runs-on: ubuntu-latest
    timeout-minutes: 3
    steps:
      - name: Install jq
        run: sudo apt-get update && sudo apt-get install -y jq

      - name: File progress report
        run: |
          BODY=$(jq -n \
            --arg summary "Nightly batch completed on ${GITHUB_REF_NAME}." \
            --argjson milestone false \
            '{summary: $summary, milestone: $milestone}')
          curl --fail --show-error --connect-timeout 10 --max-time 30 \
            'https://api.dailybot.com/v1/agent-reports/' \
            -H "X-API-KEY: ${{ secrets.DAILYBOT_API_KEY }}" \
            -H 'Content-Type: application/json' \
            -d "$BODY" \
            || echo "Agent report failed; continuing."

GitLab CI

# .gitlab-ci.yml (fragment)
notify-dailybot:
  stage: notify
  image: alpine:3
  before_script:
    - apk add --no-cache curl jq
  variables:
    DAILYBOT_CHANNEL: "$DAILYBOT_DEPLOY_CHANNEL"  # UUID, set as a masked CI variable
  script: |
    BODY=$(jq -n \
      --arg msg "Pipeline ${CI_PIPELINE_ID} succeeded on ${CI_COMMIT_REF_NAME}." \
      --arg ch "$DAILYBOT_CHANNEL" \
      '{message: $msg, target_channels: [$ch]}')
    curl --fail --show-error --connect-timeout 10 --max-time 30 \
      'https://api.dailybot.com/v1/send-message/' \
      -H "X-API-KEY: $DAILYBOT_API_KEY" \
      -H 'Content-Type: application/json' \
      -d "$BODY" \
      || echo "Dailybot notification failed; continuing."
  only:
    - main

CircleCI

# .circleci/config.yml (fragment)
version: 2.1
jobs:
  notify-dailybot:
    docker:
      - image: cimg/base:current
    steps:
      - run:
          name: Post to Dailybot
          command: |
            BODY=$(jq -n \
              --arg msg "Job ${CIRCLE_JOB} passed on ${CIRCLE_BRANCH}." \
              --arg ch "$DAILYBOT_DEPLOY_CHANNEL" \
              '{message: $msg, target_channels: [$ch]}')
            curl --fail --show-error --connect-timeout 10 --max-time 30 \
              'https://api.dailybot.com/v1/send-message/' \
              -H "X-API-KEY: $DAILYBOT_API_KEY" \
              -H 'Content-Type: application/json' \
              -d "$BODY" \
              || echo "Dailybot notification failed; continuing."
workflows:
  build-and-notify:
    jobs:
      - notify-dailybot:
          context: dailybot-org  # store DAILYBOT_API_KEY + DAILYBOT_DEPLOY_CHANNEL here

Bash / cron

# /etc/cron.d/dailybot-nightly-report
# Every day at 23:00 UTC, file a summary standup.
SHELL=/bin/bash
# Source DAILYBOT_API_KEY from your host secret store; never hard-code it here.
0 23 * * * app source /etc/dailybot.env && curl --fail --show-error --connect-timeout 10 --max-time 30 \
  'https://api.dailybot.com/v1/agent-reports/' \
  -H "X-API-KEY: $DAILYBOT_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"summary":"Nightly batch completed.","milestone":false}' \
  >> /var/log/dailybot-report.log 2>&1

Kubernetes CronJob

# k8s/dailybot-nightly.yaml (fragment)
apiVersion: batch/v1
kind: CronJob
metadata:
  name: dailybot-nightly-report
spec:
  schedule: "0 23 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: dailybot
              image: curlimages/curl:8.10.1
              envFrom:
                - secretRef: { name: dailybot-secrets }   # exposes DAILYBOT_API_KEY
              command: ["sh", "-c"]
              args:
                - |
                  curl --fail --show-error --connect-timeout 10 --max-time 30 \
                    'https://api.dailybot.com/v1/agent-reports/' \
                    -H "X-API-KEY: $DAILYBOT_API_KEY" \
                    -H 'Content-Type: application/json' \
                    -d '{"summary":"Nightly maintenance ran cleanly.","milestone":false}'

Prefer a CLI?

The Dailybot CLI is a Python package published on PyPI: pypi.org/project/dailybot-cli. It wraps the same endpoints — `dailybot chat send …` calls `/v1/send-message/`, `dailybot agent update …` calls `/v1/agent-reports/`. For CI/CD, we recommend the curl recipes above (no runtime install, one HTTP call, always up-to-date with the API). The CLI is the better fit for local dev and long-running agent processes.

# Recommended — universal one-liner (macOS, Linux, WSL, Git Bash)
curl -sSL https://cli.dailybot.com/install.sh | bash

# Isolated Python env via pipx
pipx install dailybot-cli

# Or pip
pip install dailybot-cli

# Verify
dailybot --version

Storing DAILYBOT_API_KEY safely

Never commit DAILYBOT_API_KEY to source. Every vendor above ships a first-class secrets facility — GitHub secrets, GitLab masked/protected variables, CircleCI contexts, Kubernetes secrets, systemd EnvironmentFile= for cron. Rotate the key from your Dailybot dashboard the moment a shared credential leaves the org.