Command Line Interface

This document is a prettier output of the documentation produced by the command line client’s man command. You can obtain similar pages using the following shell commands.

tezos-client -protocol ProtoALphaALph man -verbosity 3
tezos-admin-client man -verbosity 3

Command line client

Usage

  • tezos-client [global options] command [command options]
  • tezos-client --help (for global options)
  • tezos-client [global options] command --help (for command options)

To browse the documentation

  • tezos-client [global options] man (for a list of commands)
  • tezos-client [global options] man -v 3 (for the full manual)

Global options (must come before the command)

-d --base-dir <path>: client data directory The directory where the Tezos client will store all its data. By default: '/home/opam/.tezos-client'. -c --config-file <path>: configuration file -t --timings: show RPC request times -b --block <hash|tag>: block on which to apply contextual commands Defaults to `head`. -p --protocol <hash>: use commands of a specific protocol -l --log-requests: log all requests to the node -A --addr <IP addr|host>: IP address of the node -P --port <number>: RPC port of the node -S --tls: use TLS to connect to node.

Access the documentation

  • man [keyword...] [-v --verbosity <0|1|2|3>] [--format <plain|colors|html>]
    Print documentation of commands. Add search keywords to narrow list. Will display only the commands by default, unless [-verbosity <2|3>] is passed or the list of matching commands if less than 3. keyword: keyword to search for If several are given they must all appear in the command. -v --verbosity <0|1|2|3>: level of details 0. Only shows command mnemonics, without documentation. 1. Shows command mnemonics with short descriptions. 2. Show commands and arguments with short descriptions 3. Show everything --format <plain|colors|html>: the manual's output format Defaults to `plain`.

Alphanet only commands

  • activate protocol version with key password
    Activate a protocol (Alphanet dictator only). version: protocol version (b58check) password: dictator's key
  • fork test protocol version with key password
    Fork a test protocol (Alphanet dictator only). version: protocol version (b58check) password: dictator's key

Block contextual commands (see option -block)

  • get timestamp
    Access the timestamp of the block.
  • list contracts
    Lists all non empty contracts of the block.
  • get balance for src
    Get the balance of a contract. src: source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force.
  • get storage for src
    Get the storage of a contract. src: source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force.
  • get manager for src
    Get the manager of a contract. src: source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force.
  • get delegate for src
    Get the delegate of a contract. src: source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force.
  • set delegate for src to mgr [--fee <amount>]
    Set the delegate of a contract. src: source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force. mgr: new delegate of the contract --fee <amount>: fee in ꜩ to pay to the baker Defaults to `0.05`.
  • originate account new for mgr transferring qty from src [--fee <amount>] [--delegate <identity>] [--delegatable] [-f --force]
    Open a new account. new: name of the new contract mgr: manager of the new contract Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. qty: amount taken from source in ꜩ Text format: `D,DDD,DDD.DDD,DDD`. Tez and mutez and separated by a period sign. Trailing and pending zeroes are allowed. Commas are optional, but if present they must be placed every 3 digits. src: name of the source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force. --fee <amount>: fee in ꜩ to pay to the baker Defaults to `0.05`. --delegate <identity>: delegate of the contract Must be a known identity. Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. --delegatable: allow future delegate change -f --force: overwrite existing keys
  • originate contract new for mgr transferring qty from src running prg [--fee <amount>] [--delegate <identity>] [-f --force] [--delegatable] [--spendable] [--init <data>] [-q --no-print-source]
    Launch a smart contract on the blockchain. new: name of the new contract mgr: manager of the new contract Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. qty: amount taken from source in ꜩ Text format: `D,DDD,DDD.DDD,DDD`. Tez and mutez and separated by a period sign. Trailing and pending zeroes are allowed. Commas are optional, but if present they must be placed every 3 digits. src: name of the source contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force. prg: script of the account Combine with -init if the storage type is not unit. Can be a program name, a file or a raw program literal. If the parameter is not the name of an existing program, the client will look for a file containing a program, and if it does not exist, the argument will be read as a raw program. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. --fee <amount>: fee in ꜩ to pay to the baker Defaults to `0.05`. --delegate <identity>: delegate of the contract Must be a known identity. Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. -f --force: overwrite existing keys --delegatable: allow future delegate change --spendable: allow the manager to spend the contract's tokens --init <data>: initial value of the contract's storage Defaults to `Unit`. -q --no-print-source: don't print the source code If an error is encountered, the client will print the contract's source code by default. This option disables this behaviour.
  • transfer qty from src to dst [--fee <amount>] [--arg <data>] [-q --no-print-source]
    Transfer tokens / call a smart contract. qty: amount taken from source in ꜩ Text format: `D,DDD,DDD.DDD,DDD`. Tez and mutez and separated by a period sign. Trailing and pending zeroes are allowed. Commas are optional, but if present they must be placed every 3 digits. src: name of the source contract Can be a contract alias or a key alias (autodetected in order). Use 'key:name' to force the later. dst: name/literal of the destination contract Can be an alias, a key, or a literal (autodetected in order). Use 'text:literal', 'alias:name', 'key:name' to force. --fee <amount>: fee in ꜩ to pay to the baker Defaults to `0.05`. --arg <data>: argument passed to the contract's script, if needed Defaults to `Unit`. -q --no-print-source: don't print the source code If an error is encountered, the client will print the contract's source code by default. This option disables this behaviour.
  • reveal key for src [--fee <amount>]
    Reveal the public key of the contract manager. src: name of the source contract Can be a contract alias or a key alias (autodetected in order). Use 'key:name' to force the later. --fee <amount>: fee in ꜩ to pay to the baker Defaults to `0.05`.
  • register key mgr as delegate [--fee <amount>]
    Register the public key hash as a delegate. mgr: the delegate key Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. --fee <amount>: fee in ꜩ to pay to the baker Defaults to `0.05`.
  • activate account new with activation_key [-f --force] [--no-confirmation]
    Register and activate a predefined account using the provided activation key. new: new secret key alias activation_key: Activation key (as JSON file) obtained from the Tezos foundation (or the Alphanet faucet). -f --force: overwrite existing secret key --no-confirmation: don't print wait for the operation to be confirmed.

