This document contains the help content for the icp-cli command-line program.
Command Overview:
icp-cli↴icp-cli build↴icp-cli canister↴icp-cli canister call↴icp-cli canister create↴icp-cli canister delete↴icp-cli canister info↴icp-cli canister install↴icp-cli canister list↴icp-cli canister settings↴icp-cli canister settings show↴icp-cli canister settings update↴icp-cli canister show↴icp-cli canister start↴icp-cli canister status↴icp-cli canister stop↴icp-cli canister top-up↴icp-cli cycles↴icp-cli cycles balance↴icp-cli cycles mint↴icp-cli deploy↴icp-cli environment↴icp-cli environment list↴icp-cli identity↴icp-cli identity default↴icp-cli identity import↴icp-cli identity list↴icp-cli identity new↴icp-cli identity principal↴icp-cli network↴icp-cli network list↴icp-cli network ping↴icp-cli network run↴icp-cli network stop↴icp-cli sync↴icp-cli token↴icp-cli token balance↴icp-cli token transfer↴
Usage: icp-cli [OPTIONS] [COMMAND]
build— Build a projectcanister— Perform canister operations against a networkcycles— Mint and manage cyclesdeploy— Deploy a project to an environmentenvironment— Show information about the current project environmentsidentity— Manage your identitiesnetwork— Launch and manage local test networkssync— Synchronize canisters in the current environmenttoken— Perform token transactions
-
--project-dir <PROJECT_DIR>— Directory to use as your project base directory. If not specified the directory structure is traversed up until an icp.yaml file is found -
--id-store <ID_STORE>Default value:
.icp/ids.json -
--artifact-store <ARTIFACT_STORE>Default value:
.icp/artifacts -
--debug— Enable debug loggingDefault value:
false
Build a project
Usage: icp-cli build [NAMES]...
<NAMES>— The names of the canisters within the current project
Perform canister operations against a network
Usage: icp-cli canister <COMMAND>
call— Make a canister callcreate— Create a canister on a networkdelete— Delete a canister from a networkinfo— Display a canister's informationinstall— Install a built WASM to a canister on a networklist— List the canisters in an environmentsettings—show— Show a canister's detailsstart— Start a canister on a networkstatus— Show the status of a canisterstop— Stop a canister on a networktop-up— Top up a canister with cycles
Make a canister call
Usage: icp-cli canister call [OPTIONS] <CANISTER> <METHOD> <ARGS>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified<METHOD>— Name of canister method to call into<ARGS>— String representation of canister call arguments
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Create a canister on a network
Usage: icp-cli canister create [OPTIONS] [NAMES]...
<NAMES>— The names of the canister within the current project
-
--identity <IDENTITY>— The user identity to run this command as -
--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used -
--ic— Shorthand for --environment=ic -
--controller <CONTROLLER>— One or more controllers for the canister. Repeat--controllerto specify multiple -
--compute-allocation <COMPUTE_ALLOCATION>— Optional compute allocation (0 to 100). Represents guaranteed compute capacity -
--memory-allocation <MEMORY_ALLOCATION>— Optional memory allocation in bytes. If unset, memory is allocated dynamically -
--freezing-threshold <FREEZING_THRESHOLD>— Optional freezing threshold in seconds. Controls how long a canister can be inactive before being frozen -
--reserved-cycles-limit <RESERVED_CYCLES_LIMIT>— Optional reserved cycles limit. If set, the canister cannot consume more than this many cycles -
-q,--quiet— Suppress human-readable output; print only canister IDs, one per line, to stdout -
--cycles <CYCLES>— Cycles to fund canister creation (in raw cycles)Default value:
2000000000000 -
--subnet <SUBNET>— The subnet to create canisters on
Delete a canister from a network
Usage: icp-cli canister delete [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Display a canister's information
Usage: icp-cli canister info [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Install a built WASM to a canister on a network
Usage: icp-cli canister install [OPTIONS] [NAMES]...
<NAMES>— The names of the canisters within the current project
-
-m,--mode <MODE>— Specifies the mode of canister installationDefault value:
autoPossible values:
auto,install,reinstall,upgrade -
--identity <IDENTITY>— The user identity to run this command as -
--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used -
--ic— Shorthand for --environment=ic
List the canisters in an environment
Usage: icp-cli canister list [OPTIONS]
--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic
Usage: icp-cli canister settings <COMMAND>
show—update—
Usage: icp-cli canister settings show [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Usage: icp-cli canister settings update [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as--add-controller <ADD_CONTROLLER>--remove-controller <REMOVE_CONTROLLER>--set-controller <SET_CONTROLLER>--compute-allocation <COMPUTE_ALLOCATION>--memory-allocation <MEMORY_ALLOCATION>--freezing-threshold <FREEZING_THRESHOLD>--reserved-cycles-limit <RESERVED_CYCLES_LIMIT>--wasm-memory-limit <WASM_MEMORY_LIMIT>--wasm-memory-threshold <WASM_MEMORY_THRESHOLD>--log-visibility <LOG_VISIBILITY>--add-log-viewer <ADD_LOG_VIEWER>--remove-log-viewer <REMOVE_LOG_VIEWER>--set-log-viewer <SET_LOG_VIEWER>--add-environment-variable <ADD_ENVIRONMENT_VARIABLE>--remove-environment-variable <REMOVE_ENVIRONMENT_VARIABLE>
Show a canister's details
Usage: icp-cli canister show [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic
Start a canister on a network
Usage: icp-cli canister start [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Show the status of a canister
Usage: icp-cli canister status [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Stop a canister on a network
Usage: icp-cli canister stop [OPTIONS] <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Top up a canister with cycles
Usage: icp-cli canister top-up [OPTIONS] --amount <AMOUNT> <CANISTER>
<CANISTER>— Name or principal of canister to target When using a name an environment must be specified
--amount <AMOUNT>— Amount of cycles to top up--network <NETWORK>— Name of the network to target, conflicts with environment argument--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Mint and manage cycles
Usage: icp-cli cycles <COMMAND>
balance—mint—
Usage: icp-cli cycles balance [OPTIONS]
--identity <IDENTITY>— The user identity to run this command as--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic
Usage: icp-cli cycles mint [OPTIONS]
--icp <ICP>— Amount of ICP to mint to cycles--cycles <CYCLES>— Amount of cycles to mint. Automatically determines the amount of ICP needed--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic--identity <IDENTITY>— The user identity to run this command as
Deploy a project to an environment
Usage: icp-cli deploy [OPTIONS] [NAMES]...
<NAMES>— Canister names
-
-m,--mode <MODE>— Specifies the mode of canister installationDefault value:
autoPossible values:
auto,install,reinstall,upgrade -
--subnet <SUBNET>— The subnet to use for the canisters being deployed -
--controller <CONTROLLER>— One or more controllers for the canisters being deployed. Repeat--controllerto specify multiple -
--cycles <CYCLES>— Cycles to fund canister creation (in cycles)Default value:
2000000000000 -
--identity <IDENTITY>— The user identity to run this command as -
--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used -
--ic— Shorthand for --environment=ic
Show information about the current project environments
Usage: icp-cli environment <COMMAND>
list—
Usage: icp-cli environment list
Manage your identities
Usage: icp-cli identity <COMMAND>
default—import—list—new—principal—
Usage: icp-cli identity default [NAME]
<NAME>
Usage: icp-cli identity import [OPTIONS] <--from-pem <FILE>|--read-seed-phrase|--from-seed-file <FILE>> <NAME>
<NAME>
--from-pem <FILE>--read-seed-phrase--from-seed-file <FILE>--decryption-password-from-file <FILE>--assert-key-type <ASSERT_KEY_TYPE>
Usage: icp-cli identity list
Usage: icp-cli identity new [OPTIONS] <NAME>
<NAME>
--output-seed <FILE>
Usage: icp-cli identity principal [OPTIONS]
--identity <IDENTITY>— The user identity to run this command as
Launch and manage local test networks
Usage: icp-cli network <COMMAND>
list— List networks in the projectping— Try to connect to a network, and print out its statusrun— Run a given networkstop— Stop a background network
List networks in the project
Usage: icp-cli network list
Try to connect to a network, and print out its status
Usage: icp-cli network ping [OPTIONS] [NETWORK]
-
<NETWORK>— The compute network to connect to. By default, ping the local networkDefault value:
local
--wait-healthy— Repeatedly ping until the replica is healthy or 1 minute has passed
Run a given network
Usage: icp-cli network run [OPTIONS] [NAME]
-
<NAME>— Name of the network to runDefault value:
local
--background— Starts the network in a background process. This command will exit once the network is running. To stop the network, use 'icp network stop'
Stop a background network
Usage: icp-cli network stop [NAME]
-
<NAME>— Name of the network to stopDefault value:
local
Synchronize canisters in the current environment
Usage: icp-cli sync [OPTIONS] [NAMES]...
<NAMES>— Canister names
--identity <IDENTITY>— The user identity to run this command as--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic
Perform token transactions
Usage: icp-cli token [TOKEN] <COMMAND>
balance—transfer—
-
<TOKEN>Default value:
icp
Usage: icp-cli token balance [OPTIONS]
--identity <IDENTITY>— The user identity to run this command as--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic
Usage: icp-cli token transfer [OPTIONS] <AMOUNT> <RECEIVER>
<AMOUNT>— Token amount to transfer<RECEIVER>— The receiver of the token transfer
--identity <IDENTITY>— The user identity to run this command as--environment <ENVIRONMENT>— Override the environment to connect to. By default, the local environment is used--ic— Shorthand for --environment=ic
This document was generated automatically by
clap-markdown.