Simplifyd Cloud

CI/CD usage

Use edge in automated pipelines without interactive prompts.

The edge CLI is designed to work in non-interactive environments — GitHub Actions, GitLab CI, CircleCI, and any other pipeline that runs commands without a TTY.

How the CLI detects CI mode

The CLI checks whether stdin is a terminal:

term.IsTerminal(int(os.Stdin.Fd()))

When stdin is not a terminal (i.e. in a CI runner), all interactive prompts are disabled. Every required value must be supplied via a flag, environment variable, or .edge.json link file. If a required value is missing the CLI exits with a clear error message.

Authentication in CI

Set the CLOUD_TOKEN environment variable instead of running edge auth login:

export CLOUD_TOKEN=<token>

Generate a token scoped to the project and environment you need:

# Run once, locally
edge token create "GitHub Actions" --env production
# Save the printed token to your CI secrets vault

Providing context

Every command that needs a workspace, project, or environment must get those values from one of:

  1. Flags--workspace, --project, --env
  2. .edge.json — commit a .edge.json to your repo root
  3. ~/.simplifyd/config.json — not useful in ephemeral CI environments

The --json flag makes output machine-parseable:

edge deploy up api \
  --workspace acme-corp \
  --project payments \
  --env production \
  --json

GitHub Actions example

name: Deploy

on:
  push:
    branches: [main]

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

      - name: Install edge CLI
        run: go install github.com/simplifyd-systems/cloud-cli/cmd/edge@latest

      - name: Deploy API
        env:
          CLOUD_TOKEN: ${{ secrets.CLOUD_TOKEN }}
        run: |
          edge deploy up api \
            --workspace ${{ vars.WORKSPACE }} \
            --project ${{ vars.PROJECT }} \
            --env production \
            --json

GitLab CI example

deploy:
  stage: deploy
  image: golang:1.22
  script:
    - go install github.com/simplifyd-systems/cloud-cli/cmd/edge@latest
    - edge deploy up api
        --workspace $WORKSPACE
        --project $PROJECT
        --env production
        --json
  variables:
    CLOUD_TOKEN: $CLOUD_TOKEN
  only:
    - main

Using .edge.json to reduce flag repetition

Commit a .edge.json to your repository root to avoid repeating --workspace, --project, and --env on every command:

{
  "workspace": "acme-corp",
  "project": "payments",
  "env": "production"
}

Your pipeline then becomes:

CLOUD_TOKEN=$SECRET edge deploy up api --json

Deploying multiple services

for svc in api worker scheduler; do
  echo "Deploying $svc..."
  CLOUD_TOKEN=$SECRET edge deploy up $svc \
    --workspace acme-corp --project payments --env production --json
done

Setting variables from CI

CLOUD_TOKEN=$SECRET edge variables set \
  DATABASE_URL=$DB_URL \
  REDIS_URL=$REDIS_URL \
  --workspace acme-corp --project payments --env production

Checking deployment status

The --json flag lets you pipe output to jq for scripting:

STATUS=$(CLOUD_TOKEN=$SECRET edge deploy list api \
  --workspace acme-corp --project payments --env production --json \
  | jq -r '.[0].status')

echo "Latest deployment status: $STATUS"

Exit codes

edge exits with:

CodeMeaning
0Success
1Error (API error, missing required flag, auth failure, etc.)