Agent skill
icp-cli
Guides use of the Internet Computer (ICP) CLI (icp) for local networks, builds, deploys, canister operations, identities, and cycles/tokens. Use when the user asks about icp-cli, icp commands, canister deployment, local ICP network workflows, or command help. Also use whenever dfx is mentioned so guidance always maps to icp.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/icp-cli
SKILL.md
ICP CLI Usage
Hard rule: no dfx
- Never suggest or use the legacy
dfxcommand. - Any time the user mentions
dfx, map the request to the equivalenticpcommand(s). - If a reference or example uses
dfx, translate it toicpbefore responding.
Quick start workflow
Default to these steps unless the user asks for a specific command:
- Create a project:
icp new my-project - Start local network:
icp network start -d - Deploy (builds automatically):
icp deploy - Call a method:
icp canister call <canister> <method> '(...)' - Verify if needed:
icp network status,icp canister status <canister>
Use -e/--environment when the user specifies a target (deploy uses environments; network start uses a network name or -e).
Non-interactive project creation
icp new may prompt for template values and can fail in non-TTY contexts. Use explicit template settings to avoid prompts:
icp new my-project --subfolder hello-world \
--define backend_type=rust \
--define frontend_type=react \
--define network_type=Default
Preflight checks
Use these to confirm the environment quickly:
icp --versionicp network listicp network status(oricp network ping --wait-healthy)
Command map (common tasks)
- Project lifecycle:
icp new,icp build,icp deploy,icp sync - Local network:
icp network start|status|ping|stop - Canister ops:
icp canister create|install|call|status|settings - Identities:
icp identity new|list|default|principal|import - Cycles/tokens:
icp cycles balance|mint|transfer,icp token balance|transfer - Project config:
icp project show
Decision points
- Local vs mainnet: default to local if unspecified; ask for environment or network if needed.
- Identity: suggest
--identitywhen multiple identities exist. - Install mode: use
--mode install|reinstall|upgradeonly when user requests it. - Arguments: if canister call args are unknown, recommend interactive prompt (omit args).
- Network conflicts:
icp network startaccepts a network name or-e;icp deployuses-e(no-nflag). - Environment variables: mention
ICP_ENVIRONMENTwhen the user wants a default.
Usage guidance (from README)
- Default to local network workflows unless a target is specified.
- Use
-e/--environmentor-n/--networkwhen a target is named, but never both. - Suggest
--identitywhen multiple identities might exist. - Provide the minimal command set plus a short verify step.
- If call arguments are unknown, omit args to trigger the interactive prompt.
Troubleshooting local network
- Port 8000 already in use: local PocketIC binds to
localhost:8000. Ificp network startfails, check and stop the other process withlsof -i :8000andkill <PID>. - Shutdown:
icp network stop(use when finished with local testing). - Verify network:
icp network statusoricp network ping --wait-healthy
Tool calls
Use tool calls to validate the latest CLI help and documentation.
CLI help (preferred when available locally):
{ "tool": "Shell", "command": "icp --help" }
{ "tool": "Shell", "command": "icp canister --help" }
{ "tool": "Shell", "command": "icp network --help" }
Docs pages (when the CLI isn’t available or for citations):
{
"tool": "WebFetch",
"url": "https://dfinity.github.io/icp-cli/reference/cli/"
}
{
"tool": "WebFetch",
"url": "https://dfinity.github.io/icp-cli/guides/local-development/"
}
{
"tool": "WebFetch",
"url": "https://dfinity.github.io/icp-cli/guides/installation/"
}
Repo context (for changes or deeper details):
{ "tool": "WebFetch", "url": "https://github.com/dfinity/icp-cli" }
Responses
When replying to users:
- Provide the smallest set of commands to accomplish the task.
- Include flags only when necessary to meet the user’s environment or identity needs.
- Offer a short "verify" step (e.g.,
icp network status,icp canister status). - Cite official docs or the CLI help when explaining flags or behavior.
- Ask for missing details only when required: environment/network, canister name, method, and args.
Self-test prompts
Use these to sanity-check outputs:
- "Start a local network and deploy" → quick start workflow + verify step.
- "Call a canister method but I don't know args" → omit args to trigger prompt.
- "Deploy to staging" → use
-e staging, avoid-n. - "Check cycles and top up" →
icp cycles balance+icp canister top-up.
Examples
Create and deploy a project locally
Commands:
icp new hello-icp
cd hello-icp
icp network start -d
icp network status
icp deploy
icp canister call backend greet '("World")'
Create a project non-interactively (CI/non-TTY)
Commands:
icp new hello-icp --subfolder hello-world \
--define backend_type=rust \
--define frontend_type=react \
--define network_type=Default
cd hello-icp
icp network start -d
icp deploy
Check cycles and top up
Commands:
icp cycles balance
icp canister top-up --amount 2t backend
Deploy to a named environment
Commands:
icp deploy -e staging
icp canister status -e staging
Sources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?