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-05 10:58:37 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-03-05 10:58:37 +0000
commit2f2819cc2365be07fedfd35ab3654b3607e29e76 (patch)
treed59b4ce913500ae1c0b31ce0982c7756f3195a59 /src/bin/ngit/cli.rs
parent4d23e609ec3d6c25b5f5918fd317eef02a434efe (diff)
add `ngit account whoami` command
Shows currently logged-in account(s) with name and npub. When both a local (repo-scoped) and global account are configured, displays both with local marked as active. Supports --json (returns local, global, and active objects each with name, npub, nip05, scope) and --offline (reads from cache only, no network). Fixes doc_markdown clippy warning in cli.rs.
Diffstat (limited to 'src/bin/ngit/cli.rs')
-rw-r--r--src/bin/ngit/cli.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/ngit/cli.rs b/src/bin/ngit/cli.rs
index 5feaf31..ccf25bb 100644
--- a/src/bin/ngit/cli.rs
+++ b/src/bin/ngit/cli.rs
@@ -143,6 +143,8 @@ pub enum AccountCommands {
143 ExportKeys, 143 ExportKeys,
144 /// create a new nostr account 144 /// create a new nostr account
145 Create(sub_commands::create::SubCommandArgs), 145 Create(sub_commands::create::SubCommandArgs),
146 /// show currently logged-in account(s)
147 Whoami(sub_commands::whoami::SubCommandArgs),
146} 148}
147 149
148#[derive(clap::Parser)] 150#[derive(clap::Parser)]
@@ -158,7 +160,7 @@ pub struct RepoSubCommandArgs {
158 /// Use local cache only, skip network fetch 160 /// Use local cache only, skip network fetch
159 #[arg(long)] 161 #[arg(long)]
160 pub offline: bool, 162 pub offline: bool,
161 /// Output repository info as JSON; is_nostr_repo is false when not in a nostr repository 163 /// Output repository info as JSON; `is_nostr_repo` is false when not in a nostr repository
162 #[arg(long)] 164 #[arg(long)]
163 pub json: bool, 165 pub json: bool,
164} 166}