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 into
Conversation
🦋 Changeset detectedLatest commit: a565eba 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
dbbf9be to
826d9da
Compare
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis PR updates clerk whoami to display linked application details and adds a --json flag. It introduces WhoamiOptions and profileLabel, wires --json into the CLI, resolves a local profile best-effort, emits a structured JSON payload when requested or in agent mode, and otherwise prints the email plus a conditional "Linked to …" line to stderr. Tests and documentation were expanded to cover human and JSON modes, normalization rules, and stdout/stderr pipe contract. 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. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
!snapshot |
Snapshot publishednpm install -g clerk@1.2.1-snapshot.826d9da
|
826d9da to
9173726
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.
9173726 to
a565eba
Compare
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