upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
new file mode 100644
index 0000000..d0f934e
--- /dev/null
+++ b/src/cli.rs
@@ -0,0 +1,44 @@
1use clap::{Parser, Subcommand};
2
3use crate::sub_commands;
4
5#[derive(Parser)]
6#[command(author, version, about, long_about = None)]
7#[command(propagate_version = true)]
8pub struct Cli {
9 #[command(subcommand)]
10 pub command: Commands,
11 /// remote signer address
12 #[arg(long, global = true)]
13 pub bunker_uri: Option<String>,
14 /// remote signer app secret key
15 #[arg(long, global = true)]
16 pub bunker_app_key: Option<String>,
17 /// nsec or hex private key
18 #[arg(short, long, global = true)]
19 pub nsec: Option<String>,
20 /// password to decrypt nsec
21 #[arg(short, long, global = true)]
22 pub password: Option<String>,
23 /// disable spinner animations
24 #[arg(long, action)]
25 pub disable_cli_spinners: bool,
26}
27
28#[derive(Subcommand)]
29pub enum Commands {
30 /// update cache with latest updates from nostr
31 Fetch(sub_commands::fetch::SubCommandArgs),
32 /// signal you are this repo's maintainer accepting proposals via nostr
33 Init(sub_commands::init::SubCommandArgs),
34 /// issue commits as a proposal
35 Send(sub_commands::send::SubCommandArgs),
36 /// list proposals; checkout, apply or download selected
37 List,
38 /// send proposal revision
39 Push(sub_commands::push::SubCommandArgs),
40 /// fetch and apply new proposal commits / revisions linked to branch
41 Pull,
42 /// run with --nsec flag to change npub
43 Login(sub_commands::login::SubCommandArgs),
44}