AgentStack
SKILL verified MIT Self-run

Scripting

skill-acquia-acquia-skills-scripting · by acquia

Use when running acli commands non-interactively in scripts, CI/CD pipelines, or automation where interactive prompts must be suppressed.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add skill-acquia-acquia-skills-scripting

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Scripting? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Scripting & Automation with Acquia CLI

Use when:

  • Automating acli commands in shell scripts
  • Integrating acli into CI/CD pipelines
  • Running acli non-interactively

Use acli in scripts, CI/CD pipelines, and automation workflows to manage Acquia Cloud resources programmatically.


Non-Interactive Commands

All acli commands can run non-interactively by providing options. This is essential for scripts and CI/CD.

Basic pattern

# Interactive - prompts for missing information
acli ide:create

# Non-interactive - provides all info upfront
acli ide:create \
  --application=abc123 \
  --label="Automated IDE"

Common options

# No prompts - fails if info is missing
acli  --no-interaction

# Don't wait for async operations
acli  --no-wait

# Skip confirmations
acli  --yes

Simple Automation Examples

Example 1: Deploy on schedule

#!/bin/bash
# deploy.sh - Deploy to staging nightly

BRANCH="develop"
ENVIRONMENT="staging"
ENV_ID=""

acli api:environments:code-switch $ENV_ID $BRANCH

# Verify Drupal status
acli remote:drush status

Run via cron:

# crontab -e
# Deploy every night at 2am
0 2 * * * /path/to/deploy.sh >> /tmp/deploy.log 2>&1

Example 2: Cache clearing workflow

#!/bin/bash
# cache-clear.sh - Clear caches across environments

set -e  # Exit on any error

acli remote:drush cr
echo "Caches cleared!"

CI/CD Integration

GitHub Actions

Deploy on push to main:

# .github/workflows/deploy.yml
name: Deploy to Acquia

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Install acli
        run: |
          curl -fsSL https://github.com/acquia/cli/releases/latest/download/acli \
            -o /usr/local/bin/acli
          chmod +x /usr/local/bin/acli
      
      - name: Authenticate
        env:
          ACQUIA_KEY: ${{ secrets.ACQUIA_KEY }}
          ACQUIA_SECRET: ${{ secrets.ACQUIA_SECRET }}
        run: |
          mkdir -p ~/.acquia
          cat > ~/.acquia/credentials.json  ~/.acquia/credentials.json > $LOGFILE 2>&1

Send notifications

#!/bin/bash

SLACK_WEBHOOK="$SLACK_WEBHOOK_URL"

send_slack() {
    curl -X POST $SLACK_WEBHOOK \
        -H 'Content-Type: application/json' \
        -d "{
            \"text\": \"Acquia deployment: $1\",
            \"channel\": \"#deployments\"
        }"
}

if acli api:environments:code-switch $ENV_ID main; then
    send_slack "✓ Production deployment successful"
else
    send_slack "✗ Production deployment failed"
    exit 1
fi

Advanced: API Key Authentication

For automation on servers, use API keys instead of browser authentication.

Generate API credentials

In Acquia Cloud UI:

  1. Go to Settings → API Tokens
  2. Generate a new token
  3. Copy the Key and Secret

Use with acli

# Method 1: Environment variables
export ACQUIA_KEY="your-key-here"
export ACQUIA_SECRET="your-secret-here"
acli api:applications:list

# Method 2: Credentials file
mkdir -p ~/.acquia
cat > ~/.acquia/credentials.json <<EOF
{
  "acquia-cloud-api": {
    "key": "your-key-here",
    "secret": "your-secret-here"
  }
}
EOF

acli api:applications:list

Secure credential management

# Option 1: AWS Secrets Manager
aws secretsmanager get-secret-value --secret-id acquia-cli-key

# Option 2: HashiCorp Vault
vault kv get secret/acquia/cli-key

# Option 3: GitHub Secrets (for Actions)
# Set ACQUIA_KEY and ACQUIA_SECRET as repository secrets

Best Practices

  1. Use --no-interaction — Always pass this in scripts to prevent prompts from blocking the process.
  2. Use set -e — Exit immediately on any error so failures don't silently continue.
  3. Store credentials securely — Use environment variables or secrets managers, never hardcode.
  4. Use app:task-wait — After async operations, wait for completion before the next step.

Troubleshooting

Authentication fails in CI

Set the ACLI_NO_INTERACTION environment variable and supply credentials explicitly:

export ACLI_NO_INTERACTION=1
export ACLI_KEY=your-api-key
export ACLI_SECRET=your-api-secret
acli api:applications:list

Command hangs waiting for input

Always pass --no-interaction in scripts:

acli ide:create --application=abc123 --label="CI IDE" --no-interaction

Exit code not propagated correctly

Use set -e at the top of your script:

#!/bin/bash
set -e
acli auth:login --no-interaction
acli api:environments:code-switch $ENV_ID main

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.