CLI Reference

Deploy and manage your projects from the command line with the CupaDev CLI.

Installation

Install with npm

npm install -g cupadev-cli

Alternative Installation Methods

Using Yarn:

yarn global add cupadev-cli

Using pnpm:

pnpm add -g cupadev-cli

Verify Installation

cupadev --version

Authentication

Before using the CLI, you need to authenticate:

Login

cupadev login

This opens your browser for authentication. After login, your credentials are stored locally.

Login with Token

cupadev login --token YOUR_API_TOKEN

For CI/CD environments, use token-based authentication.

Commands

cupadev deploy

Deploy your project to CupaDev.

# Deploy to production
cupadev deploy --prod

# Deploy preview
cupadev deploy

# Deploy specific directory
cupadev deploy ./dist

# Deploy with build command
cupadev deploy --build "npm run build"

Options:

  • --prod - Deploy to production
  • --build - Custom build command
  • --name - Project name
  • --force - Force deployment
cupadev list

List all your projects and deployments.

cupadev list
cupadev logs

Stream deployment logs in real-time.

# Stream logs for latest deployment
cupadev logs

# Follow logs (like tail -f)
cupadev logs --follow

# Logs for specific deployment
cupadev logs deployment_id
cupadev env

Manage environment variables.

# List environment variables
cupadev env ls

# Add variable
cupadev env add KEY value --production

# Remove variable
cupadev env rm KEY

# Pull variables to .env file
cupadev env pull

# Push variables from .env file
cupadev env push
cupadev domains

Manage custom domains.

# List domains
cupadev domains ls

# Add domain
cupadev domains add example.com

# Remove domain
cupadev domains rm example.com

# Verify domain
cupadev domains verify example.com
cupadev projects

Manage projects.

# List projects
cupadev projects ls

# Create project
cupadev projects create my-project

# Delete project
cupadev projects rm my-project

# Link current directory to project
cupadev link
cupadev rollback

Rollback to a previous deployment.

# Rollback to previous deployment
cupadev rollback

# Rollback to specific deployment
cupadev rollback deployment_id
cupadev dev

Run development server with production-like environment.

cupadev dev

Automatically syncs environment variables from CupaDev.

cupadev whoami

Show current authenticated user.

cupadev whoami
cupadev logout

Log out and remove stored credentials.

cupadev logout

Global Flags

These flags work with all commands:

FlagDescription
--help, -hShow help for command
--version, -vShow CLI version
--debugEnable debug output
--no-colorDisable colored output
--tokenAPI token for authentication

CI/CD Integration

Use the CLI in your CI/CD pipelines:

GitHub Actions

name: Deploy to CupaDev

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Deploy
        run: |
          npm install -g cupadev-cli
          cupadev deploy --prod --token ${{ secrets.CUPADEV_TOKEN }}

GitLab CI

deploy:
  stage: deploy
  script:
    - npm install -g cupadev-cli
    - cupadev deploy --prod --token $CUPADEV_TOKEN
  only:
    - main

Configuration File

Create a cupadev.json in your project root:

{
  "name": "my-project",
  "framework": "nextjs",
  "buildCommand": "npm run build",
  "outputDirectory": ".next",
  "installCommand": "npm install",
  "nodeVersion": "18.x",
  "regions": ["us-east-1", "eu-west-1"],
  "env": {
    "NODE_ENV": "production"
  }
}

Troubleshooting

Command not found: cupadev

Make sure the CLI is installed globally and your PATH includes npm global bin directory.

npm install -g cupadev-cli
Authentication failed

Try logging in again or use a fresh API token:

cupadev logout && cupadev login
Deployment fails silently

Enable debug mode to see detailed logs:

cupadev deploy --debug