Skip to content

fix(cli): Match SDK variadic flags and streaming targets to the runtime - #1607

Merged
BYK merged 1 commit into
mainfrom
fix/cli-sdk-variadic-and-streaming
Oct 23, 2026
Merged

BYK merged 1 commit into
mainfrom
fix/cli-sdk-variadic-and-streaming

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Two places where what the library SDK accepts doesn't match what commands actually get:

  • Scalar values for variadic flags. Stricli always passes variadic flags to a handler as arrays, but the SDK forwards the caller's flags as-is. An untyped caller passing { field: "title" } to explore crashed with e.find is not a function (CLI-28C, CLI-2B4). fix(sdk): type variadic flags as arrays cli#1648 fixed the generated types. applyFlagDefaults now also wraps scalar values in an array at runtime, so plain JS callers work.
  • Streaming overloads. The AsyncIterable overload for log list --follow and dashboard view --refresh didn't accept trailing positionals, so sdk.log.list({ follow: "5" }, "org/project") failed to type-check even though the runtime accepts it.

This replaces three getsentry/cli PRs that patched explore directly. #1293's parse: (v: string[]) => v was wrong because Stricli calls parse once per value. #1218 and #1294 coerced the arrays inside explore. The variadic fix here is at the SDK boundary, which is the only path that can pass a scalar.

Ported from getsentry/cli#1218, getsentry/cli#1293, getsentry/cli#1294, and the SDK part of getsentry/cli#1655. All are being closed with the repo archive.

via BYK.

--

View Junior Session in Sentry

Two gaps between what the library SDK accepts and what commands get:

- Stricli always hands variadic flags to a handler as arrays, but the
  SDK forwards caller flags unchanged. An untyped caller passing
  `{ field: "title" }` to explore crashed with `e.find is not a
  function` (CLI-28C, CLI-2B4). applyFlagDefaults now wraps scalar
  values for variadic flags in an array.
- The AsyncIterable overload for streaming commands (`log list --follow`,
  `dashboard view --refresh`) did not accept trailing positionals, so
  `sdk.log.list({ follow: "5" }, "org/project")` failed to type-check
  even though the runtime accepts it.

Ported from getsentry/cli#1218, getsentry/cli#1293, getsentry/cli#1294,
and getsentry/cli#1655.

Co-Authored-By: BYK <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 22, 2026 6:31pm UTC

Request Review

@BYK
BYK merged commit 46b95a9 into main Oct 23, 2026
26 checks passed
@BYK
BYK deleted the fix/cli-sdk-variadic-and-streaming branch October 23, 2026 11:26

This branch was previously deployed

1 inactive deployment
Preview — 2c990883 Deployed Oct 22, 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.

1 participant