From 3908abbbfc5e748dd168d22bf5e3ea6aae17de61 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 4 Mar 2026 13:28:30 +0000 Subject: feat: add ngit issue list command Non-interactive listing of NIP-34 issues (kind 1621) with status resolution, hashtag display, and detail view. - get_issues_from_cache: fetch GitIssue events from local cache by repo coordinate, mirroring get_proposals_and_revisions_from_cache - ngit issue list: table output of ID, status, title and hashtags at end of each row; status resolved via existing get_status() logic - --status: comma-separated filter (open,draft,closed,applied; default: open) - --hashtag: comma-separated label filter (case-insensitive, OR match) - --json: machine-readable output including hashtags and description - --offline: skip network fetch, use local cache only - : optional positional argument (hex event-id or nevent) to show full details of a specific issue including body content --- src/bin/ngit/cli.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/bin/ngit/cli.rs') diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs index 68b18a7..c2364e6 100644 --- a/src/bin/ngit/cli.rs +++ b/src/bin/ngit/cli.rs @@ -134,6 +134,8 @@ pub enum Commands { #[arg(long)] offline: bool, }, + /// list issues + Issue(IssueSubCommandArgs), /// checkout a proposal branch by event-id or nevent #[command( long_about = "checkout a proposal branch by event-id or nevent\n\nuse `ngit list` to find proposal IDs" @@ -195,6 +197,34 @@ pub struct RepoSubCommandArgs { pub offline: bool, } +#[derive(clap::Parser)] +pub struct IssueSubCommandArgs { + #[command(subcommand)] + pub issue_command: IssueCommands, +} + +#[derive(Subcommand)] +pub enum IssueCommands { + /// list issues and their statuses + List { + /// Filter by status (comma-separated: open,draft,closed,applied) + #[arg(long, default_value = "open")] + status: String, + /// Filter by hashtag/label (comma-separated) + #[arg(long)] + hashtag: Option, + /// Output as JSON + #[arg(long)] + json: bool, + /// Show details for a specific issue (event-id or nevent) + #[arg(value_name = "ID|nevent")] + id: Option, + /// Use local cache only, skip network fetch + #[arg(long)] + offline: bool, + }, +} + #[derive(Subcommand)] pub enum RepoCommands { /// publish a repository to nostr (alias for `ngit init`) -- cgit v1.2.3