feat: extend next-step suggestions to more commands#250
feat: extend next-step suggestions to more commands#250rafa-thayto wants to merge 2 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 1652c12 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 |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds contextual "next steps" guidance and a changeset for the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/cli-core/src/commands/whoami/index.ts`:
- Around line 23-24: Wrap the call to resolveProfile(process.cwd()) in a
try/catch so profile resolution is best-effort: call resolveProfile inside a
try, set a local profile variable only on success, and on any thrown error set
profile to undefined/false (or ignore the error) before calling
printNextSteps(profile ? NEXT_STEPS.WHOAMI_LINKED : NEXT_STEPS.WHOAMI); this
ensures resolveProfile failures don’t make the whoami command fail after account
info was already displayed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 03502c8c-d124-477f-a57c-10ca4fe38c31
📒 Files selected for processing (10)
.changeset/more-next-steps.mdpackages/cli-core/src/commands/auth/logout.tspackages/cli-core/src/commands/completion/index.tspackages/cli-core/src/commands/config/push.tspackages/cli-core/src/commands/skill/install.tspackages/cli-core/src/commands/switch-env/index.test.tspackages/cli-core/src/commands/switch-env/index.tspackages/cli-core/src/commands/unlink/index.tspackages/cli-core/src/commands/whoami/index.tspackages/cli-core/src/lib/next-steps.ts
8e13086 to
40eb1ae
Compare
17d224e to
4139d6f
Compare
Add contextual next-step output to `auth logout`, `switch-env`, `unlink`, `whoami`, `completion`, `skill install`, `config patch`, and `config put` so users see the natural follow-up action after each successful run. Suggestions are gated on human/interactive mode and centralized in the `NEXT_STEPS` registry.
Wrap the resolveProfile(process.cwd()) call in a try/catch so that whoami cannot fail after successfully fetching and printing account info. The profile resolution does git/config discovery which could throw in edge cases; this should not crash the command.
4139d6f to
1652c12
Compare
Summary
auth logout,switch-env,unlink,whoami,completion,skill install,config patch, andconfig put.NEXT_STEPSregistry (lib/next-steps.ts); per-shell completion install hints stay local tocommands/completion/index.tssince they aren't reusable vocabulary.isHuman()via the existingprintNextStepshelper, so agent mode and piped output stay clean.What users see now
After commands like
clerk unlinkorclerk skill install, the success line is followed by 1–3 cyan arrows pointing at the natural next workflow step (e.g.clerk apps list,clerk config pull,clerk doctor).whoamibranches between linked / unlinked profiles for relevance.completionemits stderr-only install hints tailored per shell (bash/zsh/fish/powershell).Side-effect:
whoamiresilience fixThe previous
try/catchwrapped bothfetchUserInfoandlog.data(userInfo.email)and attributed any throw tosession_expired. Tightened the try to the network call only — incidental but worth noting.Test plan
bun run typecheck— passbun run lint— 0 warnings, 0 errorsbun run test— 82 files pass, 0 fail (179 total tests including the touched commands)bun run format— cleanNEXT_STEPSstyle ("Runclerk Xto Y")