Skip to main content

canhelp

Display a human-readable summary of a canister's interface given its mainnet canister ID or a human-readable name. Like --help but for canisters. Only for mainnet canisters — for local canisters, read the generated .did file in your project directly.

来源信息

仓库
dfinity/icskills
最近来源活动
2026年8月5日 18:48
检测到的 SKILL.md 语言
英语
星标
36
分支
14

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
3 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
canhelp
description
Display a human-readable summary of a canister's interface given its mainnet canister ID or a human-readable name. Like --help but for canisters. Only for mainnet canisters — for local canisters, read the generated .did file in your project directly.
license
Apache-2.0
compatibility
icp-cli >= 0.1.0
allowed-tools
Bash(./scripts/resolve-canister-id.sh *), Bash(./scripts/fetch-candid.sh *), Read, Grep, Glob
argument-hint
<canister-id-or-name>
metadata
{"title":"Canister Help","category":"Infrastructure"}
Given a canister ID or name in `$ARGUMENTS`, fetch and summarize its Candid interface. ## Steps 1. Resolve the canister ID by running the resolve script from the skill's base directory: ```bash ./scripts/resolve-canister-id.sh "$ARGUMENTS" ``` If `$ARGUMENTS` is already a valid principal, the script echoes it back. Otherwise, it queries the IC Dashboard API and outputs matches as `<canister-id> <name>` (one per line). - If there is a single result, clearly display the resolved canister ID and use it directly. - If there are multiple results, present the list to the user and ask them to pick one before continuing. 2. Fetch the Candid interface using the resolved canister ID: ```bash ./scripts/fetch-candid.sh <resolved-canister-id> ``` The script outputs the path to the downloaded `.did` file. 3. Read the file using the `Read` tool. 4. Present the output as a readable summary with the following structure: **Canister `<canister-id>`** **Query methods:** - `method_name(arg1: type1, arg2: type2) → return_type` — one-line description if inferable from the name **Update methods:** - `method_name(arg1: type1) → return_type` **Types:** - List any custom record/variant types defined in the interface, with their fields ## Guidelines - Group methods by query vs update - Sort methods alphabetically within each group - For complex nested types, show the top-level structure and note nesting - If the candid is very large (>100 methods), show a summary count and list only the most important-looking methods, offering to show the full list on request - If the fetch succeeds, but the Candid interface is empty,explain that the canister is not exposing its Candid interface in the wasm metadata - If the fetch fails, suggest the user verify the canister ID and that `icp` is installed
在 GitHub 查看