feat: add team CRUD commands (get, create, update, delete)#7
Merged
Conversation
Add full team management CLI commands with both table and JSON output: - team get: view team detail by --id, --name, or --ref-id Parallel /team/info + /team/infos for full metadata with member names - team create: create team with --name, --description, --person-ids, --emails - team update: update team by --id with any combination of fields Clear warning that --person-ids replaces the entire member list - team delete: delete team with interactive confirmation prompt Supports --force to skip confirmation - team list: enhanced with --limit, --orderby, --asc, --person-id flags New shared helpers: - WriteResultJSON: structured JSON for write operations - confirmAction: interactive delete confirmation using cmd.InOrStdin() - requireExactlyOneFlag: mutual exclusivity validator for identifier flags Depends on flashduty-sdk feat/team-crud branch.
The API requires team_name on every upsert call. When updating a team without --name, fetch the current team name first so it's preserved.
Previously, confirmAction returned true when stdin was not a TTY, allowing destructive deletes to proceed silently in CI/cron/pipes. Now it returns false, requiring explicit --force for non-interactive use.
Remove the ../flashduty-sdk replace directive that breaks CI builds. Point go.mod at the published feat/team-crud commit (dbac133) instead.
- flashduty-admin: document team get/create/update/delete commands, all flags, team lifecycle workflow, and member replacement warning - flashduty-shared: add team get to reference lookups, add safety rules for team delete and member list replacement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
team get,team create,team update,team deleteteam listwith--limit,--orderby,--asc,--person-idflags--jsonoutput formatsWriteResultJSON(structured JSON for write ops),confirmAction(interactive delete confirmation),requireExactlyOneFlag(mutual exclusivity validation)New Commands
team get --id/--name/--ref-idteam create --name [opts]team update --id [opts]team delete --id/--name/--ref-idSDK Dependency
Requires flashduty-sdk feat/team-crud which adds:
GetTeamInfo,UpsertTeam,DeleteTeammethodsTeamItem,TeamGetInput,TeamUpsertInput,TeamDeleteInputtypesListTeamsInputwith Limit/OrderBy/Asc/PersonIDCode Review Findings Addressed
GetTeamInfofor real parallelism (both API calls in errgroup)UpsertTeamto not send emptyteam_nameon updatesconfirmActionusescmd.InOrStdin()for testabilityrunCommandfor consistent error handlingTest plan
go test -race ./...passes in both SDK and CLI reposflashduty team listflashduty team list --jsonflashduty team get --id <id>flashduty team get --id <id> --jsonflashduty team create --name "Test Team"flashduty team update --id <id> --description "new"flashduty team delete --id <id>(confirm + abort)flashduty team delete --id <id> --force--helptext is clear on all subcommands