From 8f1a1743bd4e85e922ec0cc1f050911a28af4cf0 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 20 Feb 2026 21:54:00 +0000 Subject: add `ngit repo` subcommand group - `ngit repo` (no subcommand): show repository info including maintainer tree, per-maintainer infrastructure attribution, and a note explaining the union-vs-personal field model and recursive maintainer sets - `ngit repo init`: alias for `ngit init` - `ngit repo edit`: same as init but signals intent to update an existing repository announcement - `ngit repo accept`: scoped command for co-maintainers to publish their announcement; errors with clear messages for all other states (trusted maintainer, already accepted, not invited, no repo found) --- src/bin/ngit/cli.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/bin/ngit/cli.rs') diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index 037d17f..fa5d906 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs @@ -106,6 +106,11 @@ pub enum Commands { /// publish a repository to nostr; signal you are its maintainer accepting /// PRs and issues Init(sub_commands::init::SubCommandArgs), + /// manage repository metadata and maintainership + #[command( + long_about = "manage repository metadata and maintainership\n\nrun without a subcommand to show repository info" + )] + Repo(RepoSubCommandArgs), /// submit PR with advanced options #[command( long_about = "submit PR with advanced options\n\nfor a simpler flow, push a branch with the `pr/` prefix using native git:\n git push -o 'title=My PR' -o 'description=details here' -u origin pr/my-branch" @@ -177,3 +182,27 @@ pub struct AccountSubCommandArgs { #[command(subcommand)] pub account_command: AccountCommands, } + +#[derive(clap::Parser)] +pub struct RepoSubCommandArgs { + #[command(subcommand)] + pub repo_command: Option, +} + +#[derive(Subcommand)] +pub enum RepoCommands { + /// publish a repository to nostr (alias for `ngit init`) + Init(sub_commands::init::SubCommandArgs), + /// update repository metadata on nostr + #[command( + long_about = "update repository metadata on nostr\n\nlike `ngit init` but makes clear you are editing an existing repository" + )] + Edit(sub_commands::init::SubCommandArgs), + /// accept an invitation to co-maintain a repository + #[command(long_about = "accept an invitation to co-maintain a repository\n\n\ + publishes your repository announcement to nostr, confirming your co-maintainership.\n\n\ + This is required because your signed announcement is what ties your git state events\n\ + to a specific repository coordinate chain, preventing scammers from attributing your\n\ + commits to a fake repository. See `ngit repo info` for details on the maintainer model.")] + Accept(sub_commands::repo::accept::SubCommandArgs), +} -- cgit v1.2.3