Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 42 additions & 44 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See:


COMMAND GROUPS:
{config-wallet,contract,tx,validator,ledger,wallet,validator-wallet,deps,config,localnet,data,staking-provider,dns,faucet,multisig,governance,env,get}
{config-wallet,contract,tx,validator,ledger,wallet,validator-wallet,deps,config,localnet,data,staking-provider,dns,faucet,multisig,governance,config-env,get}

TOP-LEVEL OPTIONS:
-h, --help show this help message and exit
Expand Down Expand Up @@ -51,7 +51,7 @@ dns Operations related to the Domain Name Service
faucet Get xEGLD on Devnet or Testnet
multisig Deploy and interact with the Multisig Smart Contract
governance Propose, vote and interact with the governance contract.
env Configure MultiversX CLI to use specific environment values.
config-env Configure MultiversX CLI to use specific environment values.
get Get info from the network.

```
Expand Down Expand Up @@ -5632,12 +5632,12 @@ options:
--proxy PROXY 🔗 the URL of the proxy

```
## Group **Environment**
## Group **ConfigEnv**


```
$ mxpy env --help
usage: mxpy env COMMAND [-h] ...
$ mxpy config-env --help
usage: mxpy config-env COMMAND [-h] ...

Configure MultiversX CLI to use specific environment values.

Expand All @@ -5651,72 +5651,74 @@ OPTIONS:
COMMANDS summary
----------------
new Creates a new environment and sets it as the active environment.
get Gets an env value from the active environment.
set Sets an env value for the active environment.
get Gets an env value from the specified environment.
set Sets an env value for the specified environment.
dump Dumps the active environment.
delete Deletes an env value from the active environment.
delete Deletes an env value from the specified environment.
switch Switch to a different environment.
list List available environments
remove Deletes an environment from the env file. Will switch to default env.
remove Deletes an environment from the env file. Use `mxpy config-env switch` to move to another env.
reset Deletes the environment file. Default env will be used.

```
### Environment.New
### ConfigEnv.New


```
$ mxpy env new --help
usage: mxpy env new [-h] ...
$ mxpy config-env new --help
usage: mxpy config-env new [-h] ...

Creates a new environment and sets it as the active environment.

positional arguments:
name the name of the configuration entry
name the name of the new environment

options:
-h, --help show this help message and exit
--template TEMPLATE an environment from which to create the new environment

```
### Environment.Set
### ConfigEnv.Set


```
$ mxpy env set --help
usage: mxpy env set [-h] ...
$ mxpy config-env set --help
usage: mxpy config-env set [-h] ...

Sets an env value for the active environment.
Sets an env value for the specified environment.

positional arguments:
name the name of the configuration entry
value the new value

options:
-h, --help show this help message and exit
--env ENV the name of the environment to operate on

```
### Environment.Get
### ConfigEnv.Get


```
$ mxpy env get --help
usage: mxpy env get [-h] ...
$ mxpy config-env get --help
usage: mxpy config-env get [-h] ...

Gets an env value from the active environment.
Gets an env value from the specified environment.

positional arguments:
name the name of the configuration entry

options:
-h, --help show this help message and exit
--env ENV the name of the environment to operate on

```
### Environment.Dump
### ConfigEnv.Dump


```
$ mxpy env dump --help
usage: mxpy env dump [-h] ...
$ mxpy config-env dump --help
usage: mxpy config-env dump [-h] ...

Dumps the active environment.

Expand All @@ -5725,57 +5727,53 @@ options:
--default dumps the default environment instead of the active one.

```
### Environment.Switch
### ConfigEnv.Switch


```
$ mxpy env switch --help
usage: mxpy env switch [-h] ...
$ mxpy config-env switch --help
usage: mxpy config-env switch [-h] ...

Switch to a different environment.

positional arguments:
name the name of the configuration entry

options:
-h, --help show this help message and exit
--env ENV the name of the environment to operate on

```
### Environment.List
### ConfigEnv.List


```
$ mxpy env list --help
usage: mxpy env list [-h] ...
$ mxpy config-env list --help
usage: mxpy config-env list [-h] ...

List available environments

options:
-h, --help show this help message and exit

```
### Environment.Remove
### ConfigEnv.Remove


