Enum anchor_cli::Command
source · [−]pub enum Command {
Show 18 variants
Init {
name: String,
javascript: bool,
no_git: 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,
cargo_args: Vec<String>,
no_docs: bool,
},
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,
cargo_args: Vec<String>,
},
Test {
skip_deploy: bool,
skip_lint: bool,
skip_local_validator: bool,
skip_build: bool,
detach: bool,
args: 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,
cargo_args: Vec<String>,
skip_build: bool,
},
Keys {
subcmd: KeysCommand,
},
Localnet {
skip_build: bool,
skip_deploy: bool,
skip_lint: bool,
cargo_args: Vec<String>,
},
}
Variants
Init
Initializes a workspace.
Build
Fields
skip_lint: bool
True if the build should not fail even if there are no “CHECK” comments where normally required
verifiable: bool
True if the build artifact needs to be deterministic and verifiable.
bootstrap: BootstrapMode
Bootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
no_docs: bool
Suppress doc strings in IDL output
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
program_id: Pubkey
The deployed program to compare against.
bootstrap: BootstrapMode
Bootstrap docker image from scratch, installing all requirements for verifiable builds. Only works for debian-based images.
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_deploy: bool
Use this flag if you want to run tests against previously deployed programs.
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.
detach: bool
Flag to keep the local validator running after tests to be able to check the transactions.
Runs integration tests against a localnetwork.
New
Fields
name: String
Creates a new program.
Idl
Fields
subcmd: IdlCommand
Commands 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
program_id: Pubkey
The program to upgrade.
program_filepath: String
Filepath to the new program binary.
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: ClusterCommand
Cluster commands.
Shell
Starts a node shell with an Anchor client setup according to the local config.
Run
Fields
script: String
The name of the script to run.
Runs the script defined by the current workspace’s Anchor.toml.
Login
Fields
token: String
API access token.
Saves an api token from the registry locally.
Publish
Fields
program: String
The name of the program to publish.
skip_build: bool
Flag to skip building the program in the workspace, use this to save time when publishing the program
Publishes a verified build to the Anchor registry.
Keys
Fields
subcmd: KeysCommand
Keypair commands.
Localnet
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_deploy: bool
Use this flag if you want to run tests against previously deployed programs.
skip_lint: bool
True if the build should not fail even if there are no “CHECK” comments where normally required
Localnet commands.
Trait Implementations
sourceimpl CommandFactory for Command
impl CommandFactory for Command
sourcefn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
Deprecated, replaced with CommandFactory::command_for_update
sourcefn command_for_update<'help>() -> App<'help>
fn command_for_update<'help>() -> App<'help>
sourceimpl FromArgMatches for Command
impl FromArgMatches for Command
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
sourcefn 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>
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
sourcefn 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>
Assign values from ArgMatches
to self
.
sourcefn 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>
Assign values from ArgMatches
to self
.
sourceimpl Parser for Command
impl Parser for Command
sourcefn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Self where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
sourcefn 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,
Parse from iterator, return Err on error.
sourcefn 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,
Update from iterator, exit on error
sourcefn 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,
Update from iterator, return Err on error.
sourceimpl Subcommand for Command
impl Subcommand for Command
sourcefn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
sourcefn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether Self
can parse a specific subcommand
Auto Trait Implementations
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more