pub enum Command {
Show 28 variants
Init {
name: String,
javascript: bool,
no_install: bool,
package_manager: PackageManager,
no_git: bool,
template: ProgramTemplate,
test_template: TestTemplate,
force: bool,
install_agent_skills: bool,
},
Build {Show 13 fields
skip_lint: bool,
ignore_keys: 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,
},
Expand {
program_name: Option<String>,
cargo_args: Vec<String>,
},
Verify {
program_id: Pubkey,
repo_url: Option<String>,
commit_hash: Option<String>,
current_dir: bool,
program_name: Option<String>,
args: Vec<String>,
},
Test {
program_name: Option<String>,
skip_deploy: bool,
skip_lint: bool,
skip_local_validator: bool,
skip_build: bool,
no_idl: bool,
detach: bool,
run: Vec<String>,
validator: ValidatorType,
args: Vec<String>,
env: Vec<String>,
cargo_args: Vec<String>,
},
New {
name: String,
template: ProgramTemplate,
force: bool,
},
Idl {
subcmd: IdlCommand,
},
Clean,
Deploy {
program_name: Option<String>,
program_keypair: Option<String>,
verifiable: bool,
no_idl: bool,
solana_args: Vec<String>,
},
Migrate,
Upgrade {
program_id: Pubkey,
program_filepath: String,
max_retries: u32,
solana_args: Vec<String>,
},
Airdrop {
amount: f64,
pubkey: Option<Pubkey>,
},
Cluster {
subcmd: ClusterCommand,
},
Config {
subcmd: ConfigCommand,
},
Shell,
Run {
script: String,
script_args: Vec<String>,
},
Keys {
subcmd: KeysCommand,
},
Localnet {
skip_build: bool,
skip_deploy: bool,
skip_lint: bool,
ignore_keys: bool,
validator: ValidatorType,
env: Vec<String>,
cargo_args: Vec<String>,
},
Account {
account_type: String,
address: Pubkey,
idl: Option<String>,
},
Completions {
shell: Shell,
},
Address,
Balance {
pubkey: Option<Pubkey>,
lamports: bool,
},
Epoch,
EpochInfo,
Logs {
include_votes: bool,
address: Option<Vec<Pubkey>>,
},
ShowAccount {
cmd: ShowAccountCommand,
},
Keygen {
subcmd: KeygenCommand,
},
Program {
subcmd: ProgramCommand,
},
}Variants§
Init
Initializes a workspace.
Fields
package_manager: PackageManagerPackage Manager to use
template: ProgramTemplateRust program template to use
test_template: TestTemplateTest template to use
Build
Builds the workspace.
Fields
bootstrap: BootstrapModeBootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
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
current_dir: boolVerify against the source code in the current directory. Conflicts with --repo-url.
Test
Runs integration tests.
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.
detach: boolFlag to keep the local validator running after tests to be able to check the transactions.
validator: ValidatorTypeValidator type to use for local testing
New
Creates a new program.
Fields
template: ProgramTemplateRust program template to use
Idl
Commands for interacting with interface definitions.
Fields
subcmd: IdlCommandClean
Remove all artifacts from the generated directories except program keypairs.
Deploy
use anchor program deploy instead
Deploys each program in the workspace.
Fields
program_name: Option<String>use anchor program deploy instead
Only deploy this program
program_keypair: Option<String>use anchor program deploy instead
Keypair of the program (filepath) (requires program-name)
verifiable: booluse anchor program deploy instead
If true, deploy from path target/verifiable
Migrate
Runs the deploy migration script.
Upgrade
use anchor program upgrade instead
Deploys, initializes an IDL, and migrates all in one command. Upgrades a single program. The configured wallet must be the upgrade authority.
Fields
program_id: Pubkeyuse anchor program upgrade instead
The program to upgrade.
program_filepath: Stringuse anchor program upgrade instead
Filepath to the new program binary.
Airdrop
Request an airdrop of SOL
Fields
Cluster
Cluster commands.
Fields
subcmd: ClusterCommandConfig
Configuration management commands.
Fields
subcmd: ConfigCommandShell
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
Keys
Program keypair commands.
Fields
subcmd: KeysCommandLocalnet
Localnet commands.
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
validator: ValidatorTypeValidator type to use for local testing
Account
Fetch and deserialize an account using the IDL provided.
Fields
Completions
Generates shell completions.
Address
Get your public key
Balance
Get your balance
Fields
Epoch
Get current epoch
EpochInfo
Get information about the current epoch
Logs
Stream transaction logs
Fields
ShowAccount
Show the contents of an account
Fields
cmd: ShowAccountCommandKeygen
Keypair generation and management
Fields
subcmd: KeygenCommandProgram
Program deployment and management commands
Fields
subcmd: ProgramCommandTrait 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 subcommandAuto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.