diff --git a/src/cli.js b/src/cli.js index c120ec3..c053713 100755 --- a/src/cli.js +++ b/src/cli.js @@ -4,7 +4,7 @@ import { Command } from "commander"; import { providersList, providersAdd, providersRemove, providersDefaultCmd } from "./commands/providers.js"; import { doctor } from "./commands/doctor.js"; import { deploy } from "./commands/deploy.js"; -import { appsList, appsInfo, appsDestroy } from "./commands/apps.js"; +import { appsList, appsInfo, appsCreate, appsDestroy } from "./commands/apps.js"; import { configShow, configSet, @@ -64,29 +64,34 @@ providersCmd program .command("deploy [name] [path]") - .description("Deploy an app from a Dockerfile (name auto-generated if omitted)") - .option("--compute ", "Provider for compute") - .option("--registry ", "Provider for container registry") - .option("-t, --tag ", "Image tag (default: deploy-)") - .option("-e, --env ", "Set env vars (KEY=VALUE)") - .option( - "--regions ", - "Comma-separated location hints (wnam,enam,sam,weur,eeur,apac,oc,afr,me)" - ) - .option("-i, --instances ", "Instances per region", parseInt) - .option("--port ", "Container port", parseInt) - .option("--sleep ", "Sleep after idle (e.g. 5m, 30s, never)", "30s") - .option("--instance-type ", "Instance type (lite, base, standard, large)") - .option("--vcpu ", "vCPU allocation (e.g. 0.0625, 0.5, 1, 2)", parseFloat) - .option("--memory ", "Memory in MiB (e.g. 256, 512, 1024)", parseInt) - .option("--disk ", "Disk in MB (e.g. 2000, 5000)", parseInt) - .option("--dns ", "Provider for DNS records") - .option("--no-observability", "Disable Workers observability/logs") - .option("--db ", "Database provider (for --backup-db)") - .option("--pre-deploy ", "Run command in container before push (e.g. migrations)") - .option("--backup-db", "Backup database before deploying") + .description("Build and deploy an app (portal: app must exist — create with apps create)") + .option("-t, --tag ", "Image tag (default: timestamp)") + .option("--dockerfile ", "Path to Dockerfile (relative to build context)") + .option("--build-secret ", "Docker BuildKit secrets passed to docker build (e.g. id=github_token,env=MY_TOKEN)") .option("--json", "Output result as JSON") .option("-y, --yes", "Skip confirmation prompt") + // BYOC-only options (ignored in portal mode): + .option("--compute ", "BYOC: compute provider") + .option("--registry ", "BYOC: container registry provider") + .option("-e, --env ", "BYOC: set env vars (KEY=VALUE)") + .option("--regions ", "BYOC: location hints (wnam,enam,sam,weur,eeur,apac,oc,afr,me)") + .option("-i, --instances ", "BYOC: instances per region", parseInt) + .option("--port ", "BYOC: container port", parseInt) + .option("--sleep ", "BYOC: sleep after idle (e.g. 5m, 30s, never)") + .option("--instance-type ", "BYOC: instance type (lite, basic, standard, standard-2..4, dev)") + .option("--vcpu ", "BYOC: vCPU allocation", parseFloat) + .option("--memory ", "BYOC: memory in MiB", parseInt) + .option("--disk ", "BYOC: disk in MB", parseInt) + .option("--dns ", "BYOC: DNS provider") + .option("--no-observability", "BYOC: disable Workers observability/logs") + .option("--db ", "BYOC: database provider (for --backup-db)") + .option("--pre-deploy ", "BYOC: run command in container before push") + .option("--backup-db", "BYOC: backup database before deploying") + .option("--gateway", "BYOC: deploy behind gateway") + .option("--hostname ", "BYOC: gateway hostname") + .option("--groups ", "BYOC: gateway access groups (comma-separated)") + .option("--match-mode ", "BYOC: gateway group match mode (any|all)", "any") + .option("--path-prefix ", "BYOC: gateway path prefix", "/") .action(deploy); // --- Apps (topic root = list) --- @@ -100,6 +105,32 @@ apps .option("--json", "Output as JSON") .action(appsList); +apps + .command("create ") + .description("Register a new app with its configuration (portal mode)") + .option("--compute