Skip to content

[cli] Add Authorization header placeholder to vercel api --generate=curl#14752

Merged
tknickman merged 2 commits intomainfrom
tknickman/api-curl-auth-header
Jan 28, 2026
Merged

[cli] Add Authorization header placeholder to vercel api --generate=curl#14752
tknickman merged 2 commits intomainfrom
tknickman/api-curl-auth-header

Conversation

@tknickman
Copy link
Copy Markdown
Member

Summary

  • Adds an Authorization: Bearer <TOKEN> header placeholder to the curl output generated by vercel api --generate=curl
  • Updates the user message to instruct users to replace <TOKEN> with their auth token
  • Adds a unit test for the new behavior

Test plan

  • Run node packages/cli/dist/index.js api /v6/deployments --generate=curl and verify the output includes the Authorization header
  • Unit tests pass (npx vitest run test/unit/commands/api/request-builder.test.ts)

🤖 Generated with Claude Code

…curl`

The generated curl command now includes an Authorization header with a
`<TOKEN>` placeholder, making it easier for users to authenticate their
requests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tknickman tknickman requested a review from a team as a code owner January 27, 2026 16:39
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 27, 2026

🦋 Changeset detected

Latest commit: 03ed2c0

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

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 27, 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-lvejdwwqk.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-lvejdwwqk.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 27, 2026

🧪 Unit Test Strategy

Comparing: 513666503ed2c0 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 11 (27%)
  1. @vercel/edge
  2. @vercel/elysia
  3. @vercel/express
  4. @vercel/fastify
  5. @vercel/functions
  6. @vercel/h3
  7. @vercel/hono
  8. @vercel/koa
  9. @vercel/nestjs
  10. @vercel/node
  11. vercel
Unaffected packages - 30 (73%)
  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/error-utils
  10. @vercel/firewall
  11. @vercel/frameworks
  12. @vercel/fs-detectors
  13. @vercel/gatsby-plugin-vercel-builder
  14. @vercel/go
  15. @vercel/hydrogen
  16. @vercel/introspection
  17. @vercel/next
  18. @vercel/oidc
  19. @vercel/oidc-aws-credentials-provider
  20. @vercel/python
  21. @vercel/python-analysis
  22. @vercel/redwood
  23. @vercel/related-projects
  24. @vercel/remix-builder
  25. @vercel/routing-utils
  26. @vercel/ruby
  27. @vercel/rust
  28. @vercel/static-build
  29. @vercel/static-config
  30. examples

Results

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

This comment is automatically generated based on the affected testing strategy

@tknickman tknickman requested a review from brookemosby January 27, 2026 16:40
Copy link
Copy Markdown
Contributor

@brookemosby brookemosby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tknickman tknickman enabled auto-merge (squash) January 27, 2026 16:45
@tknickman tknickman merged commit 9e388af into main Jan 28, 2026
232 of 234 checks passed
@tknickman tknickman deleted the tknickman/api-curl-auth-header branch January 28, 2026 16:12
onsclom pushed a commit that referenced this pull request Jan 28, 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.9.0

### Minor Changes

- Add confirmation prompt for DELETE API operations and agent mode
warning ([#14769](#14769))

- DELETE operations now require user confirmation before proceeding
- When running under an AI agent with `--dangerously-skip-permissions`,
a warning is displayed to stderr
- In non-TTY mode, DELETE operations fail unless
`--dangerously-skip-permissions` is used

### Patch Changes

- Add auto-provision flow for integration resources (behind feature
flag) ([#14734](#14734))

- Revert "[cli] Use promote flow when targeting production alias"
([#14771](#14771))

- Improved curl generation with auth header placeholder
([#14752](#14752))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
adriancooney pushed a commit that referenced this pull request Jan 30, 2026
…curl` (#14752)

## Summary
- Adds an `Authorization: Bearer <TOKEN>` header placeholder to the curl
output generated by `vercel api --generate=curl`
- Updates the user message to instruct users to replace `<TOKEN>` with
their auth token
- Adds a unit test for the new behavior

## Test plan
- [x] Run `node packages/cli/dist/index.js api /v6/deployments
--generate=curl` and verify the output includes the Authorization header
- [x] Unit tests pass (`npx vitest run
test/unit/commands/api/request-builder.test.ts`)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
adriancooney pushed a commit that referenced this pull request Jan 30, 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.9.0

### Minor Changes

- Add confirmation prompt for DELETE API operations and agent mode
warning ([#14769](#14769))

- DELETE operations now require user confirmation before proceeding
- When running under an AI agent with `--dangerously-skip-permissions`,
a warning is displayed to stderr
- In non-TTY mode, DELETE operations fail unless
`--dangerously-skip-permissions` is used

### Patch Changes

- Add auto-provision flow for integration resources (behind feature
flag) ([#14734](#14734))

- Revert "[cli] Use promote flow when targeting production alias"
([#14771](#14771))

- Improved curl generation with auth header placeholder
([#14752](#14752))

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