名称: crunch-protocol-skill
描述: Crunch Protocol CLI 的自然语言接口。将用户请求映射为用于管理协调器、竞赛(crunches)、奖励和检查点的 CLI 命令。支持为 Slack、Telegram、Discord 或纯文本格式化输出。
本技能将自然语言查询转换为 crunch-cli CLI 命令,并为不同媒介格式化输出。
确保 CLI 已全局安装:
npm install -g @crunchdao/crunch-cli
验证安装:
crunch-cli --version
配置文件存储在 profiles.json 中(与此文件位于同一目录)。每个配置文件将一个简称映射到一组 CLI 标志,这样用户就可以说诸如“列出 m-jeremy 的 crunches”之类的话,而无需每次都输入完整的地址。
{
"profiles": {
"m-jeremy": {
"url": "https://mainnet.helius-rpc.com/?api-key=...",
"wallet": "/path/to/keypair.json",
"multisigAddress": "9WzDXwBbmkg8...",
"coordinatorWallet": "5abc..."
},
"devnet": {
"url": "devnet",
"wallet": "/path/to/dev-keypair.json",
"coordinatorWallet": ""
}
}
}
| 配置字段 | CLI 标志 | 说明 |
|---|---|---|
url |
-u <value> |
RPC URL 或别名:mainnet-beta、devnet、testnet、localhost |
wallet |
-w <value> |
Solana 密钥对路径。仅在多签模式下且钱包作为提议者时使用。 |
multisigAddress |
-m <value> |
Squads 多签地址(非保险库地址)。 |
coordinatorWallet |
附加到 coordinator get 命令后 |
协调器所有者地址。设置后,默认使用此协调器的上下文(例如,列出其 crunches)。 |
当用户引用配置文件名时:
profiles.json。示例: 用户说“列出 m-jeremy 的 crunches”
mainnet-proposer → { url: "https://mainnet...", wallet: "/path/...", multisigAddress: "9WzDX..." }crunch-cli -u "https://mainnet..." -w "/path/..." -m "9WzDX..." crunches list示例: 用户说“显示 devnet 的协调器”
devnet → { url: "devnet" }crunch-cli -u devnet coordinator getprofiles.json,应用更改,然后写回。profiles.json 尚不存在,则使用上述结构创建它。为了速度和一致性,请将以下短语直接映射到 CLI 命令,无需 LLM 解释:
| 用户短语模式 | CLI 命令 |
|---|---|
get info about crunch <name> |
crunch-cli crunch get "<name>" |
get crunch <name> |
crunch-cli crunch get "<name>" |
show crunch <name> |
crunch-cli crunch get "<name>" |
crunch details <name> |
crunch-cli crunch get "<name>" |
get coordinator <address> |
crunch-cli coordinator get "<address>" |
show coordinator |
crunch-cli coordinator get |
my coordinator |
crunch-cli coordinator get |
list crunches |
crunch-cli crunches list |
list my crunches |
crunch-cli crunches list |
show all crunches |
crunch-cli crunches list |
get config |
crunch-cli coordinator get-config |
coordinator config |
crunch-cli coordinator get-config |
checkpoint for <name> |
crunch-cli crunch checkpoint-get-current "<name>" |
current checkpoint <name> |
crunch-cli crunch checkpoint-get-current "<name>" |
set certificate |
crunch-cli coordinator cert set |
set cert |
crunch-cli coordinator cert set |
update certificate |
crunch-cli coordinator cert set |
get certificate |
crunch-cli coordinator cert get |
get cert |
crunch-cli coordinator cert get |
show certificate |
crunch-cli coordinator cert get |
my certificate |
crunch-cli coordinator cert get |
sweep tokens <name> |
crunch-cli crunch sweep-token-accounts "<name>" |
sweep token accounts <name> |
crunch-cli crunch sweep-token-accounts "<name>" |
check prize accounts <name> |
crunch-cli crunch check-prize-atas "<name>" |
check atas <name> |
crunch-cli crunch check-prize-atas "<name>" |
map cruncher addresses |
crunch-cli crunch map-cruncher-addresses |
emission checkpoint add |
crunch-cli crunch emission-checkpoint-add |
bash
crunch-cli [options] <command> [arguments]| 命令 | 描述 | 用法 |
|---|---|---|
coordinator get [owner] |
获取协调器详情 | crunch-cli coordinator get [address] |
coordinator get-config |
获取协调器配置 | crunch-cli coordinator get-config |
coordinator register <name> |
注册新协调器 | crunch-cli coordinator register "Name" |
coordinator reset-hotkey |
重置 SMP 热键 | crunch-cli coordinator reset-hotkey |
coordinator set-emission-config |
设置排放百分比 | crunch-cli coordinator set-emission-config <coord%> <staker%> <fund%> |
| 命令 | 描述 | 用法 |
|---|---|---|
coordinator cert set <pubkey> [--slot N] |
设置证书哈希 | crunch-cli coordinator cert set "MIIBIjAN..." [--slot 0\|1] |
coordinator cert get [owner] |
获取证书信息 | crunch-cli coordinator cert get [address] |
| 命令 | 描述 | 用法 |
|---|---|---|
crunch get <name> |
获取 crunch 详情 | crunch-cli crunch get "Synth" |
crunches list [wallet] |
列出所有 crunches | crunch-cli crunches list |
crunch create |
创建新 crunch | crunch-cli crunch create "Name" <payoutUSDC> [maxModels] |
crunch start <name> |
开始竞赛 | crunch-cli crunch start "Name" |
crunch end <name> |
结束竞赛 | crunch-cli crunch end "Name" |
crunch deposit-reward |
存入 USDC | crunch-cli crunch deposit-reward "Name" <amount> |
crunch margin <name> |
执行保证金支付 | crunch-cli crunch margin "Name" |
crunch drain <name> |
清空剩余 USDC | crunch-cli crunch drain "Name" |
crunch get-cruncher |
获取 cruncher 详情 | crunch-cli crunch get-cruncher "CrunchName" <wallet> |
crunch sweep-token-accounts |
将代币扫入保险库 | crunch-cli crunch sweep-token-accounts "Name" |
crunch check-prize-atas |
检查 USDC 账户 | crunch-cli crunch check-prize-atas "Name" |
crunch map-cruncher-addresses |
映射 cruncher 地址 | crunch-cli crunch map-cruncher-addresses "CoordName" |
crunch emission-checkpoint-add |
添加排放检查点 | crunch-cli crunch emission-checkpoint-add "CoordName" <amount> |
| 命令 | 描述 | 用法 |
|---|---|---|
crunch checkpoint-create |
创建检查点 | crunch-cli crunch checkpoint-create "Name" prizes.json [--dryrun] |
crunch checkpoint-get-current |
当前检查点 | crunch-cli crunch checkpoint-get-current "Name" |
crunch checkpoint-get |
按索引获取检查点 | crunch-cli crunch checkpoint-get "Name" <index> |
-u, --url <network> - 网络:mainnet-beta、devnet、localhost(默认值:来自配置)-w, --wallet <path> - 钱包密钥对文件路径-o, --output json - 以 JSON 格式输出(便于解析)-m, --multisig <addr> - 创建多签提案而非直接执行从用户请求中检测输出媒介:
- "for slack" / "slack format" → Slack
- "for telegram" / "telegram format" → Telegram
- "for discord" / "discord format" → Discord
- 默认 → 纯文本 / Markdown
*🏆 Crunch: Synth*
━━━━━━━━━━━━━━━━━
• *Status:* Active
• *Participants:* 142
• *Prize Pool:* 10,000 USDC
• *Checkpoint:* 5
* *Funds:* 3000USDC
🏆 <b>Crunch: Synth</b>
📊 Status: Active
👥 Participants: 142
💰 Prize Pool: 10,000 USDC
📍 Checkpoint: 5
💰 Funds: 3000USDC
## 🏆 Crunch: Synth
**Status:** Active
**Participants:** 142
**Prize Pool:** 10,000 USDC
**Checkpoint:** 5
Crunch: Synth
Status: Active
Participants: 142
Prize Pool: 10,000 USDC
Checkpoint: 5
Funds: 3000USDC
如果命令失败:
1. 显示用户友好的错误信息。
2. 建议可能的修复方法:
- 网络错误?添加 -u devnet 或 -u mainnet-beta
- 缺少钱包?添加 -w /path/to/wallet.json
- 未找到 crunch?使用 crunches list 列出可用的 crunches。
crunch-cli crunch get "Synth"
crunch-cli -u mainnet-beta coordinator get
crunch-cli crunches list
然后将输出格式化为 Slack 格式。
crunch-cli crunch checkpoint-get-current "Chaos"
完整的 CLI 文档,请参阅 references/cli-reference.md。