CLI Reference

Complete command reference for the NextDeploy CLI.

Global Flags

All commands support these flags:

FlagShortDescription
--config-cPath to config file (default: nextdeploy.yml)
--verbose-vEnable verbose logging
--help-hShow help for command
--versionShow version information

Core Commands

nextdeploy init

Initialize a Next.js project for deployment.

nextdeploy init [flags]

What it does:

  • • Creates nextdeploy.yml configuration
  • • Analyzes Next.js Route Plan
  • • Prepares release/ execution environment

Example:

nextdeploy init
nextdeploy init --template minimal

nextdeploy build

Build a native deployment bundle for your application.

nextdeploy build [flags]

What it does:

  • • Builds deployment bundle with smart tagging
  • • Tags with git commit hash
  • • Optionally pushes to registry

Common flags:

  • --no-cache - Build without cache
  • --push - Push to registry after build

Examples:

# Basic build
nextdeploy build

# Build and push
nextdeploy build --push

# Production build (no cache)
NODE_ENV=production nextdeploy build --no-cache

nextdeploy ship

Deploy your application to a server.

nextdeploy ship [flags]

What it does:

  1. Verifies server connectivity
  2. Transfers configuration files
  3. Synchronizes release bundle
  4. Executes zero-downtime port swap
  5. Verifies deployment

Common flags:

  • --serve - Configure Caddy for HTTPS
  • --bluegreen - Use blue-green deployment
  • --dry-run - Simulate deployment

Examples:

# Basic deployment
nextdeploy ship

# With HTTPS setup
nextdeploy ship --serve

# Blue-green deployment
nextdeploy ship --bluegreen

nextdeploy logs

View application logs.

nextdeploy logs [flags]

Common flags:

  • --follow - Follow log output in real-time
  • --tail N - Show last N lines
  • --since TIME - Show logs since timestamp

Examples:

# View last 100 lines
nextdeploy logs

# Follow logs in real-time
nextdeploy logs --follow

# Last 50 lines
nextdeploy logs --tail 50

nextdeploy status

Check deployment status.

Application: myapp
Status: running
Uptime: 2d 5h 32m
Health: healthy
CPU: 12%
Memory: 256MB / 1GB

Other Commands

  • nextdeploy restart - Gracefully restart the application
  • nextdeploy stop - Stop the application
  • nextdeploy start - Start the application
  • nextdeploy rollback [version] - Rollback to previous version
  • nextdeploy validate - Validate configuration

Complete Deployment Workflow

# 1. Initialize
nextdeploy init

# 2. Configure
vim nextdeploy.yml

# 3. Build
nextdeploy build

# 4. Deploy
nextdeploy ship --serve

# 5. Check status
nextdeploy status

# 6. View logs
nextdeploy logs --follow