pub enum Command {
Show 20 variants
Init {
name: String,
javascript: bool,
solidity: bool,
no_install: bool,
package_manager: PackageManager,
no_git: bool,
template: ProgramTemplate,
test_template: TestTemplate,
force: bool,
},
Build {Show 13 fields
skip_lint: bool,
no_idl: bool,
idl: Option<String>,
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 {
program_name: Option<String>,
skip_deploy: bool,
skip_lint: bool,
skip_local_validator: bool,
skip_build: bool,
no_idl: bool,
arch: ProgramArch,
detach: bool,
run: Vec<String>,
args: Vec<String>,
env: Vec<String>,
cargo_args: Vec<String>,
},
New {
name: String,
solidity: bool,
template: ProgramTemplate,
force: bool,
},
Idl {
subcmd: IdlCommand,
},
Clean,
Deploy {
program_name: Option<String>,
program_keypair: Option<String>,
verifiable: bool,
solana_args: Vec<String>,
},
Migrate,
Upgrade {
program_id: Pubkey,
program_filepath: String,
max_retries: u32,
solana_args: Vec<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>,
},
Completions {
shell: Shell,
},
}
Variants§
Init
Initializes a workspace.
Fields
package_manager: PackageManager
Package Manager to use
template: ProgramTemplate
Rust program template to use
test_template: TestTemplate
Test template to use
Build
Builds the workspace.
Fields
bootstrap: BootstrapMode
Bootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
arch: ProgramArch
Architecture to use when building the program
Expand
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
Fields
Verify
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.
Fields
bootstrap: BootstrapMode
Bootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
arch: ProgramArch
Architecture to use when building the program
Test
Runs integration tests.
Fields
skip_lint: bool
True if the build should not fail even if there are no “CHECK” comments where normally required
skip_local_validator: bool
Flag to skip starting a local validator, if the configured cluster url is a localnet.
skip_build: bool
Flag to skip building the program in the workspace, use this to save time when running test and the program code is not altered.
arch: ProgramArch
Architecture to use when building the program
New
Creates a new program.
Fields
template: ProgramTemplate
Rust program template to use
Idl
Commands for interacting with interface definitions.
Fields
subcmd: IdlCommand
Clean
Remove all artifacts from the generated directories except program keypairs.
Deploy
Deploys each program in the workspace.
Fields
Migrate
Runs the deploy migration script.
Upgrade
Deploys, initializes an IDL, and migrates all in one command. Upgrades a single program. The configured wallet must be the upgrade authority.
Fields
Cluster
Cluster commands.
Fields
subcmd: ClusterCommand
Shell
Starts a node shell with an Anchor client setup according to the local config.
Run
Runs the script defined by the current workspace’s Anchor.toml.
Fields
Login
Saves an api token from the registry locally.
Publish
Publishes a verified build to the Anchor registry.
Fields
skip_build: bool
Flag to skip building the program in the workspace, use this to save time when publishing the program
arch: ProgramArch
Architecture to use when building the program
Keys
Program keypair commands.
Fields
subcmd: KeysCommand
Localnet
Localnet commands.
Fields
skip_build: bool
Flag 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: bool
True if the build should not fail even if there are no “CHECK” comments where normally required
arch: ProgramArch
Architecture to use when building the program
Account
Fetch and deserialize an account using the IDL provided.
Fields
Completions
Generates shell completions.
Trait Implementations§
Source§impl CommandFactory for Command
impl CommandFactory for Command
Source§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) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command
so it can instantiate self
via
FromArgMatches::update_from_arg_matches_mut
Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self
can parse a specific subcommand