Commands for managing the record of known contracts

  • remember contract new src [-f --force]
    Add a contract to the wallet. new: new contract alias src: source contract Can be a contract name, a file or a raw contract literal. If the parameter is not the name of an existing contract, the client will look for a file containing a contract, and if it does not exist, the argument will be read as a raw contract. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. -f --force: overwrite existing contract
  • forget contract name
    Remove a contract from the wallet. name: existing contract alias
  • list known contracts
    Lists all known contracts in the wallet.
  • forget all contracts [-f --force]
    Forget the entire wallet of known contracts. -f --force: overwrite existing contract
  • show known contract name
    Display a contract from the wallet. name: existing contract alias
  • tag contract name with tag
    Tag a contract in the wallet. name: existing contract alias tag: list of tags can be one or multiple tags separated by commas
  • untag contract name with tag
    Remove tag(s) from a contract in the wallet. name: existing contract alias tag: list of tags can be one or multiple tags separated by commas

Commands for managing the library of known programs

  • list known programs
    Lists all programs in the library.
  • remember program new src [-f --force]
    Add a program to the library. new: new program alias src: source program Can be a program name, a file or a raw program literal. If the parameter is not the name of an existing program, the client will look for a file containing a program, and if it does not exist, the argument will be read as a raw program. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. -f --force: overwrite existing program
  • forget program name
    Remove a program from the library. name: existing program alias
  • show known program name
    Display a program from the library. name: existing program alias
  • run program src on storage storage and input storage [--trace-stack] [--amount <amount>] [-q --no-print-source]
    Ask the node to run a program. src: source program Can be a program name, a file or a raw program literal. If the parameter is not the name of an existing program, the client will look for a file containing a program, and if it does not exist, the argument will be read as a raw program. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. storage: the storage data storage: the input data --trace-stack: show the stack after each step --amount <amount>: amount of the transfer in ꜩ Defaults to `0.05`. -q --no-print-source: don't print the source code If an error is encountered, the client will print the contract's source code by default. This option disables this behaviour.
  • typecheck program src [-v --details] [--emacs] [-q --no-print-source]
    Ask the node to typecheck a program. src: source program Can be a program name, a file or a raw program literal. If the parameter is not the name of an existing program, the client will look for a file containing a program, and if it does not exist, the argument will be read as a raw program. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. -v --details: show the types of each instruction --emacs: output in `michelson-mode.el` compatible format -q --no-print-source: don't print the source code If an error is encountered, the client will print the contract's source code by default. This option disables this behaviour.
  • typecheck data data against type type [-q --no-print-source]
    Ask the node to typecheck a data expression. data: the data to typecheck type: the expected type -q --no-print-source: don't print the source code If an error is encountered, the client will print the contract's source code by default. This option disables this behaviour.
  • hash data data of type type
    Ask the node to hash a data expression. The returned hash is the same as what Michelson instruction `H` would have produced. data: the data to hash type: type of the data
  • hash and sign data data of type type for src
    Ask the node to hash a data expression. Uses the same algorithm as Michelson instruction `H` to produce the hash, signs it using a given secret key, and displays it using the format expected by Michelson instruction `CHECK_SIGNATURE`. data: the data to hash type: type of the data src: source secret key Can be a secret key name, a file or a raw secret key literal. If the parameter is not the name of an existing secret key, the client will look for a file containing a secret key, and if it does not exist, the argument will be read as a raw secret key. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect.

