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 --forcescf 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-buildscf 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-certificatescf 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 --jsonscf 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 --allGlobal Options
Available options for all commands:
--help- Show help--version- Show version
Environment Variables
SCF supports the following environment variables:
| Variable | Description |
|---|---|
AWS_ACCESS_KEY_ID | AWS access key ID |
AWS_SECRET_ACCESS_KEY | AWS secret access key |
AWS_SESSION_TOKEN | Session token for temporary credentials |
AWS_PROFILE | AWS profile name |
AWS_REGION | AWS region |
Next Steps
- Configuration - Configuration options reference
- Examples - See CLI usage examples
- Troubleshooting - Solve CLI issues