jito_restaking_cli/
cli_args.rs

1use std::path::PathBuf;
2
3use clap::{Parser, Subcommand};
4
5use crate::{restaking::RestakingCommands, vault::VaultCommands};
6
7#[derive(Parser)]
8#[command(author, version, about = "A CLI for managing restaking and vault operations", long_about = None)]
9pub struct Cli {
10    #[command(subcommand)]
11    pub command: Option<ProgramCommand>,
12
13    #[arg(long, global = true, help = "Path to the configuration file")]
14    pub config_file: Option<PathBuf>,
15
16    #[arg(long, global = true, help = "RPC URL to use")]
17    pub rpc_url: Option<String>,
18
19    #[arg(long, global = true, help = "Commitment level")]
20    pub commitment: Option<String>,
21
22    #[arg(long, global = true, help = "Restaking program ID")]
23    pub restaking_program_id: Option<String>,
24
25    #[arg(long, global = true, help = "Vault program ID")]
26    pub vault_program_id: Option<String>,
27
28    #[arg(long, global = true, help = "Filepath or URL to a keypair")]
29    pub signer: Option<String>,
30
31    #[arg(long, global = true, help = "Verbose mode")]
32    pub verbose: bool,
33
34    #[arg(
35        long,
36        global = true,
37        default_value = "false",
38        help = "This will print out the raw TX instead of running it"
39    )]
40    pub print_tx: bool,
41
42    #[arg(
43        long,
44        global = true,
45        default_value = "false",
46        help = "This will print out account information in JSON format"
47    )]
48    pub print_json: bool,
49
50    #[arg(
51        long,
52        global = true,
53        default_value = "false",
54        help = "This will print out account information in JSON format with reserved space"
55    )]
56    pub print_json_with_reserves: bool,
57
58    #[arg(long, global = true, hide = true)]
59    pub markdown_help: bool,
60}
61
62#[derive(Subcommand)]
63pub enum ProgramCommand {
64    /// Restaking program commands
65    Restaking {
66        #[command(subcommand)]
67        action: RestakingCommands,
68    },
69    /// Vault program commands
70    Vault {
71        #[command(subcommand)]
72        action: VaultCommands,
73    },
74}