UNPKG

vercel

Version:

The command-line interface for Vercel

2,069 lines (2,053 loc) 206 kB
import { createRequire as __createRequire } from 'node:module'; import { fileURLToPath as __fileURLToPath } from 'node:url'; import { dirname as __dirname_ } from 'node:path'; const require = __createRequire(import.meta.url); const __filename = __fileURLToPath(import.meta.url); const __dirname = __dirname_(__filename); import { metricsCommand } from "./chunk-IFATV36R.js"; import { routesCommand } from "./chunk-JFVGRFME.js"; import { alertsCommand } from "./chunk-TZMIHH5D.js"; import { devCommand } from "./chunk-ZAAKSLHC.js"; import { activityCommand } from "./chunk-CQANJIEC.js"; import { listCommand } from "./chunk-4PSOOFYO.js"; import { buildCommand, pullCommand } from "./chunk-ZKKIBUCU.js"; import { envCommand } from "./chunk-X775BOSL.js"; import { confirmOption, forceOption, formatOption, jsonOption, limitOption, nextOption, yesOption } from "./chunk-4GQQJY5Y.js"; import { packageName } from "./chunk-UGXBNJMO.js"; import { output_manager_default } from "./chunk-ZQKJVHXY.js"; // src/commands/deploy/command.ts var deprecatedArchiveSplitTgz = "split-tgz"; var initSubcommand = { name: "init", aliases: [], description: "Create a manual deployment that can be continued later", hidden: true, arguments: [], options: [ { ...forceOption, description: "Force a new deployment even if nothing has changed" }, { name: "with-cache", shorthand: null, type: Boolean, deprecated: false, description: 'Retain build cache when using "--force"' }, { name: "public", shorthand: "p", type: Boolean, deprecated: false, description: "Deployment is public (`/_src`) is exposed)" }, { name: "env", shorthand: "e", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)" }, { name: "build-env", shorthand: "b", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)" }, { name: "meta", shorthand: "m", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)" }, { name: "regions", shorthand: null, type: String, argument: "REGION", deprecated: false, description: "Set default regions to enable the deployment on" }, { name: "prod", shorthand: null, type: Boolean, deprecated: false, description: "Create a production deployment (shorthand for `--target=production`)" }, { name: "archive", shorthand: null, type: String, argument: "FORMAT", deprecated: false, description: "Compress the deployment code into an archive before uploading it" }, { name: "skip-domain", shorthand: null, type: Boolean, deprecated: false, description: "Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later" }, { ...yesOption, description: "Use default options to skip all prompts" }, { name: "target", shorthand: null, type: String, argument: "TARGET", deprecated: false, description: "Specify the target deployment environment" }, formatOption, jsonOption, confirmOption, { name: "functions-beta", shorthand: null, type: Boolean, deprecated: false // No description — keeps it hidden from --help output }, { name: "no-functions-beta", shorthand: null, type: Boolean, deprecated: false // No description — keeps it hidden from --help output } ], examples: [ { name: "Create a manual deployment", value: "vercel deploy init" }, { name: "Create a manual production deployment", value: "vercel deploy init --prod" } ] }; var continueSubcommand = { name: "continue", aliases: [], description: "Continue a manual deployment by uploading build outputs", hidden: true, arguments: [], options: [ { name: "id", shorthand: null, type: String, argument: "ID", deprecated: false, description: "The deployment ID to continue (e.g. dpl_xxx)" }, { name: "archive", shorthand: null, type: String, argument: "FORMAT", deprecated: false, description: "Compress the deployment code into an archive before uploading it" }, { name: "error", shorthand: null, type: String, argument: "MESSAGE", deprecated: false, description: "Mark the deployment as errored with a message" } ], examples: [ { name: "Continue a deployment by ID", value: "vercel deploy continue --id dpl_xxx" } ] }; var deployCommand = { name: "deploy", aliases: [], description: "Deploy your project to Vercel. The `deploy` command is the default command for the Vercel CLI, and can be omitted (`vc deploy my-app` equals `vc my-app`).", arguments: [ { name: "project-path", required: false } ], subcommands: [initSubcommand, continueSubcommand], options: [ { ...forceOption, description: "Force a new deployment even if nothing has changed" }, { name: "with-cache", shorthand: null, type: Boolean, deprecated: false, description: 'Retain build cache when using "--force"' }, { name: "public", shorthand: "p", type: Boolean, deprecated: false, description: "Deployment is public (`/_src`) is exposed)" }, { name: "env", shorthand: "e", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Specify environment variables during run-time (e.g. `-e KEY1=value1 -e KEY2=value2`)" }, { name: "build-env", shorthand: "b", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Specify environment variables during build-time (e.g. `-b KEY1=value1 -b KEY2=value2`)" }, { name: "meta", shorthand: "m", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Specify metadata for the deployment (e.g. `-m KEY1=value1 -m KEY2=value2`)" }, { name: "regions", shorthand: null, type: String, argument: "REGION", deprecated: false, description: "Set default regions to enable the deployment on" }, { name: "prebuilt", shorthand: null, type: Boolean, deprecated: false, description: "Use in combination with `vc build`. Deploy an existing build" }, { name: "prod", shorthand: null, type: Boolean, deprecated: false, description: "Create a production deployment (shorthand for `--target=production`)" }, { name: "archive", shorthand: null, type: String, argument: "FORMAT", deprecated: false, description: "Compress the deployment code into an archive before uploading it" }, { name: "no-wait", shorthand: null, type: Boolean, deprecated: false, description: "Don't wait for the deployment to finish" }, { name: "skip-domain", shorthand: null, type: Boolean, deprecated: false, description: "Disable the automatic promotion (aliasing) of the relevant domains to a new production deployment. You can use `vc promote` to complete the domain-assignment process later" }, { ...yesOption, description: "Use default options to skip all prompts" }, { name: "logs", shorthand: "l", type: Boolean, deprecated: false, description: "Print the build logs" }, { name: "guidance", shorthand: null, type: Boolean, deprecated: false, description: "Receive command suggestions once deployment is complete" }, { name: "no-logs", shorthand: null, type: Boolean, deprecated: true, description: "Do not print the build logs" }, { name: "name", shorthand: "n", type: String, deprecated: true }, { name: "no-clipboard", shorthand: null, type: Boolean, deprecated: true }, { name: "target", shorthand: null, type: String, argument: "TARGET", deprecated: false, description: "Specify the target deployment environment" }, formatOption, jsonOption, confirmOption, { name: "functions-beta", shorthand: null, type: Boolean, deprecated: false // No description — keeps it hidden from --help output }, { name: "no-functions-beta", shorthand: null, type: Boolean, deprecated: false // No description — keeps it hidden from --help output } ], examples: [ { name: "Deploy the current directory", value: "vercel" }, { name: "Deploy a custom path", value: "vercel /usr/src/project" }, { name: "Deploy with run-time Environment Variables", value: "vercel -e NODE_ENV=production" }, { name: "Deploy with prebuilt outputs", value: ["vercel build", "vercel deploy --prebuilt"] }, { name: "Write Deployment URL to a file", value: "vercel > deployment-url.txt" } ] }; // src/commands/link/command.ts var addSubcommand = { name: "add", aliases: [], description: "Add additional Vercel Projects to an existing repository link. Requires an existing repo.json (created by `link --repo`).", arguments: [], options: [ { ...yesOption, description: "Skip questions when adding projects using default scope and settings" } ], examples: [ { name: "Add projects to an existing repository link", value: `${packageName} link add` } ] }; var linkCommand = { name: "link", aliases: [], description: "Link a local directory to a Vercel Project.", arguments: [], subcommands: [addSubcommand], options: [ { name: "repo", description: "Link multiple projects based on Git repository (alpha)", shorthand: "r", type: Boolean, deprecated: false }, { name: "project", description: "Project name or ID to link to (required for non-interactive)", shorthand: "p", argument: "NAME_OR_ID", type: String, deprecated: false }, { name: "team", description: "Scope: team ID or slug (use with --project for non-interactive)", shorthand: null, argument: "TEAM_ID_OR_SLUG", type: String, deprecated: false }, { ...yesOption, description: "Skip questions when setting up new project using default scope and settings" }, confirmOption ], examples: [ { name: "Link current directory to a Vercel Project", value: `${packageName} link` }, { name: "Link current directory with default options and skip questions", value: `${packageName} link --yes` }, { name: "Non-interactive: link to an existing project (CI/agents)", value: `${packageName} link --yes --team <team-id> --project <project-name-or-id>` }, { name: "Link a specific directory to a Vercel Project", value: `${packageName} link --cwd /path/to/project` }, { name: "Link to the current Git repository, allowing for multiple Vercel Projects to be linked simultaneously (useful for monorepos)", value: `${packageName} link --repo` }, { name: "Add additional projects to an existing repository link", value: `${packageName} link add` } ] }; // src/commands/agent/command.ts var agentCommand = { name: "agent", aliases: [], description: "Generate an AGENTS.md file with Vercel deployment best practices", arguments: [ { name: "init", required: false } ], options: [ { ...yesOption, description: "Skip confirmation prompt" } ], examples: [ { name: "Generate AGENTS.md with Vercel best practices", value: `${packageName} agent init` }, { name: "Skip confirmation prompt (useful for CI)", value: `${packageName} agent init --yes` } ] }; // src/commands/ai-gateway/command.ts var createSubcommand = { name: "create", aliases: [], description: "Create a new AI Gateway API key", arguments: [], options: [ { name: "name", shorthand: null, type: String, argument: "NAME", deprecated: false, description: "Human-readable name for the API key" }, { name: "budget", shorthand: null, type: Number, argument: "AMOUNT", deprecated: false, description: "Quota budget amount in dollars (minimum 1)" }, { name: "refresh-period", shorthand: null, type: String, argument: "PERIOD", deprecated: false, description: "Quota refresh cadence: daily, weekly, monthly, or none (default: none)" }, { name: "include-byok", shorthand: null, type: Boolean, deprecated: false, description: "Include BYOK usage in quota (default: false)" } ], examples: [ { name: "Create an API key with defaults", value: `${packageName} ai-gateway api-keys create` }, { name: "Create an API key with a budget", value: `${packageName} ai-gateway api-keys create --name my-key --budget 500 --refresh-period monthly` } ] }; var apiKeysSubcommand = { name: "api-keys", aliases: [], description: "Manage AI Gateway API keys", arguments: [], subcommands: [createSubcommand], options: [], examples: [] }; var aiGatewayCommand = { name: "ai-gateway", aliases: [], description: "Manage AI Gateway resources", arguments: [], subcommands: [apiKeysSubcommand], options: [], examples: [] }; // src/commands/alias/command.ts var setSubcommand = { name: "set", aliases: [], description: "Create a new alias", default: true, arguments: [ { name: "id-or-url", required: true }, { name: "alias", required: true } ], options: [], examples: [] }; var listSubcommand = { name: "list", aliases: ["ls"], description: "Show all aliases", arguments: [], options: [limitOption, nextOption, formatOption], examples: [] }; var removeSubcommand = { name: "remove", aliases: ["rm"], description: "Remove an alias using its hostname", arguments: [ { name: "alias", required: true } ], options: [ { ...yesOption, description: "Skip the confirmation prompt when removing an alias" } ], examples: [] }; var aliasCommand = { name: "alias", aliases: ["aliases", "ln"], description: "Interact with deployment aliases", arguments: [], subcommands: [listSubcommand, removeSubcommand, setSubcommand], options: [], examples: [ { name: "Add a new alias to `my-api.vercel.app`", value: `${packageName} alias set api-ownv3nc9f8.vercel.app my-api.vercel.app` }, { name: "Custom domains work as alias targets", value: `${packageName} alias set api-ownv3nc9f8.vercel.app my-api.com` }, { name: "The subcommand `set` is the default and can be skipped. Protocols in the URLs are unneeded and ignored", value: `${packageName} alias api-ownv3nc9f8.vercel.app my-api.com` } ] }; // src/commands/api/command.ts var listSubcommand2 = { name: "list", aliases: ["ls"], description: "List all available API endpoints", arguments: [], options: [ formatOption, { name: "refresh", shorthand: null, type: Boolean, deprecated: false, description: "Force refresh the cached OpenAPI spec" } ], examples: [ { name: "List all endpoints in table format", value: `${packageName} api ls` }, { name: "List all endpoints as JSON", value: `${packageName} api ls --format json` } ] }; var apiCommand = { name: "api", aliases: [], description: "Make authenticated HTTP requests to the Vercel API", arguments: [ { name: "endpoint", required: false } ], subcommands: [listSubcommand2], options: [ { name: "method", shorthand: "X", type: String, argument: "METHOD", deprecated: false, description: "HTTP method (GET, POST, PUT, PATCH, DELETE). Defaults to GET, or POST if body is provided" }, { name: "field", shorthand: "F", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Add a typed parameter (numbers, booleans parsed). Use @file for file contents" }, { name: "raw-field", shorthand: "f", type: [String], argument: "KEY=VALUE", deprecated: false, description: "Add a string option (no type parsing)" }, { name: "header", shorthand: "H", type: [String], argument: "KEY:VALUE", deprecated: false, description: "Add a custom HTTP header" }, { name: "input", shorthand: null, type: String, argument: "FILE", deprecated: false, description: "Read request body from file (use - for stdin)" }, { name: "paginate", shorthand: null, type: Boolean, deprecated: false, description: "Fetch all pages of results" }, { name: "include", shorthand: "i", type: Boolean, deprecated: false, description: "Include response headers in output" }, { name: "silent", shorthand: null, type: Boolean, deprecated: false, description: "Suppress response output" }, { name: "verbose", shorthand: null, type: Boolean, deprecated: false, description: "Show debug information including full request/response" }, { name: "raw", shorthand: null, type: Boolean, deprecated: false, description: "Output raw JSON without pretty-printing" }, { name: "refresh", shorthand: null, type: Boolean, deprecated: false, description: "Force refresh the cached OpenAPI spec" }, { name: "generate", shorthand: null, type: String, argument: "FORMAT", deprecated: false, description: "Generate output instead of executing (e.g., --generate=curl)" }, { name: "dangerously-skip-permissions", shorthand: null, type: Boolean, deprecated: false, description: "Skip confirmation prompts for DELETE operations (use with caution)" } ], examples: [ { name: "Get current user information", value: `${packageName} api /v2/user` }, { name: "List projects with team scope", value: `${packageName} api /v9/projects --scope my-team` }, { name: "Create a new project", value: `${packageName} api /v10/projects -X POST -F name=my-project` }, { name: "Delete a deployment", value: `${packageName} api /v13/deployments/dpl_abc123 -X DELETE` }, { name: "Paginate through all deployments", value: `${packageName} api /v6/deployments --paginate` }, { name: "Post JSON from file", value: `${packageName} api /v10/projects -X POST --input config.json` }, { name: "Add custom header", value: `${packageName} api /v2/user -H "X-Custom-Header: value"` }, { name: "Interactive mode (select endpoint)", value: `${packageName} api` } ] }; // src/commands/bisect/command.ts var bisectCommand = { name: "bisect", aliases: [], description: "Bisect the current project interactively or via an automated test script.", arguments: [], options: [ { name: "bad", description: "Known bad URL", argument: "URL", shorthand: "b", type: String, deprecated: false }, { name: "good", description: "Known good URL", argument: "URL", shorthand: "g", type: String, deprecated: false }, { name: "open", description: "Automatically open each URL in the browser", argument: "URL", shorthand: "o", type: Boolean, deprecated: false }, { name: "path", description: "Subpath of the deployment URL to test", argument: "PATH", shorthand: "p", type: String, deprecated: false }, { name: "run", description: "Test script to run for each deployment", argument: "SCRIPT", shorthand: "r", type: String, deprecated: false } ], examples: [ { name: "Bisect the current project interactively", value: `${packageName} bisect` }, { name: "Bisect with a known bad deployment", value: `${packageName} bisect --bad example-310pce9i0.vercel.app` }, { name: "Automated bisect with a run script", value: `${packageName} bisect --run ./test.sh` } ] }; // src/commands/buy/command.ts var SUPPORTED_CREDIT_TYPES = ["v0", "gateway", "agent"]; var CREDIT_TYPE_LABELS = { v0: "v0", gateway: "AI Gateway", agent: "Vercel Agent" }; var creditsSubcommand = { name: "credits", aliases: [], description: "Purchase Vercel credits for your team", arguments: [ { name: "credit-type", required: true }, { name: "amount", required: true } ], options: [ { ...yesOption, description: "Skip the confirmation prompt" }, formatOption, jsonOption ], examples: [ { name: "Purchase $100 of v0 credits", value: `${packageName} buy credits v0 100` }, { name: "Purchase $250 of AI Gateway credits", value: `${packageName} buy credits gateway 250` }, { name: "Purchase $50 of Vercel Agent credits", value: `${packageName} buy credits agent 50` } ] }; var SUPPORTED_ADDON_ALIASES = ["siem"]; var ADDON_LABELS = { siem: "SIEM" }; var addonSubcommand = { name: "addon", aliases: ["addons"], description: "Purchase a Vercel addon for your team", arguments: [ { name: "addon-name", required: true }, { name: "quantity", required: true } ], options: [ { ...yesOption, description: "Skip the confirmation prompt" }, formatOption, jsonOption ], examples: [ { name: "Purchase 1 unit of the SIEM addon", value: `${packageName} buy addon siem 1` } ] }; var proSubcommand = { name: "pro", aliases: [], description: "Purchase a Vercel Pro subscription for your team", arguments: [], options: [ { ...yesOption, description: "Skip the confirmation prompt" }, formatOption, jsonOption ], examples: [ { name: "Upgrade your team to Vercel Pro", value: `${packageName} buy pro` }, { name: "Upgrade without confirmation prompt", value: `${packageName} buy pro --yes` } ] }; var v0Subcommand = { name: "v0", aliases: [], description: "Purchase a v0 subscription for your team", arguments: [], options: [], examples: [ { name: "Purchase v0 for your team", value: `${packageName} buy v0` } ] }; var domainSubcommand = { name: "domain", aliases: [], description: "Purchase a domain name", arguments: [ { name: "domain", required: true } ], options: [], examples: [ { name: "Purchase a domain", value: `${packageName} buy domain example.com` } ] }; var buyCommand = { name: "buy", aliases: [], description: "Purchase Vercel products for your team", arguments: [], subcommands: [ creditsSubcommand, addonSubcommand, proSubcommand, v0Subcommand, domainSubcommand ], options: [], examples: [ { name: "Purchase $100 of v0 credits", value: `${packageName} buy credits v0 100` }, { name: "Purchase the SIEM addon", value: `${packageName} buy addon siem 1` }, { name: "Upgrade to Pro", value: `${packageName} buy pro` }, { name: "Purchase v0", value: `${packageName} buy v0` }, { name: "Purchase a domain", value: `${packageName} buy domain example.com` } ] }; // src/commands/cache/command.ts var purgeSubcommand = { name: "purge", aliases: [], description: "Purge cache for the current project", arguments: [], options: [ yesOption, { name: "type", description: "Type of cache to purge", shorthand: null, type: String, argument: "TYPE", deprecated: false } ], examples: [ { name: "Purge all caches for the current project", value: `${packageName} cache purge` }, { name: "Purge only the CDN cache", value: `${packageName} cache purge --type cdn` }, { name: "Purge only the data cache", value: `${packageName} cache purge --type data` } ] }; var invalidateSubcommand = { name: "invalidate", aliases: [], description: "Invalidate all cached content by tag", arguments: [], options: [ yesOption, { name: "tag", description: "Tags to invalidate (comma-separated)", shorthand: null, type: String, argument: "TAGS", deprecated: false }, { name: "srcimg", description: "Source Image to invalidate", shorthand: null, type: String, argument: "SRCIMG", deprecated: false } ], examples: [ { name: "Invalidate all cached content associated with a tag", value: `${packageName} cache invalidate --tag foo` }, { name: "Invalidate all cached content associated with any one of multiple tags", value: `${packageName} cache invalidate --tag foo,bar,baz` }, { name: "Invalidate all cached content associated with a source image", value: `${packageName} cache invalidate --srcimg /api/avatar/1` } ] }; var dangerouslyDeleteSubcommand = { name: "dangerously-delete", aliases: [], description: "Dangerously delete all cached content by tag", arguments: [], options: [ yesOption, { name: "tag", description: "Tags to delete (comma-separated)", shorthand: null, type: String, argument: "TAGS", deprecated: false }, { name: "srcimg", description: "Source Image to delete", shorthand: null, type: String, argument: "SRCIMG", deprecated: false }, { name: "revalidation-deadline-seconds", description: "Revalidation deadline in seconds", shorthand: null, type: Number, argument: "REVALIDATION-DEADLINE-SECONDS", deprecated: false } ], examples: [ { name: "Dangerously delete all cached content associated with a tag", value: `${packageName} cache dangerously-delete --tag foo` }, { name: "Dangerously delete all cached content associated with a tag if not accessed in the next hour", value: `${packageName} cache dangerously-delete --tag foo --revalidation-deadline-seconds 3600` }, { name: "Dangerously delete all cached content associated with a source image", value: `${packageName} cache dangerously-delete --srcimg /api/avatar/1` }, { name: "Dangerously delete all cached content associated with a source image if not accessed in the next hour", value: `${packageName} cache dangerously-delete --srcimg /api/avatar/1 --revalidation-deadline-seconds 3600` } ] }; var cacheCommand = { name: "cache", aliases: [], description: "Manage cache for a Project", arguments: [], subcommands: [ purgeSubcommand, invalidateSubcommand, dangerouslyDeleteSubcommand ], options: [], examples: [] }; // src/commands/certs/command.ts var removeSubcommand2 = { name: "remove", aliases: ["rm"], description: "Remove a certificate by id", arguments: [ { name: "id", required: true } ], options: [], examples: [ { name: "Remove a certificate", value: `${packageName} certs rm id` } ] }; var issueSubcommand = { name: "issue", aliases: [], description: "Issue a new certificate for a domain", arguments: [ { name: "cn", required: true } ], options: [ { name: "challenge-only", description: "Only show challenges needed to issue a certificate", shorthand: null, type: Boolean, deprecated: false }, { name: "crt", description: "Certificate file", argument: "FILE", shorthand: null, type: String, deprecated: false }, { name: "key", description: "Certificate key file", argument: "FILE", shorthand: null, type: String, deprecated: false }, { name: "ca", description: "CA certificate chain file", argument: "FILE", shorthand: null, type: String, deprecated: false }, { name: "overwrite", shorthand: null, type: Boolean, deprecated: false } ], examples: [ { name: 'Generate a certificate with the cnames "acme.com" and "www.acme.com"`', value: `${packageName} certs issue acme.com www.acme.com` } ] }; var listSubcommand3 = { name: "list", aliases: ["ls"], description: "Show all available certificates", arguments: [], options: [limitOption, nextOption], examples: [ { name: "Paginate results, where `1584722256178` is the time in milliseconds since the UNIX epoch.", value: `${packageName} certs ls --next 1584722256178` } ] }; var addSubcommand2 = { name: "add", aliases: [], description: "Add a new certificate", arguments: [], options: [ { name: "crt", description: "Certificate file", argument: "FILE", shorthand: null, type: String, deprecated: false }, { name: "key", description: "Certificate key file", argument: "FILE", shorthand: null, type: String, deprecated: false }, { name: "ca", description: "CA certificate chain file", argument: "FILE", shorthand: null, type: String, deprecated: false }, { name: "overwrite", description: "", shorthand: null, type: Boolean, deprecated: true } ], examples: [] }; var certsCommand = { name: "certs", aliases: ["cert"], description: "Interact with SSL certificates. This command is intended for advanced use only. By default, Vercel manages your certificates automatically.", arguments: [], subcommands: [ addSubcommand2, issueSubcommand, listSubcommand3, removeSubcommand2 ], options: [], examples: [ ...issueSubcommand.examples, ...removeSubcommand2.examples, ...listSubcommand3.examples ] }; // src/commands/connex/command.ts var createSubcommand2 = { name: "create", aliases: [], description: "Create a new connector", arguments: [ { name: "type", required: true } ], options: [ { name: "name", shorthand: "n", type: String, argument: "NAME", deprecated: false, description: "Name of the connector" }, { name: "triggers", shorthand: null, type: Boolean, deprecated: false, description: "Enable webhook triggers for this connector" }, formatOption ], examples: [ { name: "Create a Slack app", value: `${packageName} connect create slack` }, { name: "Create with a custom name", value: `${packageName} connect create slack --name my-bot` }, { name: "Create with webhook triggers enabled", value: `${packageName} connect create slack --name my-bot --triggers` }, { name: "Output as JSON", value: `${packageName} connect create slack --format=json` } ] }; var listSubcommand4 = { name: "list", aliases: ["ls"], description: "List connectors linked to the current project (falls back to every connector in the team when no project is linked or when --all-projects is set)", arguments: [], options: [ { name: "all-projects", shorthand: null, type: Boolean, deprecated: false, description: "List every connector in the team, regardless of project link" }, { name: "limit", shorthand: null, type: Number, argument: "COUNT", deprecated: false, description: "Number of connectors to return per page" }, { name: "next", shorthand: null, type: String, argument: "CURSOR", deprecated: false, description: "Cursor for the next page of results" }, formatOption ], examples: [ { name: "List connectors linked to the current project", value: `${packageName} connect list` }, { name: "List every connector in the team", value: `${packageName} connect list --all-projects` }, { name: "Limit the number of results", value: `${packageName} connect list --limit 10` }, { name: "Fetch the next page of results", value: `${packageName} connect list --next <cursor>` }, { name: "Output as JSON", value: `${packageName} connect list --format=json` } ] }; var removeSubcommand3 = { name: "remove", aliases: ["rm"], description: "Delete a connector", arguments: [ { name: "client", required: true } ], options: [ { name: "disconnect-all", description: "Disconnects all projects from the connector before deletion", shorthand: "a", type: Boolean, deprecated: false }, { ...yesOption, description: "Skip the confirmation prompt when deleting a connector" }, formatOption ], examples: [ { name: "Delete a connector by ID", value: `${packageName} connect remove scl_abc123` }, { name: "Delete a connector by UID", value: `${packageName} connect remove slack/my-bot` }, { name: "Disconnect all projects from a connector, then delete it", value: [ `${packageName} connect remove scl_abc123 --disconnect-all`, `${packageName} connect remove slack/my-bot -a` ] }, { name: "Skip the confirmation prompt", value: `${packageName} connect remove scl_abc123 --yes` }, { name: "Output as JSON", value: `${packageName} connect remove scl_abc123 --format=json --yes` } ] }; var tokenSubcommand = { name: "token", aliases: [], description: "Get a token for a connector (accepts a connector ID like scl_abc or a UID like slack/my-bot)", arguments: [ { name: "id", required: true } ], options: [ { name: "subject", shorthand: "s", type: String, argument: "TYPE", deprecated: false, description: `Subject type: "user" (default, acts on behalf of you) or "app" (uses the connector's default installation)` }, { name: "installation-id", shorthand: null, type: String, argument: "ID", deprecated: false, description: "Target a specific installation (only useful with --subject app; defaults to the connector's default installation)" }, { name: "scopes", shorthand: null, type: String, argument: "SCOPES", deprecated: false, description: "Scopes (comma- or space-separated)" }, yesOption, formatOption ], examples: [ { name: "Get a user token by connector ID", value: `${packageName} connect token scl_abc123` }, { name: "Get a token by connector UID", value: `${packageName} connect token slack/my-bot` }, { name: "Get an app token (default installation)", value: `${packageName} connect token scl_abc123 --subject app` }, { name: "Get an app token for a specific installation", value: `${packageName} connect token scl_abc123 --subject app --installation-id inst_1` }, { name: "Open the browser automatically if authorization/installation is required", value: `${packageName} connect token scl_abc123 --yes` }, { name: "Output as JSON (includes expiresAt, installationId, etc.)", value: `${packageName} connect token scl_abc123 --format=json` } ] }; var openSubcommand = { name: "open", aliases: [], description: "Open a connector in the Vercel dashboard", arguments: [ { name: "id", required: true } ], options: [formatOption], examples: [ { name: "Open a connector by ID", value: `${packageName} connect open scl_abc123` }, { name: "Open a connector by UID", value: `${packageName} connect open slack/my-bot` }, { name: "Print the dashboard URL as JSON", value: `${packageName} connect open scl_abc123 --format=json` } ] }; var attachSubcommand = { name: "attach", aliases: [], description: "Attach a Vercel project to a connector for one or more environments", arguments: [ { name: "client", required: true } ], options: [ { name: "environment", shorthand: "e", type: [String], argument: "ENV", deprecated: false, description: "Environments to enable. Repeatable and comma-separated (e.g. -e production -e preview, or -e production,preview). Defaults to all environments." }, { name: "project", shorthand: "p", type: String, argument: "NAME_OR_ID", deprecated: false, description: "Project name or ID (default: current linked project)" }, { name: "triggers", shorthand: null, type: Boolean, deprecated: false, description: "Also register this project as a trigger destination so the connector forwards verified webhooks to it (max 3 destinations per connector)" }, { name: "trigger-branch", shorthand: null, type: String, argument: "BRANCH", deprecated: false, description: "Target a specific git branch for the trigger destination (default: production). Only valid with --triggers." }, { name: "trigger-path", shorthand: null, type: String, argument: "PATH", deprecated: false, description: "Path on the destination project that receives the forwarded webhook (default: /{service}). Only valid with --triggers." }, { ...yesOption, description: "Skip the confirmation prompt" }, formatOption ], examples: [ { name: "Attach the current project to a connector for all environments", value: `${packageName} connect attach scl_abc123` }, { name: "Restrict to specific environments", value: `${packageName} connect attach scl_abc123 -e production -e preview` }, { name: "Attach a different project by name", value: `${packageName} connect attach slack/my-bot --project my-app` }, { name: "Attach and register the project as a trigger destination", value: `${packageName} connect attach scl_abc123 --triggers` }, { name: "Attach and register a preview-branch trigger destination", value: `${packageName} connect attach scl_abc123 --triggers --trigger-branch staging --trigger-path /slack` }, { name: "Non-interactive output as JSON", value: `${packageName} connect attach scl_abc123 --yes --format=json` } ] }; var detachSubcommand = { name: "detach", aliases: [], description: "Detach a Vercel project from a connector", arguments: [ { name: "client", required: true } ], options: [ { name: "project", shorthand: "p", type: String, argument: "NAME_OR_ID", deprecated: false, description: "Project name or ID (default: current linked project)" }, { ...yesOption, description: "Skip the confirmation prompt" }, formatOption ], examples: [ { name: "Detach the current project from a connector", value: `${packageName} connect detach scl_abc123` }, { name: "Detach a different project by name", value: `${packageName} connect detach slack/my-bot --project my-app` }, { name: "Non-interactive output as JSON", value: `${packageName} connect detach scl_abc123 --yes --format=json` } ] }; var connexCommand = { name: "connect", aliases: [], description: "Manage connectors (Beta).\n\nVercel Connect is currently in beta. Behavior, commands, and output may change before general availability.", arguments: [], options: [], subcommands: [ createSubcommand2, listSubcommand4, tokenSubcommand, attachSubcommand, detachSubcommand, removeSubcommand3, openSubcommand ], examples: [ { name: "Create a Slack app", value: `${packageName} connect create slack` }, { name: "List connectors on the current team", value: `${packageName} connect list` }, { name: "Get a token", value: `${packageName} connect token scl_abc123` }, { name: "Attach the current project to a connector", value: `${packageName} connect attach scl_abc123` }, { name: "Open a connector in the dashboard", value: `${packageName} connect open scl_abc123` } ] }; // src/commands/contract/command.ts var contractCommand = { name: "contract", aliases: [], description: "Show contract information for all billing periods", arguments: [], options: [formatOption, jsonOption], examples: [ { name: "Show contract information for all billing periods", value: `${packageName} contract` }, { name: "Show contract information for all billing periods as JSON", value: `${packageName} contract --format json` } ] }; // src/commands/crons/command.ts var addSubcommand3 = { name: "add", aliases: [], description: "Add a cron job to vercel.json", arguments: [], options: [ { name: "path", shorthand: null, type: String, argument: "PATH", deprecated: false, description: "The API route path for the cron job (must start with /)" }, { name: "schedule", shorthand: null, type: String, argument: "EXPRESSION", deprecated: false, description: 'The cron schedule expression (e.g. "0 10 * * *")' } ], examples: [ { name: "Add a cron job interactively", value: `${packageName} crons add` }, { name: "Add a cron job with flags", value: `${packageName} crons add --path /api/cron --schedule "0 10 * * *"` } ] }; var listSubcommand5 = { name: "list", aliases: ["ls"], description: "List all cron jobs for a project", default: true, arguments: [], options: [formatOption], examples: [ { name: "List all cron jobs", value: `${packageName} crons ls` }, { name: "List all cron jobs as JSON", value: `${packageName} crons ls --format json` } ] }; var runSubcommand = { name: "run", aliases: [], description: "Trigger a cron job to run immediately", arguments: [ { name: "path", required: false } ], options: [], examples: [ { name: "Trigger a specific cron job", value: `${packageName} crons run /api/cron` } ] }; var cronsCommand = { name: "crons", aliases: ["cron"], description: "Manage cron jobs for a project", arguments: [], subcommands: [addSubcommand3, listSubcommand5, runSubcommand], options: [], examples: [] }; // src/commands/curl/command.ts var curlCommand = { name: "curl", aliases: [], description: "Execute curl with automatic deployment URL and protection bypass.", arguments: [ { name: "path", required: true } ], options: [ { ...yesOption, description: "Skip confirmation when linking is required (e.g. in non-interactive mode)" }, { name: "deployment", shorthand: null, type: String, deprecated: false, description: "The deployment ID or URL to target", argument: "ID|URL" }, { name: "protection-bypass", shorthand: null, type: String, deprecated: false, description: "Protection bypass secret for accessing protected deployments", argument: "SECRET" } ], examples: [ { name: "Make a GET request to an API endpoint", value: `${packageName} curl /api/hello` }, { name: "Make a POST request with data", value: `${packageName} curl /api/users -- --request POST --data '{"name": "John"}'` }, { name: "Target a specific deployment by ID", value: `${packageName} curl /api/status --deployment ERiL45NJvP8ghWxgbvCM447bmxwV` }, { name: "Target a specific deployment by URL", value: `${packageName} curl /api/status --deployment https://your-project-abc123.vercel.app` }, { name: "Use curl flags after the separator", value: `${packageName} curl /api/test -- --header "Content-Type: application/json" --request PUT` }, { name: "Use with protection bypass secret", value: `${packageName} curl /api/protected --protection-bypass <secret> -- --request GET` } ] }; // src/commands/deploy-hooks/command.ts var projectOption = { name: "project", shorthand: "p", type: String, argument: "PROJECT", description: "Project name or ID (defaults to the linked project)", deprecated: false }; var listSubcommand6 = { name: "list", aliases: ["ls"], description: "List deploy hooks for a project", arguments: [], options: [formatOption, projectOption], examples: [ { name: "List deploy hooks as JSON", value: `${packageName} deploy-hooks ls --format json` } ] }; var createSubcommand3 = { name: "create", aliases: ["add"], description: "Create a deploy hook for a Git branch", arguments: [ { name: "name", required: false } ], options: [ { name: "ref", shorthand: "r", type: String, argument: "BRANCH", deprecated: false, description: "Git branch ref to deploy when the hook URL is triggered" }, projectOption ], examples: [ { name: "Create a hook that deploys `main`", value: `${packageName} deploy-hooks create cms-rebuild --ref main` } ] }; var removeSubcommand4 = { name: "remove", aliases: ["rm", "delete"], description: "Remove a deploy hook by id", arguments: [ { name: "id", required: true } ], options: [ projectOption, { ...yesOption, description: "Skip the confirmation prompt when removing a deploy hook" } ], examples: [] }; var deployHooksCommand = { name: "deploy-hooks", aliases: ["deploy-hook"], description: "Manage deploy hooks for Git-triggered builds", arguments: [], subcommands: [listSubcommand6, createSubcommand3, removeSubcommand4], options: [], examples: [] }; // src/commands/dns/command.ts var importSubcommand = { name: "import", aliases: [], description: "Import a DNS zone file (see below for examples)", arguments: [ { name: "domain", required: true }, { name: "zonefile", required: true } ], options: [], examples: [] }; var listSubcommand7 = { name: "list", aliases: ["ls"], description: "List all DNS entries for a domain", default: true, arguments: [ { name: "domain", required: true } ], options: [limitOption, nextOption], examples: [] }; var addSubcommand4 = { name: "add", aliases: [], description: "Add a new DNS entry (see below for examples)", arguments: [ { name: "domain", required: true }, { name: "details", required: true } ], options: [], examples: [] }; var removeSubcommand5 = { name: "remove", aliases: ["rm"], description: "Remove a DNS entry using its ID", arguments: [ { name: "id", required: true } ], options: [ { ...yesOption, description: "Skip the confirmation prompt when removing a DNS record" } ], examples: [] }; var dnsCommand = { name: "dns", aliases: [], description: "Interact with DNS entries for a project", arguments: [], subcommands: [ addSubcommand4, importSubcommand, listSubcommand7, removeSubcommand5 ], options: [], examples: [ { name: "Add an A record for a subdomain", value: [ `${packageName} dns add <DOMAIN> <SUBDOMAIN> <A | AAAA | ALIAS | CNAME | TXT> <VALUE>`, `${packageName} dns add zeit.rocks api A 198.51.100.100` ] }, { name: "Add an MX record (@ as a name refers to the domain)", value: [ `${packageName} dns add <DOMAIN> '@' MX <RECORD VALUE> <PRIORITY>`, `${packageName} dns add zeit.rocks '@' MX mail.zeit.rocks 10` ] }, { name: "Add an SRV record", value: [ `${packageName} dns add