Skip to main content

Interacting via the CLI

alkanes-cli is the command-line tool for working with the Alkanes metaprotocol: wallets, deployment, contract calls, and chain queries. This page is a task-oriented tour. For the exhaustive command list, see the CLI & SDK Reference.

To install it, follow the Quickstart.

Choosing a network​

Every command takes a network through -p (provider): regtest, signet, or mainnet.

alkanes-cli -p signet <command>

Common global options:

OptionDescription
--wallet-file <PATH>Path to the wallet file
--passphrase <PHRASE>Passphrase used to sign
--wallet-address <ADDR>Watch-only, read-only mode
--jsonrpc-url <URL>Custom JSON-RPC endpoint

For production traffic, pass an API key through --jsonrpc-url for higher rate limits. See Authentication and Rate Limits.

Wallet basics​

# Create a new wallet, or restore one from a mnemonic phrase
alkanes-cli wallet create
alkanes-cli wallet create "<MNEMONIC>"

# List addresses (type:start-end)
alkanes-cli wallet addresses p2tr:0-5

# Balances and unspent outputs
alkanes-cli wallet balance
alkanes-cli wallet utxos

See Wallet Commands for the rest of the namespace: signing, history, backups, and fee rates.

Deploying and calling contracts​

Contract operations live under the alkanes namespace. A contract is addressed by its [block, tx] Alkane ID, and a call is a cellpack, a list that begins with the target ID and an opcode (see Alkanes Metaprotocol).

# Execute a call: contract [2,1], opcode 1
alkanes-cli -p signet alkanes execute "[2,1,1]" --fee-rate 10 -y

# Read state by simulating a call without broadcasting: contract 2:1, opcode 2
alkanes-cli -p signet alkanes simulate "2:1:2"

# Inspect a contract's bytecode and metadata
alkanes-cli -p signet alkanes inspect "2:1" --meta

The -y flag auto-confirms. execute produces a Bitcoin transaction and pays a fee; simulate reads indexer state and costs nothing. See Alkanes Commands for the full flag set on execute, simulate, and inspect.

Querying Bitcoin directly​

The CLI also proxies Bitcoin Core and Esplora, so you can inspect the underlying chain without a second tool:

# Bitcoin Core RPC
alkanes-cli bitcoind getblockcount
alkanes-cli bitcoind getrawtransaction <TXID>

# Esplora
alkanes-cli esplora address <ADDRESS>
alkanes-cli esplora tx <TXID>
alkanes-cli esplora fee-estimates

The esplora namespace has its own reference page (Esplora Commands); the bitcoind commands mirror the methods documented on Bitcoin Core RPC.

Broadcasting options​

By default a transaction goes to the public mempool. For higher-value or MEV-sensitive transactions, the CLI can route through private relays instead:

OptionDescription
(default)Standard mempool broadcast
--use-slipstreamSubmit through MARA Slipstream (bypasses the public mempool)
--use-rebarSubmit through Rebar Shield (private relay)
--mineMine immediately (regtest only)

Getting help​

alkanes-cli --help
alkanes-cli <command> --help

Where to go next​