CLI Referenceaerostack deploy

aerostack deploy

Deploy your project. Supports two modes: deploy to Aerostack’s managed cloud, or deploy directly to your own Cloudflare account.

Usage

aerostack deploy [service-name] [flags]

Flags

FlagDefaultDescription
-e, --envstagingTarget environment: staging or production
--allfalseDeploy all services in the project
--cloudflarefalseDeploy to your Cloudflare account instead of Aerostack
--publicfalseMake the service publicly accessible (no auth required)
--privatefalseRequire authentication for all requests
--sync-secretsfalsePush .dev.vars secrets to the target environment before deploying

Deploy to Aerostack (default)

Aerostack hosts and manages your Worker on your behalf. Requires aerostack login.

# Deploy to staging
aerostack deploy
 
# Deploy to production
aerostack deploy --env production
 
# Deploy all services
aerostack deploy --all --env production
 
# Sync secrets from .dev.vars, then deploy
aerostack deploy --sync-secrets --env production

After deploy, the CLI prints your service URL and test instructions.

Deploy to your Cloudflare account

Use --cloudflare to deploy directly to your own Cloudflare account via Wrangler. Requires CLOUDFLARE_API_TOKEN in your environment or npx wrangler login.

# Deploy to Cloudflare (staging)
aerostack deploy --cloudflare
 
# Deploy to Cloudflare production
aerostack deploy --cloudflare --env production

When using --cloudflare, Cloudflare resources (D1, KV, R2, Queues) must be created first. Run aerostack resources create or let the deploy command create them automatically.

Deploy an MCP server

aerostack deploy mcp [file] [flags]
FlagDefaultDescription
-e, --envproductionTarget environment
--slug(directory name)Unique slug for the MCP server
# Deploy bundled MCP server (default: dist/index.js)
aerostack deploy mcp
 
# Deploy with explicit slug
aerostack deploy mcp dist/index.js --slug my-notion-mcp

Visibility flags

# Make a service fully public (no API key required)
aerostack deploy --public
 
# Require authentication (default behavior)
aerostack deploy --private

Full production workflow

# 1. Deploy to staging first
aerostack deploy --env staging
 
# 2. Test staging
curl https://your-staging-url.aerostack.dev/api/health
 
# 3. Deploy to production with secrets sync
aerostack deploy --env production --sync-secrets