Skip to content

fix(sdk): type variadic flags as arrays - #1648

Merged
betegon merged 1 commit into
mainfrom
bt/sdk-variadic-flag-types
Sep 29, 2026
Merged

betegon merged 1 commit into
mainfrom
bt/sdk-variadic-flag-types

Conversation

@betegon

@betegon betegon commented Sep 29, 2026

Copy link
Copy Markdown
Member

Summary

Stricli passes variadic flags to a command as arrays, and the SDK forwards the flags object to the handler unchanged. The generator declared those flags with their element type, so sdk.auth.login({ scope: "org:read" }) type-checked and then failed inside the handler (flags.scope.flatMap is not a function), while passing the array the handler expects was a type error.

Variadic flags are now declared as Array<T>. This changes the declared type of 40 flags, including api --field, event send --tag, auth login --scope and explore --field. Runtime behavior is unchanged; TypeScript callers that pass a single string now get a type error instead of handing the command a string where it expects an array.

Validation

  • New test checks the generated AuthLoginParams declaration; it fails without the generator change.
  • tsc --noEmit and lint pass.
  • Unit suite: 474 files, 10,093 passed / 17 skipped (TZ=UTC).

Split out of #1559, whose repeatable --field flag relies on this.

Stricli passes variadic flags to commands as arrays and the SDK forwards flags unchanged, but the generator declared them with their element type. Calls such as sdk.auth.login({ scope: "org:read" }) type-checked and then failed inside the handler.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Sep 29, 2026 6:43am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Sep 29, 2026 6:43am UTC

Request Review

@BYK
BYK marked this pull request as ready for review September 29, 2026 07:11
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Sep 29, 2026
@cursor

cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Creating a rollout plan

Mention @change-monitor in a comment to update the plan.

@betegon
betegon merged commit 903b931 into main Sep 29, 2026
36 checks passed
@betegon
betegon deleted the bt/sdk-variadic-flag-types branch September 29, 2026 07:19

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — cec2435f Deployed Sep 29, 2026 by vercel[bot]
Preview – sentry-local — cec2435f Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants