icp-cli
БесплатноБез исполняемых скриптовНе проверенGuides use of the icp command-line tool for building and deploying Internet Computer applications. Covers project configuration (icp.yaml), recipes…
от jiayaoqijia★ 81 звезда на GitHubОб этом скилле
ICP CLI
What This Is
The icp command-line tool builds and deploys applications on the Internet Computer. It replaces the legacy dfx tool with YAML configuration, a recipe system for reusable build templates, and an environment model that separates deployment targets from network connections. Never use dfx — always use icp.
Before generating any icp command not explicitly documented here, run icp --help or icp <subcommand> --help to verify the command and its flags exist. Do not infer flags from dfx equivalents — the CLIs are not flag-compatible.
Installation
npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm
ic-wasm is required when using official recipes (@dfinity/rust, @dfinity/motoko, @dfinity/static-site, @dfinity/asset-canister) — they depend on it for optimization and metadata embedding. Requires Node.js >= 22. Also available via Homebrew and shell script installer — see the icp-cli releases.
Linux note: On minimal installs, you may need system libraries: sudo apt-get install -y libdbus-1-3 libssl3 ca-certificates (Ubuntu/Debian) or sudo dnf install -y dbus-libs openssl ca-certificates (Fedora/RHEL).
Prerequisites
- For Rust canisters:
rustup target add wasm32-unknown-unknown - For Motoko canisters:
npm i -g ic-mopsand amops.tomlat the project root with the Motoko compiler version and a[canisters]entry:
The[toolchain] moc = "1.9.0" [canisters.backend] main = "src/backend/main.mo"@dfinity/motoko@v5+recipe compiles viamops build <canister-name>. The canister name inicp.yamlmust exactly match a key in[canisters]— a missing or mismatched key causesmops buildto fail withNo Motoko canisters found in mops.toml configuration(see Pitfall 17). Withoutmops.toml, the recipe fails becausemopsis not found. Templates includemops.tomlautomatically; for manual projects, create it before runningicp build. Loadmops-clifor[canisters]configuration options, dependency management, andmops builddetails.
Common Pitfalls
Using
dfxinstead oficp. Thedfxtool is legacy. All commands haveicpequivalents — seereferences/dfx-migration.mdfor the full command mapping. Never generatedfxcommands or referencedfxdocumentation. Configuration usesicp.yaml, notdfx.json— and the structure differs: canisters are an array of objects, not a keyed object.Using
--network icto deploy to mainnet. icp-cli uses environments, not direct network targeting. The correct flag is-e ic(short for--environment ic).# Wrong icp deploy --network ic # Correct icp deploy -e icNote:
-n/--networktargets a network directly and works with canister IDs (principals). Use-e/--environmentwhen referencing canisters by name. For token and cycles operations, use-nsince they don't reference project canisters.Using a recipe without a version pin. icp-cli rejects unpinned recipe references. Always include an explicit version. Official recipes are hosted at dfinity/icp-cli-recipes.
# Wrong — rejected by icp-cli recipe: type: "@dfinity/rust" # Correct — pinned version recipe: type: "@dfinity/[email protected]"Writing manual build steps when a recipe exists. Official recipes handle Rust, Motoko, and asset canister builds. Use
recipe: { type: "@dfinity/[email protected]" }instead of writing shell commands inbuild.steps— the Rust recipe defaults the Cargopackageto the canister name, so no configuration is needed when they match (see Pitfall 21).Not committing
.icp/data/to version control. Mainnet canister IDs are stored in.icp/data/mappings/<environment>.ids.json. Losing this file means losing the mapping between canister names and on-chain IDs. Always commit.icp/data/— never delete it. Add.icp/cache/to.gitignore(it is ephemeral and rebuilt automatically). If you have environments using a connected network that gets reset frequently you can add those specific environment mapping files to .gitignore. Never add the entire.icpor.icp/datadirectory to gitignore.Using
icp identity useinstead oficp identity default. The dfx commanddfx identity use <name>becameicp identity default <name>(setter).icp identity defaultwith no argument is the getter — it prints the current default identity, equivalent todfx identity whoami. The commandicp identity usedoes not exist. Similarly,dfx identity get-principalbecameicp identity principal, anddfx identity removebecameicp identity delete.Confusing networks and environments. A network is a connection endpoint (URL). An environment combines a network + canisters + settings. You deploy to environments (
-e), not networks. Multi
Установить icp-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл icp-cli?
Guides use of the icp command-line tool for building and deploying Internet Computer applications. Covers project configuration (icp.yaml), recipes, environments, canister lifecycle, identity management, and bundling a project into a self-contained .icp package (icp project bundle). Use when building, deploying, or managing any IC project. Use when the user mentions icp, dfx, canister deployment, local network, project setup, or bundling/packaging an app as an .icp file. Do NOT use for canister-level programming patterns like access control, inter-canister calls, or stable memory — use domain-specific skills instead.
Как установить скилл icp-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл icp-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic