CLI Reference
Complete command reference for the NextDeploy CLI.
Global Flags
All commands support these flags:
| Flag | Short | Description |
|---|---|---|
--config | -c | Path to config file (default: nextdeploy.yml) |
--verbose | -v | Enable verbose logging |
--help | -h | Show help for command |
--version | Show version information |
Core Commands
nextdeploy init
Initialize a Next.js project for deployment.
nextdeploy init [flags]What it does:
- • Creates
nextdeploy.ymlconfiguration - • Analyzes Next.js Route Plan
- • Prepares
release/execution environment
Example:
nextdeploy init
nextdeploy init --template minimalnextdeploy 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-cachenextdeploy ship
Deploy your application to a server.
nextdeploy ship [flags]What it does:
- Verifies server connectivity
- Transfers configuration files
- Synchronizes release bundle
- Executes zero-downtime port swap
- 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 --bluegreennextdeploy 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 50nextdeploy status
Check deployment status.
Application: myapp
Status: running
Uptime: 2d 5h 32m
Health: healthy
CPU: 12%
Memory: 256MB / 1GBOther Commands
nextdeploy restart- Gracefully restart the applicationnextdeploy stop- Stop the applicationnextdeploy start- Start the applicationnextdeploy rollback [version]- Rollback to previous versionnextdeploy 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