diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index 167549cf1..f443311ca 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -4,13 +4,15 @@ This document contains the help content for the `stellar` command-line program. ## `stellar` -With the Stellar CLI you can: +Work seamlessly with Stellar accounts, contracts, and assets from the command line. -- build, deploy and interact with contracts -- set identities to sign with -- configure networks -- generate keys -- more! +- Generate and manage keys and accounts +- Build, deploy, and interact with contracts +- Deploy asset contracts +- Stream events +- Start local testnets +- Decode, encode XDR +- More! For additional information see: @@ -18,21 +20,21 @@ For additional information see: - Smart Contract Docs: https://developers.stellar.org/docs/build/smart-contracts/overview - CLI Docs: https://developers.stellar.org/docs/tools/stellar-cli -The easiest way to get started is to generate a new identity: +To get started generate a new identity: stellar keys generate alice -You can use identities with the `--source` flag in other commands later. +Use keys with the `--source` flag in other commands. -Commands that relate to smart contract interactions are organized under the `contract` subcommand. List them: +Commands that work with contracts are organized under the `contract` subcommand. List them: stellar contract --help -A Soroban contract has its interface schema types embedded in the binary that gets deployed on-chain, making it possible to dynamically generate a custom CLI for each. The invoke subcommand makes use of this: +Use contracts like a CLI: stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- --help -Anything after the `--` double dash (the "slop") is parsed as arguments to the contract-specific CLI, generated on-the-fly from the embedded schema. For the hello world example, with a function called `hello` that takes one string argument `to`, here's how you invoke it: +Anything after the `--` double dash (the "slop") is parsed as arguments to the contract-specific CLI, generated on-the-fly from the contract schema. For the hello world example, with a function called `hello` that takes one string argument `to`, here's how you invoke it: stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- hello --to world @@ -41,15 +43,15 @@ Anything after the `--` double dash (the "slop") is parsed as arguments to the c ###### **Subcommands:** -* `completion` — Print shell completion code for the specified shell * `contract` — Tools for smart contract developers * `events` — Watch the network for contract events * `keys` — Create and manage identities including keys and addresses -* `xdr` — Decode and encode XDR * `network` — Start and configure networks -* `version` — Print version information * `tx` — Sign, Simulate, and Send transactions +* `xdr` — Decode and encode XDR +* `completion` — Print shell completion code for the specified shell * `cache` — Cache for transactions and contract specs +* `version` — Print version information ###### **Options:** @@ -64,28 +66,6 @@ Anything after the `--` double dash (the "slop") is parsed as arguments to the c -## `stellar completion` - -Print shell completion code for the specified shell - -Ensure the completion package for your shell is installed, e.g. bash-completion for bash. - -To enable autocomplete in the current bash shell, run: `source <(stellar completion --shell bash)` - -To enable autocomplete permanently, run: `echo "source <(stellar completion --shell bash)" >> ~/.bashrc` - - -**Usage:** `stellar completion --shell ` - -###### **Options:** - -* `--shell ` — The shell type - - Possible values: `bash`, `elvish`, `fish`, `powershell`, `zsh` - - - - ## `stellar contract` Tools for smart contract developers @@ -819,169 +799,6 @@ Given an identity return its private key -## `stellar xdr` - -Decode and encode XDR - -**Usage:** `stellar xdr [CHANNEL] ` - -###### **Subcommands:** - -* `types` — View information about types -* `guess` — Guess the XDR type -* `decode` — Decode XDR -* `encode` — Encode XDR -* `version` — Print version information - -###### **Arguments:** - -* `` — Channel of XDR to operate on - - Default value: `+curr` - - Possible values: `+curr`, `+next` - - - - -## `stellar xdr types` - -View information about types - -**Usage:** `stellar xdr types ` - -###### **Subcommands:** - -* `list` — -* `schema` — - - - -## `stellar xdr types list` - -**Usage:** `stellar xdr types list [OPTIONS]` - -###### **Options:** - -* `--output ` - - Default value: `plain` - - Possible values: `plain`, `json`, `json-formatted` - - - - -## `stellar xdr types schema` - -**Usage:** `stellar xdr types schema [OPTIONS] --type ` - -###### **Options:** - -* `--type ` — XDR type to decode -* `--output ` - - Default value: `json-schema-draft201909` - - Possible values: `json-schema-draft7`, `json-schema-draft201909` - - - - -## `stellar xdr guess` - -Guess the XDR type - -**Usage:** `stellar xdr guess [OPTIONS] [FILE]` - -###### **Arguments:** - -* `` — File to decode, or stdin if omitted - -###### **Options:** - -* `--input ` - - Default value: `single-base64` - - Possible values: `single`, `single-base64`, `stream`, `stream-base64`, `stream-framed` - -* `--output ` - - Default value: `list` - - Possible values: `list` - -* `--certainty ` — Certainty as an arbitrary value - - Default value: `2` - - - -## `stellar xdr decode` - -Decode XDR - -**Usage:** `stellar xdr decode [OPTIONS] --type [FILES]...` - -###### **Arguments:** - -* `` — Files to decode, or stdin if omitted - -###### **Options:** - -* `--type ` — XDR type to decode -* `--input ` - - Default value: `stream-base64` - - Possible values: `single`, `single-base64`, `stream`, `stream-base64`, `stream-framed` - -* `--output ` - - Default value: `json` - - Possible values: `json`, `json-formatted`, `rust-debug`, `rust-debug-formatted` - - - - -## `stellar xdr encode` - -Encode XDR - -**Usage:** `stellar xdr encode [OPTIONS] --type [FILES]...` - -###### **Arguments:** - -* `` — Files to encode, or stdin if omitted - -###### **Options:** - -* `--type ` — XDR type to encode -* `--input ` - - Default value: `json` - - Possible values: `json` - -* `--output ` - - Default value: `single-base64` - - Possible values: `single`, `single-base64` - - - - -## `stellar xdr version` - -Print version information - -**Usage:** `stellar xdr version` - - - ## `stellar network` Start and configure networks @@ -1181,14 +998,6 @@ Stop a network container started with `network container start` -## `stellar version` - -Print version information - -**Usage:** `stellar version` - - - ## `stellar tx` Sign, Simulate, and Send transactions @@ -1234,6 +1043,191 @@ Calculate the hash of a transaction envelope from stdin +## `stellar xdr` + +Decode and encode XDR + +**Usage:** `stellar xdr [CHANNEL] ` + +###### **Subcommands:** + +* `types` — View information about types +* `guess` — Guess the XDR type +* `decode` — Decode XDR +* `encode` — Encode XDR +* `version` — Print version information + +###### **Arguments:** + +* `` — Channel of XDR to operate on + + Default value: `+curr` + + Possible values: `+curr`, `+next` + + + + +## `stellar xdr types` + +View information about types + +**Usage:** `stellar xdr types ` + +###### **Subcommands:** + +* `list` — +* `schema` — + + + +## `stellar xdr types list` + +**Usage:** `stellar xdr types list [OPTIONS]` + +###### **Options:** + +* `--output ` + + Default value: `plain` + + Possible values: `plain`, `json`, `json-formatted` + + + + +## `stellar xdr types schema` + +**Usage:** `stellar xdr types schema [OPTIONS] --type ` + +###### **Options:** + +* `--type ` — XDR type to decode +* `--output ` + + Default value: `json-schema-draft201909` + + Possible values: `json-schema-draft7`, `json-schema-draft201909` + + + + +## `stellar xdr guess` + +Guess the XDR type + +**Usage:** `stellar xdr guess [OPTIONS] [FILE]` + +###### **Arguments:** + +* `` — File to decode, or stdin if omitted + +###### **Options:** + +* `--input ` + + Default value: `single-base64` + + Possible values: `single`, `single-base64`, `stream`, `stream-base64`, `stream-framed` + +* `--output ` + + Default value: `list` + + Possible values: `list` + +* `--certainty ` — Certainty as an arbitrary value + + Default value: `2` + + + +## `stellar xdr decode` + +Decode XDR + +**Usage:** `stellar xdr decode [OPTIONS] --type [FILES]...` + +###### **Arguments:** + +* `` — Files to decode, or stdin if omitted + +###### **Options:** + +* `--type ` — XDR type to decode +* `--input ` + + Default value: `stream-base64` + + Possible values: `single`, `single-base64`, `stream`, `stream-base64`, `stream-framed` + +* `--output ` + + Default value: `json` + + Possible values: `json`, `json-formatted`, `rust-debug`, `rust-debug-formatted` + + + + +## `stellar xdr encode` + +Encode XDR + +**Usage:** `stellar xdr encode [OPTIONS] --type [FILES]...` + +###### **Arguments:** + +* `` — Files to encode, or stdin if omitted + +###### **Options:** + +* `--type ` — XDR type to encode +* `--input ` + + Default value: `json` + + Possible values: `json` + +* `--output ` + + Default value: `single-base64` + + Possible values: `single`, `single-base64` + + + + +## `stellar xdr version` + +Print version information + +**Usage:** `stellar xdr version` + + + +## `stellar completion` + +Print shell completion code for the specified shell + +Ensure the completion package for your shell is installed, e.g. bash-completion for bash. + +To enable autocomplete in the current bash shell, run: `source <(stellar completion --shell bash)` + +To enable autocomplete permanently, run: `echo "source <(stellar completion --shell bash)" >> ~/.bashrc` + + +**Usage:** `stellar completion --shell ` + +###### **Options:** + +* `--shell ` — The shell type + + Possible values: `bash`, `elvish`, `fish`, `powershell`, `zsh` + + + + ## `stellar cache` Cache for transactions and contract specs @@ -1303,3 +1297,11 @@ Read cached action +## `stellar version` + +Print version information + +**Usage:** `stellar version` + + + diff --git a/cmd/soroban-cli/src/commands/config/locator.rs b/cmd/soroban-cli/src/commands/config/locator.rs index 5dc4dae85..cbcb9e8b3 100644 --- a/cmd/soroban-cli/src/commands/config/locator.rs +++ b/cmd/soroban-cli/src/commands/config/locator.rs @@ -80,7 +80,7 @@ pub struct Args { pub global: bool, /// Location of config directory, default is "." - #[arg(long, help_heading = "TESTING_OPTIONS")] + #[arg(long)] pub config_dir: Option, } diff --git a/cmd/soroban-cli/src/commands/mod.rs b/cmd/soroban-cli/src/commands/mod.rs index 0d5fcff57..a9f10bdd8 100644 --- a/cmd/soroban-cli/src/commands/mod.rs +++ b/cmd/soroban-cli/src/commands/mod.rs @@ -18,13 +18,16 @@ pub mod version; pub mod txn_result; pub const HEADING_RPC: &str = "Options (RPC)"; -const ABOUT: &str = "With the Stellar CLI you can: +const ABOUT: &str = + "Work seamlessly with Stellar accounts, contracts, and assets from the command line. -- build, deploy and interact with contracts -- set identities to sign with -- configure networks -- generate keys -- more! +- Generate and manage keys and accounts +- Build, deploy, and interact with contracts +- Deploy asset contracts +- Stream events +- Start local testnets +- Decode, encode XDR +- More! For additional information see: @@ -35,21 +38,21 @@ For additional information see: // long_about is shown when someone uses `--help`; short help when using `-h` const LONG_ABOUT: &str = " -The easiest way to get started is to generate a new identity: +To get started generate a new identity: stellar keys generate alice -You can use identities with the `--source` flag in other commands later. +Use keys with the `--source` flag in other commands. -Commands that relate to smart contract interactions are organized under the `contract` subcommand. List them: +Commands that work with contracts are organized under the `contract` subcommand. List them: stellar contract --help -A Soroban contract has its interface schema types embedded in the binary that gets deployed on-chain, making it possible to dynamically generate a custom CLI for each. The invoke subcommand makes use of this: +Use contracts like a CLI: stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- --help -Anything after the `--` double dash (the \"slop\") is parsed as arguments to the contract-specific CLI, generated on-the-fly from the embedded schema. For the hello world example, with a function called `hello` that takes one string argument `to`, here's how you invoke it: +Anything after the `--` double dash (the \"slop\") is parsed as arguments to the contract-specific CLI, generated on-the-fly from the contract schema. For the hello world example, with a function called `hello` that takes one string argument `to`, here's how you invoke it: stellar contract invoke --id CCR6QKTWZQYW6YUJ7UP7XXZRLWQPFRV6SWBLQS4ZQOSAF4BOUD77OTE2 --source alice --network testnet -- hello --to world "; @@ -125,30 +128,35 @@ impl FromStr for Root { #[derive(Parser, Debug)] pub enum Cmd { - /// Print shell completion code for the specified shell. - #[command(long_about = completion::LONG_ABOUT)] - Completion(completion::Cmd), /// Tools for smart contract developers #[command(subcommand)] Contract(contract::Cmd), /// Watch the network for contract events Events(events::Cmd), + /// Create and manage identities including keys and addresses #[command(subcommand)] Keys(keys::Cmd), - /// Decode and encode XDR - Xdr(stellar_xdr::cli::Root), + /// Start and configure networks #[command(subcommand)] Network(network::Cmd), - /// Print version information - Version(version::Cmd), + /// Sign, Simulate, and Send transactions #[command(subcommand)] Tx(tx::Cmd), + + /// Decode and encode XDR + Xdr(stellar_xdr::cli::Root), + + /// Print shell completion code for the specified shell. + #[command(long_about = completion::LONG_ABOUT)] + Completion(completion::Cmd), /// Cache for transactions and contract specs #[command(subcommand)] Cache(cache::Cmd), + /// Print version information + Version(version::Cmd), } #[derive(thiserror::Error, Debug)]