#!/usr/bin/env node import { Command, Option } from "commander"; import { createChangeSet, deleteStack, executeChangeSet, upload, type CreateChangeSetOptions, type DeleteStackOptions, type UploadOptions, } from "./commands.js"; import { installConfigHooks } from "./internal/install-config-hooks.js"; const ProgramName = "cfn-deploy"; const program = new Command(); program .name(ProgramName) .description( "Create, update and delete CloudFormation stacks with streaming logs.", ) .configureHelp({ showGlobalOptions: true }) .addOption( new Option("--access-key-id ", "the AWS access key ID").env( "AWS_ACCESS_KEY_ID", ), ) .addOption( new Option("--secret-access-key ", "the AWS secret access key").env( "AWS_SECRET_ACCESS_KEY", ), ) .addOption( new Option("--session-token ", "the AWS session token").env( "AWS_SESSION_TOKEN", ), ) .addOption(new Option("--region ", "the AWS region").env("AWS_REGION")) .option("--config ", "path to the config file", `.${ProgramName}.json`) .option("--no-config", "skip trying to load a config file") .addOption( new Option("-p, --profile ", "the profile to use with aws-vault").env( "AWS_VAULT", ), ); program .command("upload") .description("upload a template and associated assets to S3") .argument("