Skip to content

fix(cli): move --with-token argument to be first in sanity login#1589

Open
jonahsnider wants to merge 2 commits into
mainfrom
aigro-5245/login-flag-order
Open

fix(cli): move --with-token argument to be first in sanity login#1589
jonahsnider wants to merge 2 commits into
mainfrom
aigro-5245/login-flag-order

Conversation

@jonahsnider

@jonahsnider jonahsnider commented Jul 23, 2026

Copy link
Copy Markdown
Member

Note

Low Risk
Presentation-only CLI help and flag ordering; login behavior is unchanged aside from tests and generated README text.

Overview
sanity login help and docs now list --with-token first, so CI/token-based login is easier to spot than browser/SSO options.

The login command defines --with-token before other visible flags (with an explicit sort-objects exception), moves the stdin token example up in the examples list, and SanityHelp disables alphabetical flag sorting for login only so generated USAGE/FLAGS and sanity help login keep that order. Other commands still use the default help flag order.

Tests lock in “first visible flag” for login and login-only flagSortOrder: 'none'; the CLI README section for sanity login is regenerated to match.

Reviewed by Cursor Bugbot for commit a5547c7. Bugbot is set up for automated code reviews on this repo. Configure here.

@jonahsnider
jonahsnider requested a review from runeb July 23, 2026 02:31
@jonahsnider
jonahsnider requested a review from a team as a code owner July 23, 2026 02:31
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against main (f6fd22cc)

@sanity/cli

Metric Value vs main (f6fd22c)
Internal (raw) 2.2 KB -
Internal (gzip) 838 B -
Bundled (raw) 11.20 MB -
Bundled (gzip) 2.11 MB -
Import time 876ms +2ms, +0.2%

bin:sanity

Metric Value vs main (f6fd22c)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.90 MB -
Bundled (gzip) 1.78 MB -
Import time 2.11s -3ms, -0.1%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — @sanity/cli-core

Compared against main (f6fd22cc)

Metric Value vs main (f6fd22c)
Internal (raw) 114.1 KB -
Internal (gzip) 29.2 KB -
Bundled (raw) 21.76 MB -
Bundled (gzip) 3.46 MB -
Import time 778ms -8ms, -1.0%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — @sanity/cli-build

Compared against main (f6fd22cc)

@sanity/cli-build/_internal/build

Metric Value vs main (f6fd22c)
Internal (raw) 113.8 KB -
Internal (gzip) 28.7 KB -
Bundled (raw) 17.76 MB -
Bundled (gzip) 3.56 MB -
Import time 1.13s +5ms, +0.4%

@sanity/cli-build/_internal/env

Metric Value vs main (f6fd22c)
Internal (raw) 1.8 KB -
Internal (gzip) 644 B -
Bundled (raw) 1.31 MB -
Bundled (gzip) 333.8 KB -
Import time 123ms +1ms, +0.5%

@sanity/cli-build/_internal/extract

Metric Value vs main (f6fd22c)
Internal (raw) 8.6 KB -
Internal (gzip) 2.7 KB -
Bundled (raw) 155.0 KB -
Bundled (gzip) 39.5 KB -
Import time 244ms -0ms, -0.2%

🗺️ ./_internal/env · ./_internal/extract · @sanity/cli-build:./_internal/build treemap too large to embed · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — create-sanity

Compared against main (f6fd22cc)

Metric Value vs main (f6fd22c)
Internal (raw) 908 B -
Internal (gzip) 483 B -
Bundled (raw) 931 B -
Bundled (gzip) 491 B -
Import time ❌ ChildProcess denied: node -
Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 71d2aa3. Configure here.

Comment thread packages/@sanity/cli/src/SanityHelp.ts
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Delta

File Statements
packages/@sanity/cli/src/SanityHelp.ts 82.0% (+ 1.6%)
packages/@sanity/cli/src/commands/login.ts 100.0% (±0%)

Comparing 2 changed files against main @ f6fd22ccd40bb8346e8ecdb5e0cfe54d62f54823

Overall Coverage

Metric Coverage
Statements 78.6% (+ 0.0%)
Branches 70.3% (+ 0.0%)
Functions 74.4% (+ 0.0%)
Lines 79.1% (+ 0.0%)

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.

1 participant