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 16:59:45 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-03-04 16:59:45 +0000
commitecae4bd13c1e28d7efd9ee9bb106ff27fa0451f6 (patch)
tree96d8208535e8ee672d383dac70446c3cd4865e00 /src/bin/ngit/cli.rs
parentaf016dd23101537ccc8ecd5a992bf3b7c6d3abe9 (diff)
add `ngit repo --json` for machine-readable repo detection
Outputs {"is_nostr_repo": false} when not in a nostr repository, or full structured JSON (name, identifier, description, nostr_url, coordinate, maintainers, grasp_servers, git_servers, relays, hashtags) when it is. Always exits 0. Also adds --title as an alias for --name on `ngit init`.
Diffstat (limited to 'src/bin/ngit/cli.rs')
-rw-r--r--src/bin/ngit/cli.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs
index 5ee9165..5feaf31 100644
--- a/src/bin/ngit/cli.rs
+++ b/src/bin/ngit/cli.rs
@@ -158,6 +158,9 @@ pub struct RepoSubCommandArgs {
158 /// Use local cache only, skip network fetch 158 /// Use local cache only, skip network fetch
159 #[arg(long)] 159 #[arg(long)]
160 pub offline: bool, 160 pub offline: bool,
161 /// Output repository info as JSON; is_nostr_repo is false when not in a nostr repository
162 #[arg(long)]
163 pub json: bool,
161} 164}
162 165
163// --------------------------------------------------------------------------- 166// ---------------------------------------------------------------------------