feat(whoami): show linked application and add --json output#265
feat(whoami): show linked application and add --json output#265rafa-thayto wants to merge 1 commit intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 826d9da The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
4a7c065 to
dbbf9be
Compare
c42b5a2 to
36237e7
Compare
Surfaces the linked Clerk application directly in `clerk whoami` so users don't have to read between the lines of next-steps to know which app the working directory is bound to. Adds a `--json` flag (and matching agent-mode auto-JSON) so scripts and AI agents can consume the email + link state as a single structured payload. The human-mode pipe contract is preserved: stdout is still just the email, the link line and next-steps stay on stderr.
dbbf9be to
826d9da
Compare
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR extends the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
clerk whoaminow prints aLinked to MyApp (app_xxx)line on stderr above the next-steps when the working directory is linked to a Clerk application — preserving stdout-as-email so existing pipes (e.g.clerk whoami | grep @) keep working.--jsonflag (and matching agent-mode auto-JSON) emits a structured payload on stdout covering email and link state, including normalizednulls for missing optional fields.profileLabel(profile)helper inlib/config.tsmirroringappLabel(app)fromlib/app-picker.ts, so the localProfileshape and the liveApplicationshape have parallel display formatters.JSON shape
{ "email": "alice@example.com", "linked": { "appId": "app_xxx", "appName": "MyApp", "instances": { "development": "ins_dev_xxx", "production": "ins_prod_xxx" }, "resolvedVia": "remote", "path": "github.com/clerk/cli" } }linkedisnullwhen not linked or when profile resolution throws (best-effort path preserved from #250's commit `1652c122`).Test plan