2 unstable releases

0.2.2 Apr 12, 2024
0.2.1 Apr 12, 2024
0.2.0 Apr 12, 2024
0.1.0 Dec 22, 2023

#2186 in Magic Beans

Download history 5/week @ 2024-02-18 3/week @ 2024-02-25 13/week @ 2024-03-31 236/week @ 2024-04-07 42/week @ 2024-04-14

291 downloads per month

GPL-3.0-only

160KB
3.5K SLoC

CosmWasm Orch Command Line Interface (CLI)

The CosmWasm Orch CLI is a tool designed to facilitate the development, deployment, and interaction with CosmWasm smart contracts on Cosmos blockchains. It enables developers to create, test, and manage contracts using the interactive CLI and easily deploy them onto supported Cosmos networks.

Installation

Prerequisites

  • Rust
  • OpenSSL
  • Access to keyring

Cargo

cargo install cw-orch-cli

Add last command to the shell history (Optional)

If Cw Orch CLI ran in interactive mode it's executed command will not be appended to your shell history. This means you will not be able to arrow up to get the last command and tweak it to your liking.

To solve this you can add the function below to your ~/.bashrc or similar. This function wraps the CLI and appends its executed action to your current shell history, enabling you to retrieve it from the history.

cw-orch-cli() {
  command=$(command cw-orch-cli "$@" | tee /dev/tty | grep 'Your console command' | cut -f2- -d':')
  if [ "$command" != "cw-orch-cli" ]
  then
    history -s cw-orch-cli "$@" # if you still want to be able `arrow up` to the original command
  fi
  history -s $command
}

Usage

The CLI supports two modes of execution: interactive and non-interactive.

Interactive mode

In interactive mode the CLI will guide you through complex tasks by reducing the initial command's complexity, and ensuring a more intuitive user experience.

The interactive mode will prompt you for new information when needed as you go through the process of creating, testing, and deploying a contract.

Example:

cw-orch-cli --verbose

Non-interactive mode

You can utilize the non-interactive mode for scripting, automated operations, and tweaking of the interactive mode's commands. Often you'll find yourself using the interactive mode to get the command you need, and then debug it with the non-interactive mode.

Example:

cw-orch-cli action uni-6 cw query raw juno1czkm9gq96zwwncxusgzruvpuex4wjf4ak7lms6q698938k529q3shmfl90 raw contract_info

Global optional arguments

  • -v or --verbose - enable verbose mode, this will log actions from cw-orch daemon executions that corresponds to your RUST_LOG level
  • -s or --source-state-file - source cw-orch state file(STATE_FILE cw-orch env variable) to use together with address-book entries (address book have higher priority)
  • --deployment-id <DEPLOYMENT_ID> - cw-orch state deployment-id, defaults to "default"

Dependencies

~30–52MB
~887K SLoC