Claude-skill-registry 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.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/icp-cli" ~/.claude/skills/majiayu000-claude-skill-registry-icp-cli && rm -rf "$T"
skills/data/icp-cli/SKILL.mdICP CLI Usage
Hard rule: no dfx
- Never suggest or use the legacy
command.dfx - Any time the user mentions
, map the request to the equivalentdfx
command(s).icp - If a reference or example uses
, translate it todfx
before responding.icp
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 statusicp 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 list
(oricp network status
)icp network ping --wait-healthy
Command map (common tasks)
- Project lifecycle:
,icp new
,icp build
,icp deployicp 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|transfericp 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
when multiple identities exist.--identity - Install mode: use
only when user requests it.--mode install|reinstall|upgrade - Arguments: if canister call args are unknown, recommend interactive prompt (omit args).
- Network conflicts:
accepts a network name oricp network start
;-e
usesicp deploy
(no-e
flag).-n - Environment variables: mention
when the user wants a default.ICP_ENVIRONMENT
Usage guidance (from README)
- Default to local network workflows unless a target is specified.
- Use
or-e/--environment
when a target is named, but never both.-n/--network - Suggest
when multiple identities might exist.--identity - 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
. Iflocalhost:8000
fails, check and stop the other process withicp network start
andlsof -i :8000
.kill <PID> - Shutdown:
(use when finished with local testing).icp network stop - Verify network:
oricp network statusicp 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
, avoid-e staging
.-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