Skip to content

feat(cli): add user management CLI commands (list, create, update, delete)#794

Merged
aaight merged 1 commit intodevfrom
feature/user-management-cli
Mar 14, 2026
Merged

feat(cli): add user management CLI commands (list, create, update, delete)#794
aaight merged 1 commit intodevfrom
feature/user-management-cli

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 14, 2026

Summary

  • Add cascade users list — displays table of org users (ID, Email, Name, Role, Created) with --json support
  • Add cascade users create --email --password --name [--role] — creates a new user via tRPC
  • Add cascade users update <id> [--name] [--email] [--role] [--password] — updates user fields via tRPC
  • Add cascade users delete <id> --yes — deletes a user with confirmation guard

All commands live in src/cli/dashboard/users/, extend DashboardCommand, and follow the credentials/ CLI pattern exactly (oclif flags, tRPC calls, --json output, error handling).

Closes: https://trello.com/c/fzNezXRd/322-as-an-admin-i-want-cli-commands-to-manage-users-so-that-i-can-add-list-update-delete-users-from-the-terminal

Test plan

  • npm run typecheck passes (zero errors)
  • npm run lint:fix passes (no changes needed)
  • npm test passes (4667 tests, 269 test files)
  • Manual: cascade users list shows a user table
  • Manual: cascade users create --email x@y.com --password p --name "Test User" creates a user
  • Manual: cascade users update <id> --name "New Name" updates the user
  • Manual: cascade users delete <id> --yes deletes the user

🤖 Generated with Claude Code

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 implementation that follows the established credentials/ CLI pattern exactly. All four commands (list, create, update, delete) are thin tRPC adapters with consistent flag definitions, error handling, and --json output support.

Verified:

  • tRPC usersRouter exists with matching list, create, update, delete endpoints and proper authorization (adminProcedure, superadmin guards)
  • oclif auto-discovers users/ via existing glob pattern in package.json
  • formatDate import in list.ts resolves correctly from _shared/format.ts
  • role flag uses options constraint so the type cast is safe
  • No test coverage, consistent with existing CLI commands (credentials also has none)
  • All CI checks pass (typecheck, lint, 4667 tests)

@aaight aaight merged commit 29f732c into dev Mar 14, 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