Commands related to delegate operations.

  • launch daemon [src...] [--max-priority <slot>] [--endorsement-delay <seconds>] [-B --baking] [-E --endorsement] [-D --denunciation]
    Launch a daemon that handles delegate operations. src: source public key hash Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. --max-priority <slot>: maximum allowed baking slot --endorsement-delay <seconds>: delay before endorsing blocks Delay between notifications of new blocks from the node and production of endorsements for these blocks. Defaults to `15`. -B --baking: run the baking daemon -E --endorsement: run the endorsement daemon -D --denunciation: run the denunciation daemon
  • endorse for baker [--max-priority <slot>]
    Forge and inject an endorsement operation. baker: name of the delegate owning the endorsement right Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. --max-priority <slot>: maximum allowed baking slot
  • bake for baker [--max-priority <slot>] [-f --force] [--free-baking] [--minimal-timestamp]
    Forge and inject block using the delegate rights. baker: name of the delegate owning the baking right Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. --max-priority <slot>: maximum allowed baking slot -f --force: disables the node's injection checks Force the injection of branch-invalid operation or force the injection of block without a fitness greater than the current head. --free-baking: only consider free baking slots --minimal-timestamp: Use the minimal timestamp instead of the current date as timestamp of the baked block.
  • reveal nonce for [Block_hash...]
    Forge and inject a seed-nonce revelation operation. Block_hash: A Tezos block ID
  • reveal nonces
    Forge and inject all the possible seed-nonce revelation operations.

Commands for managing the wallet of cryptographic keys

  • list signing schemes
    List supported signing schemes. Signing schemes are identifiers for signer modules: the built-in signing routines, a hardware wallet, an external agent, etc. Each signer has its own format for describing secret keys, such a raw secret key for the default `unencrypted` scheme, the path on a hardware security module, an alias for an external agent, etc. This command gives the list of signer modules that this version of the tezos client supports.
  • gen keys new [-f --force] [-s --sig <ed25519|secp256k1>]
    Generate a pair of (unencrypted) keys. new: new secret key alias -f --force: overwrite existing secret key -s --sig <ed25519|secp256k1>: use custom signature algorithm Defaults to `ed25519`.
  • gen vanity keys new matching [words...] [-P --prefix] [-f --force]
    Generate (unencrypted) keys including the given string. new: new public key hash alias words: string key must contain one of these words -P --prefix: the key must begin with tz1[word] -f --force: overwrite existing keys
  • import scheme secret key new [spec...] [-f --force]
    Add a secret key to the wallet. scheme: signer to use for this secret key Use command `list signing schemes` for a list of supported signers. new: new secret key alias spec: secret key specification Varies from one scheme to the other. Use command `list signing schemes` for more information. -f --force: overwrite existing secret key
  • import scheme public key new [spec...] [-f --force]
    Add a public key to the wallet. scheme: signer to use for this public key Use command `list signing schemes` for a list of supported signers. new: new public key alias spec: public key specification Varies from one scheme to the other. Use command `list signing schemes` for more information. -f --force: overwrite existing public key
  • add identity new src [-f --force]
    Add an identity to the wallet. new: new public key hash alias src: source public key hash Can be a public key hash name, a file or a raw public key hash literal. If the parameter is not the name of an existing public key hash, the client will look for a file containing a public key hash, and if it does not exist, the argument will be read as a raw public key hash. Use 'alias:name', 'file:path' or 'text:literal' to disable autodetect. -f --force: overwrite existing public key
  • list known identities
    List all identities and associated keys.
  • show identity name [-S --show-secret]
    Show the keys associated with an identity. name: existing public key hash alias -S --show-secret: show the private key
  • forget all keys [-f --force]
    Forget the entire wallet of keys. -f --force: you got to use the force for that

