icp is the command-line tool that builds, deploys and manages Internet Computer projects; a project is a folder with an icp.yaml that lists its canisters and how to build each one.
Install
npm i -g @icp-sdk/icp-cli, plus npm i -g @icp-sdk/ic-wasm, which the official recipes use (Node.js 22 or later). icp replaces the older dfx tool; their commands and flags are not interchangeable.
A project
icp new my-projectstarts one from a template.icp.yamllists the canisters, each usually built by a recipe:@dfinity/motoko,@dfinity/rust,@dfinity/static-sitefor a frontend, or@dfinity/prebuiltfor a ready-made Wasm. Motoko projects also have amops.tomlnaming each canister's main file.- Each canister can carry
settings, such asenvironment_variables.
Build, deploy, sync
icp buildcompiles every canister to Wasm.icp deploybuilds, creates the canisters that don't exist yet, installs or upgrades their code, then syncs (for example, uploads a frontend's files).--mode reinstallwipes a canister's data, so use it with care.- At deploy time every canister gets each sibling's id as an environment variable,
PUBLIC_CANISTER_ID:followed by the canister's name, so they find each other without hardcoded ids.
Environments
localis a network on your computer, started withicp network start -d.icis the Internet Computer mainnet.icp deploytargetslocalunless you pass-e icor another environment you defined.
Deploying to a cloud engine
- Link the CLI once with the command from the console's Connect your ICP CLI dialog, so it signs as your console identity.
- Then deploy on the engine's subnet:
icp deploy --identity opencloud --subnet SUBNET_ID -e ic. The dialog fills in your subnet id; the engine's settings page shows it too.
Everyday commands
icp canister call backend greet '("Ada")' -e iccalls a method.icp canister status backend -e icshows whether it is running.icp identity list,icp identity defaultandicp identity principalmanage which identity signs.- Not sure of a flag?
icpfollowed by a subcommand and--help.
A coding agent can run all of this for you: the engine's Build with agents page gives a prompt that installs the icp-cli, cloud-engine-canisters and deploy-to-cloud-engine skills.