```
$ mxpy env remove --help
usage: mxpy env remove [-h] ...
$ mxpy config-env remove --help
usage: mxpy config-env remove [-h] ...

Deletes an environment from the env file. Will switch to default env.

positional arguments:
environment The environment to remove from env file.
Deletes an environment from the env file. Use `mxpy config-env switch` to move to another env.

options:
-h, --help show this help message and exit
-h, --help show this help message and exit
--env ENV the name of the environment to operate on

```
### Environment.Reset
### ConfigEnv.Reset


```
$ mxpy env reset --help
usage: mxpy env reset [-h] ...
$ mxpy config-env reset --help
usage: mxpy config-env reset [-h] ...

Deletes the environment file. Default env will be used.

Expand Down
18 changes: 9 additions & 9 deletions CLI.md.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ generate() {
command "Governance.GetConfig" "governance get-config"
command "Governance.GetDelegatedVoteInfo" "governance get-delegated-vote-info"

group "Environment" "env"
command "Environment.New" "env new"
command "Environment.Set" "env set"
command "Environment.Get" "env get"
command "Environment.Dump" "env dump"
command "Environment.Switch" "env switch"
command "Environment.List" "env list"
command "Environment.Remove" "env remove"
command "Environment.Reset" "env reset"
group "ConfigEnv" "config-env"
command "ConfigEnv.New" "config-env new"
command "ConfigEnv.Set" "config-env set"
command "ConfigEnv.Get" "config-env get"
command "ConfigEnv.Dump" "config-env dump"
command "ConfigEnv.Switch" "config-env switch"
command "ConfigEnv.List" "config-env list"
command "ConfigEnv.Remove" "config-env remove"
command "ConfigEnv.Reset" "config-env reset"

group "ConfigWallet" "config-wallet"
command "ConfigWallet.New" "config-wallet new"
Expand Down
2 changes: 1 addition & 1 deletion multiversx_sdk_cli/base_transactions_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
StringValue,
)

from multiversx_sdk_cli.config_env import get_address_hrp
from multiversx_sdk_cli.constants import (
ADDRESS_PREFIX,
EXTRA_GAS_LIMIT_FOR_GUARDED_TRANSACTIONS,
Expand All @@ -21,7 +22,6 @@
TRUE_STR_LOWER,
)
from multiversx_sdk_cli.cosign_transaction import cosign_transaction
from multiversx_sdk_cli.env import get_address_hrp
from multiversx_sdk_cli.errors import BadUserInput, TransactionSigningError
from multiversx_sdk_cli.guardian_relayer_data import GuardianRelayerData
from multiversx_sdk_cli.interfaces import IAccount
Expand Down
6 changes: 3 additions & 3 deletions multiversx_sdk_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
from rich.logging import RichHandler

import multiversx_sdk_cli.cli_config
import multiversx_sdk_cli.cli_config_env
import multiversx_sdk_cli.cli_config_wallet
import multiversx_sdk_cli.cli_contracts
import multiversx_sdk_cli.cli_data
import multiversx_sdk_cli.cli_delegation
import multiversx_sdk_cli.cli_deps
import multiversx_sdk_cli.cli_dns
import multiversx_sdk_cli.cli_env
import multiversx_sdk_cli.cli_faucet
import multiversx_sdk_cli.cli_get
import multiversx_sdk_cli.cli_governance
Expand All @@ -30,8 +30,8 @@
import multiversx_sdk_cli.version
from multiversx_sdk_cli import config, errors, utils, ux
from multiversx_sdk_cli.cli_shared import set_proxy_from_config_if_not_provided
from multiversx_sdk_cli.config_env import get_address_hrp
from multiversx_sdk_cli.constants import LOG_LEVELS, SDK_PATH
from multiversx_sdk_cli.env import get_address_hrp

logger = logging.getLogger("cli")

Expand Down Expand Up @@ -140,7 +140,7 @@ def setup_parser(args: list[str]):
commands.append(multiversx_sdk_cli.cli_faucet.setup_parser(args, subparsers))
commands.append(multiversx_sdk_cli.cli_multisig.setup_parser(args, subparsers))
commands.append(multiversx_sdk_cli.cli_governance.setup_parser(args, subparsers))
commands.append(multiversx_sdk_cli.cli_env.setup_parser(subparsers))
commands.append(multiversx_sdk_cli.cli_config_env.setup_parser(subparsers))
commands.append(multiversx_sdk_cli.cli_get.setup_parser(subparsers))

parser.epilog = """
Expand Down
Loading
Loading