Commands for the low level RPC layer

  • rpc list url
    List RPCs under a given URL prefix. Some parts of the RPC service hierarchy depend on parameters, they are marked by a suffix `<dynamic>`. You can list these sub-hierarchies by providing a concrete URL prefix whose arguments are set to a valid value. url: the URL prefix
  • rpc list
    Alias to `rpc list /`.
  • rpc schema url
    Get the input and output JSON schemas of an RPC. url: the RPC url
  • rpc format url
    Get the humanoid readable input and output formats of an RPC. url: the RPC URL
  • rpc call url
    Call an RPC. If input data is needed, a text editor will be popped up. url: the RPC URL
  • rpc call url with input
    Call an RPC providing input data via the command line. url: the RPC URL input: the raw JSON input to the RPC For instance, use `{}` to send the empty document. Alternatively, use `file:path` to read the JSON data from a file.

Commands for editing and viewing the client's config file

  • config show
    Show the config file.
  • config reset
    Reset the config file to the factory defaults.
  • config update
    Update the config based on the current cli values. Loads the current configuration (default or as specified with `-config-file`), applies alterations from other command line arguments (such as the node's address, etc.), and overwrites the updated configuration file.
  • config init [-o --output <path>]
    Create a config file based on the current CLI values. If the `-file` option is not passed, this will initialize the default config file, based on default parameters, altered by other command line options (such as the node's address, etc.). Otherwise, it will create a new config file, based on the default parameters (or the the ones specified with `-config-file`), altered by other command line options. The command will always fail if the file already exists. -o --output <path>: path at which to create the file Defaults to `/home/opam/.tezos-client/config`.

Miscellaneous commands

  • list understood protocols
    List the protocol versions that this client understands.
  • complete prefix [-u --unique]
    Autocomplete a prefix of Base58Check-encoded hash. This actually works only for blocks, operations, public key and contract identifiers. prefix: the prefix of the hash to complete -u --unique: Fail when there is more than one possible completion.
  • bootstrapped
    Wait for the node to be bootstrapped.
  • wait for operation to be included [---confirmations <num_blocks>] [---check-previous <num_blocks>]
    Wait until an operation is included in a block operation: Operation to be included ---confirmations <num_blocks>: do not end until after 'N' additional blocks after the operation appears Defaults to `0`. ---check-previous <num_blocks>: number of previous blocks to check Defaults to `10`.

Administration command line client

Usage

  • tezos-admin-client [global options] command [command options]
  • tezos-admin-client --help (for global options)
  • tezos-admin-client [global options] command --help (for command options)

To browse the documentation

  • tezos-admin-client [global options] man (for a list of commands)
  • tezos-admin-client [global options] man -v 3 (for the full manual)

Global options (must come before the command)

-d --base-dir <path>: client data directory The directory where the Tezos client will store all its data. By default: '/home/opam/.tezos-client'. -c --config-file <path>: configuration file -t --timings: show RPC request times -b --block <hash|tag>: block on which to apply contextual commands Defaults to `head`. -p --protocol <hash>: use commands of a specific protocol -l --log-requests: log all requests to the node -A --addr <IP addr|host>: IP address of the node -P --port <number>: RPC port of the node -S --tls: use TLS to connect to node.

Access the documentation

  • man [keyword...] [-v --verbosity <0|1|2|3>] [--format <plain|colors|html>]
    Print documentation of commands. Add search keywords to narrow list. Will display only the commands by default, unless [-verbosity <2|3>] is passed or the list of matching commands if less than 3. keyword: keyword to search for If several are given they must all appear in the command. -v --verbosity <0|1|2|3>: level of details 0. Only shows command mnemonics, without documentation. 1. Shows command mnemonics with short descriptions. 2. Show commands and arguments with short descriptions 3. Show everything --format <plain|colors|html>: the manual's output format Defaults to `plain`.

Commands for the low level RPC layer

  • rpc list url
    List RPCs under a given URL prefix. Some parts of the RPC service hierarchy depend on parameters, they are marked by a suffix `<dynamic>`. You can list these sub-hierarchies by providing a concrete URL prefix whose arguments are set to a valid value. url: the URL prefix
  • rpc list
    Alias to `rpc list /`.
  • rpc schema url
    Get the input and output JSON schemas of an RPC. url: the RPC url
  • rpc format url
    Get the humanoid readable input and output formats of an RPC. url: the RPC URL
  • rpc call url
    Call an RPC. If input data is needed, a text editor will be popped up. url: the RPC URL
  • rpc call url with input
    Call an RPC providing input data via the command line. url: the RPC URL input: the raw JSON input to the RPC For instance, use `{}` to send the empty document. Alternatively, use `file:path` to read the JSON data from a file.

Commands for managing protocols

  • list protocols
    List protocols known by the node.
  • inject protocol dir
    Inject a new protocol into the node. dir: directory containing a protocol
  • dump protocol protocol hash
    Dump a protocol from the node's record of protocol. protocol hash:

Commands for monitoring and controlling p2p-layer state

  • p2p stat
    show global network status
  • connect address address [--port <IP port>]
    Connect to a new point. address: IPv4 or IPV6 address --port <IP port>: peer-to-peer port of the node Defaults to `9732`.
  • forget address address
    Remove an IP address from the blacklist and whitelist. address: IPv4 or IPV6 address
  • ban address address
    Add an IP address to the blacklist. address: IPv4 or IPV6 address
  • trust address address
    Add an IP address to the whitelist. address: IPv4 or IPV6 address
  • is address banned address
    Check if an IP address is banned. address: IPv4 or IPV6 address
  • forget peer peer
    Remove a peer ID from the blacklist and whitelist. peer: peer network identity
  • ban peer peer
    Add a peer ID to the blacklist. peer: peer network identity
  • trust peer peer
    Add a peer ID to the whitelist. peer: peer network identity
  • is peer banned peer
    Check if a peer ID is banned. peer: peer network identity
  • clear acls
    Clear all ACLs.

Commands to perform privileged operations on the node

  • unmark invalid [block...]
    Make the node forget its decision of rejecting a block. block: block to remove from invalid list

Commands to report the node's status

  • list heads [-o --output <path>]
    The last heads that have been considered by the node. -o --output <path>: write to a file Defaults to `-`.
  • list rejected blocks [-o --output <path>]
    The blocks that have been marked invalid by the node. -o --output <path>: write to a file Defaults to `-`.
  • full report [-o --output <path>]
    A full report of the node's state. -o --output <path>: write to a file Defaults to `-`.

Commands for editing and viewing the client's config file

  • config show
    Show the config file.
  • config reset
    Reset the config file to the factory defaults.
  • config update
    Update the config based on the current cli values. Loads the current configuration (default or as specified with `-config-file`), applies alterations from other command line arguments (such as the node's address, etc.), and overwrites the updated configuration file.
  • config init [-o --output <path>]
    Create a config file based on the current CLI values. If the `-file` option is not passed, this will initialize the default config file, based on default parameters, altered by other command line options (such as the node's address, etc.). Otherwise, it will create a new config file, based on the default parameters (or the the ones specified with `-config-file`), altered by other command line options. The command will always fail if the file already exists. -o --output <path>: path at which to create the file Defaults to `/home/opam/.tezos-client/config`.

Miscellaneous commands

  • list understood protocols
    List the protocol versions that this client understands.