upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/cli.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-03-04 13:28:30 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-03-04 13:28:30 +0000
commit3908abbbfc5e748dd168d22bf5e3ea6aae17de61 (patch)
tree7d16390d57f8a7399212ebc30e6524ed25da1db6 /src/bin/ngit/cli.rs
parenta554da3ec0bdfef648921fda41f38ad0a5d53d27 (diff)
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 - <id>: optional positional argument (hex event-id or nevent) to show full details of a specific issue including body content
Diffstat (limited to 'src/bin/ngit/cli.rs')
-rw-r--r--src/bin/ngit/cli.rs30
1 files changed, 30 insertions, 0 deletions
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 {
134 #[arg(long)] 134 #[arg(long)]
135 offline: bool, 135 offline: bool,
136 }, 136 },
137 /// list issues
138 Issue(IssueSubCommandArgs),
137 /// checkout a proposal branch by event-id or nevent 139 /// checkout a proposal branch by event-id or nevent
138 #[command( 140 #[command(
139 long_about = "checkout a proposal branch by event-id or nevent\n\nuse `ngit list` to find proposal IDs" 141 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 {
195 pub offline: bool, 197 pub offline: bool,
196} 198}
197 199
200#[derive(clap::Parser)]
201pub struct IssueSubCommandArgs {
202 #[command(subcommand)]
203 pub issue_command: IssueCommands,
204}
205
206#[derive(Subcommand)]
207pub enum IssueCommands {
208 /// list issues and their statuses
209 List {
210 /// Filter by status (comma-separated: open,draft,closed,applied)
211 #[arg(long, default_value = "open")]
212 status: String,
213 /// Filter by hashtag/label (comma-separated)
214 #[arg(long)]
215 hashtag: Option<String>,
216 /// Output as JSON
217 #[arg(long)]
218 json: bool,
219 /// Show details for a specific issue (event-id or nevent)
220 #[arg(value_name = "ID|nevent")]
221 id: Option<String>,
222 /// Use local cache only, skip network fetch
223 #[arg(long)]
224 offline: bool,
225 },
226}
227
198#[derive(Subcommand)] 228#[derive(Subcommand)]
199pub enum RepoCommands { 229pub enum RepoCommands {
200 /// publish a repository to nostr (alias for `ngit init`) 230 /// publish a repository to nostr (alias for `ngit init`)