Skip to main content

Quickstart

This guide outlines the basic usage of the Kwil CLI for configuring a private key, provider, chain ID, and deploying a database. It will also demonstrate how to execute an action and call a view action.

Prerequisites

Make sure that you have downloaded and installed kwil-cli onto your system. Refer to the installation guide for detailed instructions.

Configuration

Persistent Configuration

Configure the Kwil CLI with a persistent global setting using the command below, which will prompt you for the necessary configurations:

kwil-cli configure

Your configuration file will be stored at ~/.kwil-cli/config.json.

Global Flags

For temporary use, you can override persistent configurations by using global flags like so:

kwil-cli --provider=http://your.kwil.provider:port --private-key=your_private_key --chain-id=your_chain_id

Global flags take precedence over persistent configs.

Deploying a Database

To deploy a database, you need to have a file containing the database schema in Kuneiform or JSON format:

kwil-cli database deploy ./path_to_schema_file.kf

Executing a Procedure/Action

Execute an action or procedure against a database by providing the action/procedure name and parameters.

kwil-cli database execute procedure_name parameter_1:value_1 parameter_2:value_2 --dbid target_dbid

Calling a View Procedure/Action

Call a view (read-only) procedure on a database using the following command:

kwil-cli database call view_procedure_name parameter_1:value_1 --dbid target_dbid

Note

Remember to replace placeholders such as your.kwil.provider:port, your_private_key, your_chain_id, path_to_schema_file, target_dbid, procedure_name, parameter:value, and view_procedure_name with actual values based on your database and setup.

For a more detailed usage of each command, refer to the appropriate section of the Kwil CLI reference guide.