Skip to main content

CLI Tool

The Oasis CLI (oasis / oxn) provides shell access to OXN operations: accounts, transactions, contract calls, and network diagnostics. It complements the SDKs — good for scripting, CI, and one-off operations, but not for encrypted contract interaction.

Installation

Download the latest binary from the Oasis CLI releases, or build from source:

git clone https://github.com/oasisprotocol/cli
cd cli
make
sudo install oxn /usr/local/bin/

Basic commands

Networks and accounts

oxn network list # list configured networks
oxn network add-local oxn https://rpc.bout.network # add OXN endpoint
oxn account list # list stored accounts
oxn account show test:alice # show details for a test account

Balances and transfers

oxn account show 0xYourAddress # EVM address balance
oxn account transfer 0xRecipient 1.5 --account test:alice # transfer 1.5 TBLUAI

Contract deployment (plain — no encrypted args)

oxn contract deploy MyContract.bin \
--account test:alice \
--gas-limit 3000000

Contract calls (plain — no encryption)

# Read: returns default value if the target uses msg.sender-scoped state
oxn contract call 0xTokenAddress "totalSupply()" --network oxn

# Write: goes through as plain calldata — DO NOT use for confidential functions
oxn contract call 0xTokenAddress "transfer(address,uint256)" \
0xRecipient 100 \
--account test:alice \
--gas-limit 500000

Limitations

The CLI:

  • Sends transactions in plain. It does not construct the encrypted CBOR envelope. Use this only for functions that intentionally accept plain calldata.
  • Cannot issue signed queries. Read-only calls that gate on msg.sender will return default values.
  • Is best for deployment and operations, not for confidential dApp interaction.

For encrypted interaction, use the TypeScript SDK or another language SDK.

Configuration file

CLI configuration lives at ~/.config/oasis/cli.toml. Recommended structure:

~/.config/oasis/cli.toml
[networks.default]
description = "OXN Testnet"
chain_context = "..."
rpc = "https://rpc.bout.network"

[accounts.test-alice]
description = "test account funded by faucet"
kind = "file"
config = { path = "/absolute/path/to/alice.pem" }

Do not commit this file — it references your private keys.

Scripting

Use the CLI in shell scripts and CI:

#!/bin/bash
set -euo pipefail

CONTRACT=$(oxn contract deploy MyContract.bin --account $DEPLOYER --gas-limit 3000000 \
| grep -oP '(?<=Deployed: )0x[0-9a-fA-F]+')
echo "Deployed at: $CONTRACT"

oxn contract call "$CONTRACT" "initialize()" --account $DEPLOYER --gas-limit 500000

For any step that requires encryption, shell out to a Node.js script using the TypeScript SDK.

Next steps