Enum anchor_cli::Command
source · pub enum Command {
Show 19 variants
Init {
name: String,
javascript: bool,
no_git: bool,
jest: bool,
},
Build {
idl: Option<String>,
skip_lint: bool,
idl_ts: Option<String>,
verifiable: bool,
program_name: Option<String>,
solana_version: Option<String>,
docker_image: Option<String>,
bootstrap: BootstrapMode,
env: Vec<String>,
cargo_args: Vec<String>,
no_docs: bool,
arch: ProgramArch,
},
Expand {
program_name: Option<String>,
cargo_args: Vec<String>,
},
Verify {
program_id: Pubkey,
program_name: Option<String>,
solana_version: Option<String>,
docker_image: Option<String>,
bootstrap: BootstrapMode,
arch: ProgramArch,
env: Vec<String>,
cargo_args: Vec<String>,
skip_build: bool,
},
Test {
skip_deploy: bool,
skip_lint: bool,
skip_local_validator: bool,
skip_build: bool,
arch: ProgramArch,
detach: bool,
run: Vec<String>,
args: Vec<String>,
env: Vec<String>,
cargo_args: Vec<String>,
},
New {
name: String,
},
Idl {
subcmd: IdlCommand,
},
Clean,
Deploy {
program_name: Option<String>,
program_keypair: Option<String>,
},
Migrate,
Upgrade {
program_id: Pubkey,
program_filepath: String,
},
Cluster {
subcmd: ClusterCommand,
},
Shell,
Run {
script: String,
script_args: Vec<String>,
},
Login {
token: String,
},
Publish {
program: String,
env: Vec<String>,
cargo_args: Vec<String>,
skip_build: bool,
arch: ProgramArch,
},
Keys {
subcmd: KeysCommand,
},
Localnet {
skip_build: bool,
skip_deploy: bool,
skip_lint: bool,
arch: ProgramArch,
env: Vec<String>,
cargo_args: Vec<String>,
},
Account {
account_type: String,
address: Pubkey,
idl: Option<String>,
},
}Variants§
Init
Initializes a workspace.
Build
Fields
skip_lint: boolTrue if the build should not fail even if there are no “CHECK” comments where normally required
bootstrap: BootstrapModeBootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
arch: ProgramArchArchitecture to use when building the program
Builds the workspace.
Expand
Fields
Expands macros (wrapper around cargo expand)
Use it in a program folder to expand program
Use it in a workspace but outside a program folder to expand the entire workspace
Verify
Fields
bootstrap: BootstrapModeBootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
arch: ProgramArchArchitecture to use when building the program
Verifies the on-chain bytecode matches the locally compiled artifact. Run this command inside a program subdirectory, i.e., in the dir containing the program’s Cargo.toml.
Test
Fields
skip_lint: boolTrue if the build should not fail even if there are no “CHECK” comments where normally required
skip_local_validator: boolFlag to skip starting a local validator, if the configured cluster url is a localnet.
skip_build: boolFlag to skip building the program in the workspace, use this to save time when running test and the program code is not altered.
arch: ProgramArchArchitecture to use when building the program
Runs integration tests against a localnetwork.
New
Creates a new program.
Idl
Fields
subcmd: IdlCommandCommands for interacting with interface definitions.
Clean
Remove all artifacts from the target directory except program keypairs.
Deploy
Fields
Deploys each program in the workspace.
Migrate
Runs the deploy migration script.
Upgrade
Fields
Deploys, initializes an IDL, and migrates all in one command. Upgrades a single program. The configured wallet must be the upgrade authority.
Cluster
Fields
subcmd: ClusterCommandCluster commands.
Shell
Starts a node shell with an Anchor client setup according to the local config.
Run
Fields
Runs the script defined by the current workspace’s Anchor.toml.
Login
Saves an api token from the registry locally.
Publish
Fields
skip_build: boolFlag to skip building the program in the workspace, use this to save time when publishing the program
arch: ProgramArchArchitecture to use when building the program
Publishes a verified build to the Anchor registry.
Keys
Fields
subcmd: KeysCommandKeypair commands.
Localnet
Fields
skip_build: boolFlag to skip building the program in the workspace, use this to save time when running test and the program code is not altered.
skip_lint: boolTrue if the build should not fail even if there are no “CHECK” comments where normally required
arch: ProgramArchArchitecture to use when building the program
Localnet commands.
Account
Fields
Fetch and deserialize an account using the IDL provided.
Trait Implementations§
source§impl CommandFactory for Command
impl CommandFactory for Command
source§fn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
CommandFactory::command_for_updatesource§impl FromArgMatches for Command
impl FromArgMatches for Command
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>
ArgMatches to self.source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>
ArgMatches to self.source§impl Parser for Command
impl Parser for Command
source§fn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Selfwhere I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
source§fn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I)where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
source§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,
source§impl Subcommand for Command
impl Subcommand for Command
source§fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
source§fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
source§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand