From 3ac5395b47c709c00f0072668dfdceb04f2d4974 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 5 Mar 2026 11:33:10 +0000 Subject: feat(label): add `ngit issue label` and `ngit pr label` commands Publishes a NIP-32 kind-1985 label event referencing the target issue or PR. Only the event author or a repository maintainer may apply labels. Duplicate labels (already present via t-tags or prior kind-1985 events) are silently skipped. The new event is saved to the local cache before broadcasting so subsequent reads reflect the change immediately. CLI: ngit issue label --label [--label ...] ngit pr label --label [--label ...] --- src/bin/ngit/cli.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/bin/ngit/cli.rs') diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index ccf25bb..b9b274e 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs @@ -301,6 +301,18 @@ pub enum PrCommands { #[arg(long)] offline: bool, }, + /// add one or more labels to a PR (author or maintainer only) + Label { + /// Proposal event-id (hex) or nevent (bech32) + #[arg(value_name = "ID|nevent")] + id: String, + /// Label to apply (repeatable: --label bug --label help-wanted) + #[arg(long = "label", value_name = "LABEL", required = true)] + labels: Vec, + /// Use local cache only, skip network fetch + #[arg(long)] + offline: bool, + }, } // --------------------------------------------------------------------------- @@ -395,6 +407,18 @@ pub enum IssueCommands { #[arg(long)] offline: bool, }, + /// add one or more labels to an issue (author or maintainer only) + Label { + /// Issue event-id (hex) or nevent (bech32) + #[arg(value_name = "ID|nevent")] + id: String, + /// Label to apply (repeatable: --label bug --label help-wanted) + #[arg(long = "label", value_name = "LABEL", required = true)] + labels: Vec, + /// Use local cache only, skip network fetch + #[arg(long)] + offline: bool, + }, } #[derive(Subcommand)] -- cgit v1.2.3