FJ-33: Add fj repo collaborator subcommands (list/add/remove/permission) #37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/repo-collaborator-subcommands-FJ-33"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements FJ-33: adds
fj repo collaborator list|add|remove|permissionfor managing repository collaborators from the CLI.What
forgejo-apiwrappers incrates/fj-core/src/repo.rs(list_collaborators,add_collaborator,remove_collaborator,get_collaborator_permission) returningeyre::Result, following the existing repo-op pattern. No clap/crossterm/fluent deps, so the MCP-reuse contract holds (cargo tree -p fj-client -p fj-core -e normal | grep -E 'clap|crossterm|fluent'stays empty).CollaboratorSubcommandenum wired asRepoCommand::Collaborator(subcommand literalcollaborator, aliascollab), aCollaboratorPermissionclap ValueEnum mapped toAddCollaboratorOptionPermission, rendering helpers, JSON projection structs, and en-US ftl strings.Behavior
add <username> --permission <read|write|admin>adds a collaborator or updates an existing one's permission (the upstream endpoint is an upsert).--permissionis optional; omitting it uses the server default.remove <username>removes the collaborator.permission <username>prints the user's effective permission. This subsumes a standalonecheckcommand, so none was added.listandpermissionsupport--jsonvia stable serde projection structs. Because the list endpoint returns plain users with no permission field, each collaborator's permission is fetched alongside its username.Verification
cargo build,cargo clippy,cargo fmt --check, andcargo testall pass.fj repo collaborator --helpand subcommand help render the expected surface.🤖 Generated with Claude Code