Configuration
kwil-cli
supports two ways to provide configuration:
- persistent configuration, via a local configuration file
- global flags, which last only for the specified command's lifetime
Global flag configs are given precedence over persistent configs.
Persistent Configuration
To create a reusable, persistent configuration, you can use the configure
command. This will give you the option to set a default value for all global configs.
kwil-cli configure
You can skip over any config by simply pressing enter.
The configuration file will be stored at ~/.kwil-cli/config.json
.
Global Flags
Global flags override the values in the configuration file at runtime, without modifying the configuration file itself. Below is an example of a kwil-cli
command that is configured to connecting to the latest testnet, https://longhorn.kwil.com
, using a config flag:
kwil-cli database list --provider=https://longhorn.kwil.com
Available Configs
Below is a table containing the available configs, their flags, an example value, and a description.
Config | Flag | Example | Description |
---|---|---|---|
Kwil RPC Provider URL | --provider | https://longhorn.kwil.com | The endpoint of a Kwil node, which will be used for accessing data on the node's network. |
Kwil Chain ID | --chain-id | kwil-test-chain | The chain ID of the Kwil network to use. Can be left blank to trust a server-provided value. |
Private Key | --private-key | 0371808159548bae6fe902a88cb432ca d31044324fc8df9c2a0ee72643cf3dda | The secp256k1 private key to use for signing messages and transactions. |
NOTE: There is another specical flag
--output
, which is used to specify the output format. By default it'stext
, but you can also set it tojson
. When set tojson
, command output will be formatted as JSON instead of text.