Aidelly Docs
CLI

CI/CD Integration

Use the Aidelly CLI in GitHub Actions and other CI/CD pipelines.

Post release announcements, changelogs, and other automated content directly from your CI/CD pipeline.

GitHub Actions

Announce on release

name: Announce release

on:
  release:
    types: [published]

jobs:
  announce:
    runs-on: ubuntu-latest
    steps:
      - name: Post release announcement
        env:
          AIDELLY_API_KEY: ${{ secrets.AIDELLY_API_KEY }}
          AIDELLY_WORKSPACE_ID: ${{ secrets.AIDELLY_WORKSPACE_ID }}
          AIDELLY_BRAND_ID: ${{ secrets.AIDELLY_BRAND_ID }}
        run: |
          npx @aidelly/cli post \
            --content "🚀 ${{ github.event.release.name }} just shipped! ${{ github.event.release.body }}" \
            --platforms linkedin,x \
            --publish-now

Schedule weekly digest

name: Weekly digest

on:
  schedule:
    - cron: '0 9 * * MON' # Every Monday at 9am UTC

jobs:
  digest:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Generate and post digest
        env:
          AIDELLY_API_KEY: ${{ secrets.AIDELLY_API_KEY }}
          AIDELLY_BRAND_ID: ${{ secrets.AIDELLY_BRAND_ID }}
        run: |
          CONTENT=$(cat scripts/weekly-digest.txt)
          npx @aidelly/cli post \
            --content "$CONTENT" \
            --platforms linkedin \
            --publish-now

Setting up secrets

In your GitHub repository:

  1. Go to Settings → Secrets and variables → Actions
  2. Add:
    • AIDELLY_API_KEY — your API key (starts with aidelly_live_)
    • AIDELLY_WORKSPACE_ID — your workspace UUID
    • AIDELLY_BRAND_ID — your brand UUID

Idempotency in CI/CD

Each CI run should use a stable idempotency key based on the run identifier. The CLI generates keys automatically, but if you're calling the API directly in scripts:

# Stable key for this specific release
IDEM_KEY="release-${{ github.run_id }}-${{ github.sha }}"

This ensures that if a step retries due to a transient failure, the post won't be created twice.

Error handling

set -e   # Exit on first error

npx @aidelly/cli post \
  --content "$ANNOUNCEMENT" \
  --platforms linkedin \
  --publish-now || {
    echo "Failed to post announcement"
    exit 1
  }

For non-blocking announcements (don't fail the pipeline if the post fails):

npx @aidelly/cli post \
  --content "$ANNOUNCEMENT" \
  --platforms linkedin \
  --publish-now || echo "Post failed (non-blocking)"

Other CI systems

The CLI works in any environment that has Node.js available. Set the same environment variables (AIDELLY_API_KEY, AIDELLY_WORKSPACE_ID, AIDELLY_BRAND_ID) and use npx @aidelly/cli or install globally first.

CircleCI:

- run:
    name: Post release announcement
    command: npx @aidelly/cli post --content "$ANNOUNCEMENT" --platforms x --publish-now

GitLab CI:

announce:
  script:
    - npx @aidelly/cli post --content "$ANNOUNCEMENT" --platforms linkedin --publish-now