Skip to content

feat(cli): upgrade mutation commands to use success() with context and withSpinner()#927

Merged
aaight merged 1 commit intodevfrom
feature/polished-success-messages
Mar 16, 2026
Merged

feat(cli): upgrade mutation commands to use success() with context and withSpinner()#927
aaight merged 1 commit intodevfrom
feature/polished-success-messages

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 16, 2026

Summary

  • Upgraded all ~28 mutation commands in src/cli/dashboard/ to use this.success() (green ✓ prefix) instead of bare this.log()
  • Wrapped all tRPC calls with this.withSpinner() to show loading indicators during network operations
  • Each success message now includes contextual resource name/ID details:
    • Login: ✓ Logged in as Alice (alice@example.com) at http://localhost:3000
    • Create project: ✓ Created project 'my-project' (repo: owner/repo)
    • Update project: ✓ Updated project 'my-project'
    • Trigger/Retry runs: ✓ Agent run triggered — project: X, agent: Y / ✓ Retry triggered — run ID: abc123
    • Delete: ✓ Deleted project 'my-project'
    • Logout: ✓ Logged out.
  • --json mode continues to output raw JSON without emoji prefixes (backward compatible)

Affected Commands

  • login, logout — added chalk green prefix
  • runs/trigger, runs/retry, runs/cancel — success + spinner
  • projects/create, projects/update, projects/delete — success + spinner
  • projects/credentials-set, projects/credentials-delete — success + spinner
  • projects/integration-set, projects/trigger-set — success + spinner
  • users/create, users/update, users/delete — success + spinner
  • org/update — success + spinner
  • agents/create, agents/update, agents/delete — success + spinner
  • definitions/create, definitions/update, definitions/delete, definitions/import, definitions/reset — success + spinner
  • prompts/set-partial, prompts/reset-partial — success + spinner
  • webhooks/create, webhooks/delete — success + spinner

Test plan

  • TypeScript type checking passes (npm run typecheck)
  • Linting passes (npm run lint)
  • All 294 unit test files pass (5480 tests) (npm run test:unit)
  • --json mode outputs raw JSON (no emoji prefix) — preserved in all commands

Trello card: https://trello.com/c/XbzMwKmu/443-as-a-user-i-want-polished-success-messages-with-context-so-that-i-can-confirm-what-was-created-changed

🤖 Generated with Claude Code

🕵️ claude-code · claude-sonnet-4-6 · run details

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

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

Summary

LGTM — Clean, mechanical upgrade of ~28 mutation commands to use this.success() (green ✓ prefix) and this.withSpinner() for loading indicators. The changes are consistent, backward-compatible, and well-structured.

Notes

  • All 28 commands follow the same pattern: wrap tRPC .mutate() with this.withSpinner(), replace this.log() with this.success(), and add contextual details (resource name/ID) to success messages.
  • login.ts and logout.ts correctly use chalk.green('✓ ...') directly since they extend oclif's Command base (not DashboardCommand) — they don't have access to this.success(), and this is appropriate since they don't need a tRPC client.
  • --json mode is properly preserved: withSpinner in the base class auto-detects --json and passes silent: true to suppress the spinner, and all if (flags.json) guards still return before hitting this.success().
  • The withSpinner implementation correctly stops the spinner on both success and error (re-throws after spinner.stop()), so error handling via this.handleError(err) is unaffected.
  • CI checks (lint, typecheck, 5480 unit tests, integration tests, Docker builds) all pass.
  • Base class methods success(), info(), and withSpinner() are already covered by unit tests in tests/unit/cli/dashboard/base.test.ts.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit c7007b0 into dev Mar 16, 2026
6 checks passed
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