Skip to content

feat: --help for canisters#89

Open
gregorydemay wants to merge 2 commits intomainfrom
gdemay/DEFI-2696-canhelp
Open

feat: --help for canisters#89
gregorydemay wants to merge 2 commits intomainfrom
gdemay/DEFI-2696-canhelp

Conversation

@gregorydemay
Copy link
Collaborator

@gregorydemay gregorydemay commented Mar 17, 2026

Summary

  • Adds a new canhelp skill that displays a human-readable summary of a canister's Candid interface given its mainnet canister ID or name
  • Includes two helper scripts:
    • resolve-canister-id.sh: resolves name → principal via IC Dashboard API
    • fetch-candid.sh: fetches Candid metadata via icp CLI
  • Agents can invoke this like --help for canisters — resolve by name or ID, fetch the .did, and present grouped query/update methods and use it to interact with the canister

Examples

Load Canister API in context

There are several ways to find the canister API of a canister:

  1. By exact canister ID, e.g. /canhelp rrkah-fqaaa-aaaaa-aaaaq-cai
  2. By canister name, e.g. /canhelp NNS Governance. If there is more than one match, e.g. if the search is too imprecise, the user will be asked to refine the search and a list of candidates canister is presented. For example /canhttp governance returns
    Multiple matches found. Which governance canister do you want?
    
      1. NNS Governance — rrkah-fqaaa-aaaaa-aaaaq-cai
      2. OpenChat Governance — 2jvtu-yqaaa-aaaaq-aaama-cai
      3. ICPSwap Governance — cvzxu-kyaaa-aaaaq-aacvq-cai
      4. KongSwap Governance — oypg6-faaaa-aaaaq-aadza-cai
      5. Gold DAO Governance — tr3th-kiaaa-aaaaq-aab6q-cai
      6. WaterNeuron Governance — jfnic-kaaaa-aaaaq-aadla-cai
      7. ORIGYN Governance — lnxxh-yaaaa-aaaaq-aadha-cai
    
      ...and 34 more. Pick a number or paste a canister ID.
    

Interact with canister by prompts

For example ask for List currently opened proposals, which returns

There are 2 currently open proposals:

  ┌─────┬────────┬─────────────────────────────────────────────────────────────────────────┬──────────────┬────────────────┬────────┬─────────────────────┐
  │  #  │   ID   │                                  Title                                  │     Yes      │       No       │ Total  │   Deadline (UTC)    │
  ├─────┼────────┼─────────────────────────────────────────────────────────────────────────┼──────────────┼────────────────┼────────┼─────────────────────┤
  │ 1   │ 140865 │ NNS Proposal to create an SNS named 'Yusan'                             │ 3.45T (7.4%) │ 11.17T (23.9%) │ 46.69T │ Mar 16, 2026 ~11:49 │
  ├─────┼────────┼─────────────────────────────────────────────────────────────────────────┼──────────────┼────────────────┼────────┼─────────────────────┤
  │ 2   │ 140873 │ Upgrade NNS Canister: he6b4-hiaaa-aaaan-aaaeq-cai (wasm hash 541a8592…) │ 1.38T (2.9%) │ 175.6B (0.4%)  │ 46.66T │ Mar 18, 2026 ~09:10 │
  └─────┴────────┴─────────────────────────────────────────────────────────────────────────┴──────────────┴────────────────┴────────┴─────────────────────┘

  (Voting power shown in e8s. 1T e8s = 10,000 ICP voting power.)

  Proposal 140865 (SNS creation for Yusan) is leaning heavily toward rejection. Proposal 140873 (NNS canister upgrade) has early support with minimal opposition.```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

gregorydemay and others added 2 commits March 17, 2026 15:14
…D or name

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@ielashi ielashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very useful, lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants