icp-cli

Builds, deploys, and manages Internet Computer canisters using icp.yaml configuration and recipes.

Updated Apr 3, 2026
One-click install
npx skills add https://github.com/phukrit7171/Relationship-Smart-Contract-ICP --skill icp-cli-phukrit7171
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: icp-cli
Source: https://github.com/phukrit7171/Relationship-Smart-Contract-ICP/tree/main/.agents/skills/icp-cli
Command: npx skills add https://github.com/phukrit7171/Relationship-Smart-Contract-ICP --skill icp-cli-phukrit7171

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Migrating from dfx and operating the modern icp CLI involves many breaking changes — YAML array syntax, version-pinned recipes, environments instead of --network ic, and no dfx generate — that cause confusing build and deployment failures. This Skill guides correct usage of the icp CLI so projects build, deploy, and sync without hitting those pitfalls. ## Core Features & Use Cases - Project configuration: Authors correct icp.yaml files with pinned recipes (@dfinity/rust, @dfinity/motoko, @dfinity/asset-canister), environments, networks, and canister settings. - Deployment workflows: Covers local network startup, icp deploy build/deploy/sync phases, install modes, identity management, and mainnet funding checks. - dfx migration: Maps every dfx command and config field to its icp equivalent, including identity export, canister ID migration, and frontend package replacement with @icp-sdk/core and @icp-sdk/bindgen. - Use Case: A developer with a Rust backend and Vite/React frontend asks to deploy locally — the Skill produces icp network start -d followed by icp deploy, with the correct recipe configuration and binding generation setup. ## Quick Start Ask the assistant to create an icp.yaml and deploy your Rust backend and asset frontend to the local network using the icp CLI.

Frequently Asked Questions about icp-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy an Internet Computer canister with the icp CLI?

Run `icp network start -d` to start the project-local network, then `icp deploy` to build, deploy, and sync all canisters. For mainnet, use `icp deploy -e ic` — icp-cli targets environments, not `--network ic`.

How do I migrate a project from dfx to icp-cli?

Replace dfx.json with icp.yaml using recipe types like `@dfinity/[email protected]`, move canister IDs from canister_ids.json into `.icp/data/mappings/ic.ids.json`, and swap `@dfinity/agent` for `@icp-sdk/core` plus `@icp-sdk/bindgen`. The references/dfx-migration.md file contains the full command and config mapping.

Why does icp deploy fail with an unpinned recipe error?

icp-cli rejects recipe references without an explicit version. Write `recipe: { type: "@dfinity/[email protected]" }` instead of `@dfinity/rust`, and check the icp-cli-recipes releases page for current versions.

Does icp-cli generate TypeScript bindings like dfx generate?

No, icp-cli has no `dfx generate` equivalent. Use `@icp-sdk/bindgen` (>= 0.3.0) with `@icp-sdk/core` (>= 5.0.0), typically as a Vite plugin pointing at a committed .did file, and pass `{ agentOptions }` rather than `{ agent }` to createActor.

Why does the Motoko build fail with 'No Motoko canisters found in mops.toml'?

The `@dfinity/motoko@v5+` recipe runs `mops build <canister-name>`, which requires a `[canisters.<name>]` entry in mops.toml exactly matching the canister name in icp.yaml. Add the entry with a `main` path and ensure mops.toml sits at the project root for inline canisters.

How do frontend canisters get canister IDs without a .env file?

icp deploy injects every canister's ID as `PUBLIC_CANISTER_ID:<name>` into canister settings, and the asset canister exposes them through the `ic_env` cookie. Frontends read them with `safeGetCanisterEnv()` from `@icp-sdk/core` instead of `CANISTER_ID_*` env variables.