Skip to content

feat(init): signpost sanity new to logged-out users#1581

Closed
shapirodaniel wants to merge 2 commits into
stack/mint-and-claim/a1/03-claim-remindersfrom
stack/mint-and-claim/a1/04-init-signpost
Closed

feat(init): signpost sanity new to logged-out users#1581
shapirodaniel wants to merge 2 commits into
stack/mint-and-claim/a1/03-claim-remindersfrom
stack/mint-and-claim/a1/04-init-signpost

Conversation

@shapirodaniel

@shapirodaniel shapirodaniel commented Jul 22, 2026

Copy link
Copy Markdown

Description

this PR adds a sanity new hint to sanity init, with attended + unattended support

Stack

(each PR reviews against its base; merge bottom-up only):

  1. stack/mint-and-claim/a1/01-terminal-presentation
  2. stack/mint-and-claim/a1/02-mint-core
  3. stack/mint-and-claim/a1/03-claim-reminders
  4. stack/mint-and-claim/a1/04-init-signpost ← this diff
  5. stack/mint-and-claim/a1/05-remint-guardrail
  6. stack/mint-and-claim/a1/06-ambient-reminder
  7. stack/mint-and-claim/a1/07-logout-env-token

What to review

actions/init/newCommandBanner.ts and the unattended not-logged-in path in initAction.ts.

Testing

Layer-scoped unit tests included (test:source ≥ 1:1); every layer validated standalone (full typecheck + targeted tests at each checkout).

pr1581-init-signpost

🤖 Generated with Claude Code


Note

Low Risk
CLI messaging and UX only; authentication behavior is unchanged aside from additional error and stdout text.

Overview
Logged-out users running sanity init now see a one-time cyan boxed "Two ways to start" signpost after the login-required warning and before interactive login, contrasting sanity init (log in, set up Studio) with sanity new (no login, claim within 72 hours) and linking to https://sanity.new.

When init runs in unattended mode without a session, the InitError still uses the existing login-required text but adds guidance to use sanity new instead and points at sanity new --help.

New renderNewCommandBanner helper and unit/integration test updates cover banner content and the extended error copy; a minor @sanity/cli changeset records the release.

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

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against stack/mint-and-claim/a1/03-claim-reminders (05a316ac)

@sanity/cli

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
Internal (raw) 2.2 KB -
Internal (gzip) 838 B -
Bundled (raw) 11.20 MB -
Bundled (gzip) 2.11 MB -
Import time 880ms -17ms, -1.9%

bin:sanity

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.90 MB -
Bundled (gzip) 1.78 MB -
Import time 2.12s -47ms, -2.2%

🗺️ 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 stack/mint-and-claim/a1/03-claim-reminders (05a316ac)

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
Internal (raw) 114.1 KB -
Internal (gzip) 29.2 KB -
Bundled (raw) 21.76 MB -
Bundled (gzip) 3.46 MB -
Import time 792ms +3ms, +0.3%

🗺️ 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 stack/mint-and-claim/a1/03-claim-reminders (05a316ac)

@sanity/cli-build/_internal/build

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
Internal (raw) 113.8 KB -
Internal (gzip) 28.7 KB -
Bundled (raw) 17.76 MB -
Bundled (gzip) 3.56 MB -
Import time 1.15s -2ms, -0.2%

@sanity/cli-build/_internal/env

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
Internal (raw) 1.8 KB -
Internal (gzip) 644 B -
Bundled (raw) 1.31 MB -
Bundled (gzip) 333.8 KB -
Import time 127ms +1ms, +1.1%

@sanity/cli-build/_internal/extract

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
Internal (raw) 8.6 KB -
Internal (gzip) 2.7 KB -
Bundled (raw) 155.0 KB -
Bundled (gzip) 39.5 KB -
Import time 249ms +2ms, +0.7%

🗺️ ./_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 stack/mint-and-claim/a1/03-claim-reminders (05a316ac)

Metric Value vs stack/mint-and-claim/a1/03-claim-reminders (05a316a)
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.

@shapirodaniel

Copy link
Copy Markdown
Author

bugbot run

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit bf92b82. Configure here.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Coverage Delta

