shadow_drive_cli/
lib.rs

1pub mod command;
2pub mod process;
3
4pub mod state;
5pub mod utils;
6
7use clap::Parser;
8
9use command::{drive::*, nft::*};
10
11/// Manually specify a cluster url and/or keypair.
12/// Those values otherwise default to the Solana CLI config file.
13/// All values other than `url` and `keypair` exist only to satisfy compatibility
14/// with keypair resolution.
15#[derive(Debug, Parser)]
16pub struct ConfigOverride {
17    /// The target URL for the cluster. See Solana CLI documentation on how to use this.
18    /// Default values and usage patterns are identical to Solana CLI.
19    #[clap(short, long)]
20    pub url: Option<String>,
21    /// The target signer for transactions. See Solana CLI documentation on how to use this.
22    /// Default values and usage patterns are identical to Solana CLI.
23    #[clap(short, long)]
24    pub keypair: Option<String>,
25    // The CLI options listed below are needed to resolve certain signer paths
26    /// Skip BIP-39 seed phrase validation (not recommended)
27    #[clap(long, name = "skip_seed_phrase_validation")]
28    pub skip_seed_phrase_validation: bool,
29    /// Manually confirm the signer before proceeding
30    #[clap(long, name = "confirm_key")]
31    pub confirm_key: bool,
32    /// Bypass the manual confirmation on various operations that
33    /// alter the state of the storage network.
34    #[clap(long)]
35    pub skip_confirm: bool,
36    /// Supply a JWT to be included as a Bearer auth token to each RPC request.
37    /// Use keyword "genesysgo" to automatically
38    /// authenticate with a GenesysGo Premium RPC endpoint.
39    /// GenesysGo Account ID is inferred from `-u/--url` path.
40    /// See also the `shadow-rpc-auth` subcommand for manually
41    /// acquiring an auth token.
42    #[clap(long)]
43    pub auth: Option<String>,
44}
45
46/// Perform Shadow Drive operations on the command-line.
47/// This CLI is written in Rust, and conforms to the interfaces
48/// for signer specification available in the official
49/// Solana command-line binaries such as `solana` and `spl-token`.
50#[derive(Debug, Parser)]
51pub struct Opts {
52    #[clap(flatten)]
53    pub cfg_override: ConfigOverride,
54    #[clap(subcommand)]
55    pub command: Command,
56}
57
58#[derive(Debug, Parser)]
59pub enum Command {
60    /// Commands for creating and managing shadow drive accounts and files
61    #[clap(subcommand, name = "drive")]
62    DriveCommand(DriveCommand),
63
64    /// Commands for creating and managing shadow nft minters and metadata accounts
65    #[clap(subcommand, name = "nft")]
66    NftCommand(NftCommand),
67}