Sign in
On this page
Documentationmodcloud CLICI and automation

CI and automation

Use modcloud CLI and a token to automate commands in CI environments.

Use a token in automation

Browser authorization is not suitable for a non-interactive job. Store an API token in your CI secret manager and expose it to the process asMODVC_TOKEN. The CLI checks this variable after an explicit--token argument and before the saved token.

GitHub Actions example

Create a repository secret named MODVC_TOKEN and use it in the deploy step:

Code
name: Deploy
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Install modcloud CLI
        run: curl -fsSL https://modcloud.dev/cli/install.sh | sh
      - name: Deploy slot
        run: modvc deploy 1 --yes
        env:
          MODVC_TOKEN: ${{ secrets.MODVC_TOKEN }}

Skip confirmation prompts

Pass --yes when a command could request confirmation. For example, deployment may ask before applying changed settings; the flag accepts that prompt automatically.

Code
modvc deploy 1 --yes