CLI Configuration
Setup CLI Initial Configuration
If you are using the CLI to try things out on-chain, you will need to configure the network and credentials you want the CLI to use.
This makes using the CLI easier and more secure as you will not be forced to repeatedly copy addresses or private keys.
:::caution If you still need to install the CLI, follow these steps. :::
Run
endless init
and follow the instructions in the command line.To use default settings, you can provide no input and just press "Enter". For example:
endless init Configuring for profile default Choose network from [devnet, testnet, mainnet, local, custom | defaults to devnet] No network given, using devnet... Enter your private key as a hex literal (0x...) [Current: None | No input: Generate new key (or keep one if present)] No key given, generating key... Account 0xa2146cf381c6eb4bc82c6c4b78ee02ab63ab8f6825456e143ceb5e929a4c7c2d doesn't exist, creating it and funding it with 100000000 Veins Account 0xa2146cf381c6eb4bc82c6c4b78ee02ab63ab8f6825456e143ceb5e929a4c7c2d funded successfully --- Endless CLI is now set up for account 0xa2146cf381c6eb4bc82c6c4b78ee02ab63ab8f6825456e143ceb5e929a4c7c2d as profile default! Run `endless --help` for more information about commands Success
Later, if you want to update these settings, you can do so by running
endless init
again.The rest of these configuration steps are optional / quality of life. To continue to use the CLI for your specific use case, follow the usage guide here.
(Optional) Creating Named Configurations (Profiles)
For testing more complicated scenarios, you will often want multiple accounts on-chain. One way to do this is to create a named configuration which we call a profile.
To create a profile, run endless init --profile <name_of_profile>
. The configuration you generate will be usable when calling CLI commands as replacements for arguments.
For example:
endless init --profile bob
...
...
Endless CLI is now set up for account 0x51024fd5e73c45de085b4c4f1d676273cd40578505364657df1ce14efbeba138 as profile bob!
(Optional) Setting Up Shell Completion
One quality of life feature you can enable is shell auto-completions.
Determine which shell you are using (you can run
echo $SHELL
if you are unsure).Look up where configuration files for shell completions go for that shell (it varies from shell to shell). The supported shells are
[bash, zsh, fish, PowerShell, elvish]
.Run the following command with your specific shell and the output file for completions using your shell:
endless config generate-shell-completions --shell <YOUR_SHELL_HERE> --output-file <OUTPUT_DESTINATION_FOR_YOUR_SHELL>
Example command for oh my zsh
:
endless config generate-shell-completions --shell zsh --output-file ~/.oh-my-zsh/completions/_endless
(Optional) Global Config
By default, the CLI will look for a configuration in .endless/config.yaml
in each workspace directory. If you would like to use a shared configuration for all workspaces, you can follow these steps:
Create a folder in your home directory called
.endless
(so it has the path~/.endless
).Create a yaml file inside
.endless
calledglobal_config.yaml
.Run the command:
endless config set-global-config --config-type global
You should see:
config_type:Global
default_prompt_response:Prompt
Last updated