File Statements
packages/@sanity/cli/src/actions/init/initAction.ts 90.2% (+ 0.1%)
packages/@sanity/cli/src/actions/init/newCommandBanner.ts 100.0% (new)
packages/@sanity/cli/src/commands/new.ts 100.0% (new)
packages/@sanity/cli/src/commands/projects/mint.ts 100.0% (new)
packages/@sanity/cli/src/hooks/prerun/claimReminders.ts 88.9% (new)
packages/@sanity/cli/src/services/mintProject.ts 68.4% (new)
packages/@sanity/cli/src/util/claimNudges.ts 100.0% (new)
packages/@sanity/cli/src/util/envFile.ts 100.0% (new)
packages/@sanity/cli/src/util/flowOutput.ts 78.9% (new)
packages/@sanity/cli/src/util/newCommandSplash.ts 100.0% (new)
packages/@sanity/cli/src/util/terminalLink.ts 100.0% (new)

Comparing 11 changed files against main @ 56af732566885616d68473cf55737d67b85bf467

Overall Coverage

Metric Coverage
Statements 78.5% (+ 0.3%)
Branches 69.9% (+ 0.3%)
Functions 74.5% (+ 0.5%)
Lines 79.0% (+ 0.3%)

@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from 4d6a8f4 to 72e3837 Compare July 22, 2026 16:01
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from bf92b82 to e437a74 Compare July 22, 2026 16:01
@shapirodaniel

Copy link
Copy Markdown
Author

bugbot run

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0d5a9d9. Configure here.

@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from 03a5f1c to 8f81526 Compare July 22, 2026 17:03
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from 0d5a9d9 to 03e73c6 Compare July 22, 2026 17:03
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from e43123f to 3a00415 Compare July 22, 2026 19:58
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from bdd6b8c to 6e6e133 Compare July 22, 2026 19:58
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from 9182188 to 585e0e5 Compare July 22, 2026 21:04
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from 9270659 to 474423f Compare July 22, 2026 21:04
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from e81a97c to 66a782f Compare July 22, 2026 21:14
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from 5b17d16 to 09b0577 Compare July 22, 2026 21:14
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from 6aa0e48 to 603ef2b Compare July 22, 2026 21:21
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from dc46241 to 890f1e0 Compare July 22, 2026 21:21
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from 1a26343 to f254af8 Compare July 22, 2026 21:26
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from 92ca73f to 0fa3697 Compare July 22, 2026 21:26
Fourth layer of the mint-and-claim stack: a banner ahead of the interactive
login pointing logged-out users at sanity new (three prototype variants
behind SANITY_NEW_BANNER, whisper default), and the unattended not-logged-in
error now mentions the logged-out path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/03-claim-reminders branch from 7020c9b to 05a316a Compare July 22, 2026 21:33
@shapirodaniel
shapirodaniel force-pushed the stack/mint-and-claim/a1/04-init-signpost branch from 401aa3d to f7ea2fb Compare July 22, 2026 21:33
@shapirodaniel

Copy link
Copy Markdown
Author

bugbot run

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 36dfbdb. Configure here.

@shapirodaniel
shapirodaniel marked this pull request as ready for review July 22, 2026 22:47
@shapirodaniel
shapirodaniel requested a review from a team as a code owner July 22, 2026 22:47
boxen(
`${styleText('bold', 'Two ways to start')}

${styleText('cyan', 'sanity init')} Log in and set up a Studio ${styleText('dim', "(you're here)")}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can tighten the wording here maybe:

Two ways to start
sanity init Log in/Sign up and make a new project (you're here)
sanity new Create a project without an account. Sign up and claim it within 72 hours to keep it.
AI agents: run sanity new --json to create a new project programatically. Fetch https://sanity.new to learn more.

if (options.unattended) {
throw new InitError(LOGIN_REQUIRED_MESSAGE, exitCodes.RUNTIME_ERROR)
throw new InitError(
`${LOGIN_REQUIRED_MESSAGE}\n\n` +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is likely to be agent read maybe:

"To create a project without logging in, run sanity new (use --json for
machine-readable output). Claim it with a Sanity account within 72 hours
to keep it. Fetch https://sanity.new to learn more."

@shapirodaniel

Copy link
Copy Markdown
Author

all feedback addressed on #1592, canceling this PR to consolidate after offline sync

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