API Reference

Complete command-line reference for SCF.

Commands

scf init

Initialize a new SCF project.

bash
npx scf-deploy init [options]

Options:

  • -f, --force - Overwrite existing config file
  • -y, --yes - Skip prompts and use default values

Examples:

bash
# Interactive initialization
npx scf-deploy init

# Quick initialization with defaults
npx scf-deploy init --yes

# Overwrite existing config
npx scf-deploy init --force

scf deploy

Deploy your static site to AWS.

bash
npx scf-deploy deploy [options]

Options:

  • -e, --env <environment> - Environment name (dev, staging, prod, etc.)
  • -c, --config <path> - Config file path (default: scf.config.ts)
  • -p, --profile <profile> - AWS profile name
  • --dry-run - Preview without actual upload
  • --no-cloudfront - Skip CloudFront deployment
  • --force - Force full deployment (ignore state, disable incremental)
  • --skip-cache - Skip CloudFront cache invalidation
  • --skip-build - Skip automatic build

Examples:

bash
# Basic deployment
npx scf-deploy deploy

# Deploy to specific environment
npx scf-deploy deploy --env prod

# Use specific AWS profile
npx scf-deploy deploy --profile my-aws-profile

# Use custom config file
npx scf-deploy deploy --config custom.config.ts

# Preview mode (no actual changes)
npx scf-deploy deploy --dry-run

# Deploy S3 only (skip CloudFront)
npx scf-deploy deploy --no-cloudfront

# Force full redeployment
npx scf-deploy deploy --force

# Deploy without cache invalidation
npx scf-deploy deploy --skip-cache

# Skip automatic build
npx scf-deploy deploy --skip-build

scf remove

Remove deployed AWS resources.

bash
npx scf-deploy remove [options]

Options:

  • -e, --env <environment> - Environment name
  • -c, --config <path> - Config file path
  • -p, --profile <profile> - AWS profile name
  • -f, --force - Skip confirmation prompt
  • --keep-bucket - Keep S3 bucket (delete files only)
  • --keep-distribution - Keep CloudFront distribution
  • --keep-certificate - Keep ACM certificate
  • --keep-hosted-zone - Keep Route53 hosted zone

Examples:

bash
# Remove resources (with confirmation)
npx scf-deploy remove

# Remove specific environment
npx scf-deploy remove --env dev

# Force removal without confirmation
npx scf-deploy remove --force

# Keep S3 bucket, delete files only
npx scf-deploy remove --keep-bucket

# Keep CloudFront distribution
npx scf-deploy remove --keep-distribution

# Keep multiple resources
npx scf-deploy remove --keep-bucket --keep-distribution --keep-certificate

scf status

Check current deployment status.

bash
npx scf-deploy status [options]

Options:

  • -e, --env <environment> - Environment name
  • -d, --detailed - Show detailed information
  • --json - Output in JSON format

Examples:

bash
# Basic status check
npx scf-deploy status

# Check specific environment status
npx scf-deploy status --env prod

# Show detailed information
npx scf-deploy status --detailed

# Output in JSON format (for CI/CD integration)
npx scf-deploy status --json

scf recover

Recover state file. Search for deployed resources in AWS and regenerate local state file.

bash
npx scf-deploy recover [options]

Options:

  • -e, --env <environment> - Environment name
  • -c, --config <path> - Config file path
  • -p, --profile <profile> - AWS profile name
  • -f, --force - Overwrite existing state file
  • -a, --all - Show all SCF managed resources

Examples:

bash
# Recover state file
npx scf-deploy recover

# Recover specific environment
npx scf-deploy recover --env prod

# Overwrite existing state file
npx scf-deploy recover --force

# Search all SCF managed resources
npx scf-deploy recover --all

Global Options

Available options for all commands:

  • --help - Show help
  • --version - Show version

Environment Variables

SCF supports the following environment variables:

VariableDescription
AWS_ACCESS_KEY_IDAWS access key ID
AWS_SECRET_ACCESS_KEYAWS secret access key
AWS_SESSION_TOKENSession token for temporary credentials
AWS_PROFILEAWS profile name
AWS_REGIONAWS region

Next Steps

4 min readLast updated: 2025-11-25