CLI Reference
The Cardano command line interface (CLI) provides a collection of tools for key generation, transaction construction, certificate creation, and other important tasks. It is organized in a hierarchy of subcommands, and each level comes with its own built-in documentation of command syntax and options.
This section provides a reference of the core cardano-cli
commands and their associated sub commands:
cardano-cli
The set of top level cardano-cli
commands include:
address
: Payment address commandsstake-address
: Stake address commandstransaction
: Transaction commandsnode
: Node operation commandsstake-pool
: Stake pool commandsquery
: Node query commands. This queries the local node whose Unix domain socket is obtained from the CARDANO_NODE_SOCKET-PATH environment variable.block
: block commandssystem
: system commandsgenesis
: Genesis block commandsgovernance
: Governance commandstext-view
: Commands for dealing with Shelley TextView files. Transactions and addresses are stored on disk such as TextView files.
cardano-cli address
The address
command contains the following sub commands:
key-gen
: creates a single address key pairkey-hash
: prints the hash of an address to stdoutbuild
: builds a Shelley payment address, with optional delegation to a stake addressbuild-multisig
: builds a Shelley payment multi-sig address.info
: prints details about the address
cardano-cli stake-address
The stake-address
command contains the following sub commands:
key-gen
: creates a single address key pairbuild
: builds a stake addressregister
: registers a stake addressdelegate
: delegates from a stake address to a stake poolde-register
: de-registers a stake addressregistration-certificate
: creates a registration certificatedelegation-certificate
: creates a stake address delegation certificatederegistration-certificate
: creates a de-registration certificate
cardano-cli transaction
The transaction
command contains the following sub commands:
build-raw
: builds a low-level transactionbuild
: builds a transactionsign
: signs the transactionwitness
: witnesses a transactionsign-witness
: signs and witnesses a transactioncheck
: checks the transactionsubmit
: submits the transaction to the local node whose Unix domain socket is obtained from the CARDANO_NODE_SOCKET_PATH environment variable.calculate-min-fee
: calculates the minimum fee for the transactioninfo
: prints information about the transaction
cardano-cli node
The node
command contains the following sub commands:
key-gen
: creates a key pair for a node operator’s offline key and a new certificate issue counterkey-gen-KES
: creates a key pair for a node KES operational keykey-gen-VRF
: creates a key pair for a node VRF operational keyissue-op-cert
: issues a node operational certificate
cardano-cli stake-pool
The stake-pool
command contains the following sub commands:
register
: registers a stake poolre-register
: re-registers a stake poolretire
: retires a stake poolregistration-certificate
: creates a stake pool registration certificatede-registration-certificate
: creates a stake pool de-registration certificateid
: builds pool id from the offline key
cardano-cli query
The query
command contains the following sub commands:
pool-id
: retrieves the node’s pool IDprotocol-parameters
: retrieves the node’s current pool parameterstip
: gets the node’s current tip (slot number, hash, and block number)utxo
: retrieves the node’s current UTxO, filtered by addressversion
: retrieves the node’s version detailsstatus
: retrieves the current status of the nodeledger-state
: dumps the current state of the nodestake-address-info
: get the current delegations and reward accounts filtered by stake address.stake-distribution
: get the node's current aggregated stake distributionpool-params
: Queries the pool parametersquery stake-snapshot
: Queries the stake snap shotquery protocol-state
: Queries the protocol statequery ledger-state
: Queries the ledger state
cardano-cli block
The block
command contains the following sub command:
info
: retrieves the pool ID that produced a particular block.
cardano-cli system
The system
command contains the following sub commands:
start
: starts the systemstop
: stops the system
cardano-cli governance
The governance
command contains the following sub commands:
create-mir-certificate
: creates an MIR (move instantaneous rewards) certificatecreate-update-proposal
: creates an update proposalprotocol-update
: performs a protocol updatecold-keys
: retrieves the cold keys
cardano-cli genesis
The genesis
command contains the following sub commands:
key-gen-genesis
: creates a Shelley genesis key pairkey-gen-delegate
: creates a Shelley genesis delegate key pairkey-gen-utxo
: creates a Shelley genesis UTxO key pairkey-hash
: prints the identifier, or hash, of a public keyget-ver-key
: derives verification key from a signing keyinitial-addr
: gets the address for an initial UTxO based on the verification keyinitial-txin
: gets the transaction ID for an initial UTxO based on the verification key.create
: creates a Shelley genesis file from a genesis template, as well as genesis keys, delegation keys, and spending keys.
cardano-cli text-view
The text-view
command contains the following sub command:
decode-cbor
: prints a text view file, as decoded CBOR.