Skip to content

feat(cli): add api command#14715

Merged
tknickman merged 5 commits intomainfrom
tknickman/vercel-api-cmd
Jan 23, 2026
Merged

feat(cli): add api command#14715
tknickman merged 5 commits intomainfrom
tknickman/vercel-api-cmd

Conversation

@tknickman
Copy link
Copy Markdown
Member

Introduces a new vercel api command that allows making authenticated HTTP requests to the Vercel API. Similar in API to gh api

Designed to improve discovery of our APIs for agents.

Vercel CLI 50.4.11 api (beta) — https://vercel.com/feedback

  ▲ vercel api [endpoint] [options]

  Make authenticated HTTP requests to the Vercel API        

  Options:

  -F,  --field <KEY=VALUE>      Add a typed parameter       
                                (numbers, booleans parsed). 
                                Use @file for file contents 
       --format <FORMAT>        Output format for ls command
                                (table, json). Defaults to  
                                table                       
       --generate <FORMAT>      Generate output instead of  
                                executing (e.g.,            
                                --generate=curl)            
  -H,  --header <KEY:VALUE>     Add a custom HTTP header    
  -i,  --include                Include response headers in 
                                output                      
       --input <FILE>           Read request body from file 
                                (use - for stdin)           
  -X,  --method <METHOD>        HTTP method (GET, POST, PUT,
                                PATCH, DELETE). Defaults to 
                                GET, or POST if body is     
                                provided                    
       --paginate               Fetch all pages of results  
       --raw                    Output raw JSON without     
                                pretty-printing             
  -f,  --raw-field <KEY=VALUE>  Add a string parameter (no  
                                type parsing)               
       --refresh                Force refresh the cached    
                                OpenAPI spec                
       --silent                 Suppress response output    
       --verbose                Show debug information      
                                including full              
                                request/response              


  Examples:

  - Get current user information

    $ vercel api /v2/user

  - List projects with team scope

    $ vercel api /v9/projects --scope my-team

  - Create a new project

    $ vercel api /v10/projects -X POST -F name=my-project

  - Delete a deployment

    $ vercel api /v13/deployments/dpl_abc123 -X DELETE

  - Paginate through all deployments

    $ vercel api /v6/deployments --paginate

  - Post JSON from file

    $ vercel api /v10/projects -X POST --input config.json

  - Add custom header

    $ vercel api /v2/user -H "X-Custom-Header: value"

  - List all available API endpoints

    $ vercel api --ls

  - Interactive mode (select endpoint)

    $ vercel api

@tknickman tknickman requested a review from a team as a code owner January 23, 2026 19:10
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 23, 2026

🦋 Changeset detected

Latest commit: 5d28102

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tknickman tknickman requested a review from brookemosby January 23, 2026 19:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-m85oxf7p1.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-m85oxf7p1.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 23, 2026

🧪 Unit Test Strategy

Comparing: 6888a3e5d28102 (view diff)

Strategy: Code changed outside of a package - running all unit tests

⚠️ All unit tests will run because global code changes could impact all packages.

Affected packages - 41 (100%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/introspection
  24. @vercel/koa
  25. @vercel/nestjs
  26. @vercel/next
  27. @vercel/node
  28. @vercel/oidc
  29. @vercel/oidc-aws-credentials-provider
  30. @vercel/python
  31. @vercel/python-analysis
  32. @vercel/redwood
  33. @vercel/related-projects
  34. @vercel/remix-builder
  35. @vercel/routing-utils
  36. @vercel/ruby
  37. @vercel/rust
  38. @vercel/static-build
  39. @vercel/static-config
  40. examples
  41. vercel

Results

  • Unit tests: All affected packages will run unit tests
  • E2E tests: Handled separately (Version Packages PRs or run-e2e-tests label)
  • Type checks: All affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@socket-security
Copy link
Copy Markdown

socket-security bot commented Jan 23, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​inquirer/​search@​2.0.110010010094100

View full report

tknickman and others added 4 commits January 23, 2026 16:42
Introduces a new vercel api command that allows making authenticated HTTP requests to the Vercel API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import RequestConfig type in index.ts
- Fix ensureLoaded type assertion that caused never type with private spec
- Add explicit type cast for Object.entries on properties
- Add stub telemetry methods for field/raw-field (not tracked for privacy)
- Fix trackCliSubcommand call signature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix example: change `api --ls` to `api ls` (ls is a subcommand, not a flag)
- Track field/raw-field option usage with redacted count instead of not tracking

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tknickman tknickman enabled auto-merge (squash) January 23, 2026 23:27
@tknickman tknickman merged commit de34a47 into main Jan 23, 2026
141 checks passed
@tknickman tknickman deleted the tknickman/vercel-api-cmd branch January 23, 2026 23:37
tknickman pushed a commit that referenced this pull request Jan 23, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@50.5.0

### Minor Changes

- New, consistent --format command for machine readable output
([#14609](#14609))

-   api command ([#14715](#14715))

- Detect Augment and OpenCode agents
([#14635](#14635))

### Patch Changes

- Track CLI as source for marketplace integration installations
([#14713](#14713))

- Do not show default project settings when framework is detected
([#14608](#14608))

- Fix flakey link tests caused by Inquirer type-ahead search
([#14716](#14716))

- Updated dependencies
\[[`64b4577b6d702335478af47c8395bf36daf4f311`](64b4577),
[`1ba97e3af1c1240703df3297fbbf7af0f809dd56`](1ba97e3)]:
    -   @vercel/python@6.3.1
    -   @vercel/detect-agent@1.1.0

## @vercel/detect-agent@1.1.0

### Minor Changes

- Detect Augment and OpenCode agents
([#14635](#14635))

## @vercel/python@6.3.1

### Patch Changes

- isInstalled check only needs to check for python on the path.
([#14712](#14712))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants