cardano-cli
TLDR
Query tip (latest block info)
SYNOPSIS
cardano-cli command [subcommand] [options]
DESCRIPTION
cardano-cli is the command-line interface for interacting with the Cardano blockchain. It provides functionality for key generation, address creation, transaction building, and querying the blockchain state.
The tool interfaces with a running cardano-node to query blockchain data and submit transactions. It supports both mainnet and various test networks (preprod, preview). Operations include managing stake keys, delegating to stake pools, and minting native tokens.
Cardano uses an extended UTxO (EUTxO) model where transactions consume and produce unspent transaction outputs. The CLI handles the complexity of building valid transactions with proper fees and balancing.
PARAMETERS
query
Query blockchain state (tip, utxo, protocol-parameters).address
Address commands (key-gen, build).transaction
Transaction commands (build, sign, submit).stake-address
Stake address and delegation commands.stake-pool
Stake pool operations.key
Key utility commands.genesis
Genesis block commands.--mainnet
Use mainnet network magic.--testnet-magic num
Use testnet with specific magic number.--socket-path path
Path to node socket (or CARDANONODESOCKET_PATH env).--out-file file
Output file for results.--signing-key-file file
Private key for signing.--verification-key-file file
Public key file.
CAVEATS
Requires a running and synced cardano-node. Socket path must be accessible. Transactions require correct fee calculation and change output. Keys should be stored securely; loss means loss of funds. Testnet tokens have no real value.
HISTORY
cardano-cli is developed by Input Output Global (IOG) as part of the Cardano blockchain project founded by Charles Hoskinson. Cardano mainnet launched in September 2017 (Byron era). The Shelley era in 2020 introduced staking. The Alonzo upgrade in September 2021 added smart contract support. The tool continues to evolve with each protocol upgrade.
SEE ALSO
cardano-node(1), cardano-wallet(1), cardano-address(1)


