crunch-coordinate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Crunch Protocol CLI Skill

Crunch Protocol CLI Skill

Translates natural language queries into
crunch-cli
commands. Supports profiles and output formatting for Slack, Telegram, Discord, or plain text.
将自然语言查询转换为
crunch-cli
命令。支持配置文件以及Slack、Telegram、Discord或纯文本的输出格式。

Prerequisites

前置条件

  • Node.js 18+ with
    npm
  • Solana wallet keypair (for on-chain operations)
  • 安装Node.js 18及以上版本,并配备
    npm
  • Solana钱包密钥对(用于链上操作)

Package Installation

包安装

This skill installs packages via npm (global):
PackageSourcePurpose
@crunchdao/crunch-cli
npmCrunchDAO protocol CLI (coordinators, competitions, staking)
Agent rules for package installation:
  • Only install
    @crunchdao/crunch-cli
    from the official npm registry
  • No custom registry URLs — no
    --registry
    overrides
  • Ask the user before installing if not already present
本技能通过npm全局安装包:
来源用途
@crunchdao/crunch-cli
npmCrunchDAO协议CLI(用于协调器、竞赛、质押管理)
Agent包安装规则:
  • 仅从官方npm注册表安装
    @crunchdao/crunch-cli
  • 禁止使用自定义注册表URL —— 不允许添加
    --registry
    参数覆盖
  • 如果尚未安装,需先询问用户再进行安装

Credentials

凭证

Solana Wallet Keypair (required for on-chain operations)

Solana钱包密钥对(链上操作必需)

  • What it is: A JSON file containing a Solana private key, used to sign transactions
  • How it's configured: Set via
    crunch-cli config set wallet /path/to/wallet.json
    or
    -w
    flag per command
  • Stored in: User-managed file on disk; path referenced in
    ~/.crunch/config.json
Agent rules for wallets:
  • Never create or generate wallet keypairs unless the user explicitly asks and understands the security implications
  • Never read or display the contents of wallet keypair files
  • Never commit wallet files to git — always verify
    .gitignore
    covers them
  • Ask the user for the wallet path — never assume or search for keypair files
  • 定义: 包含Solana私钥的JSON文件,用于签署交易
  • 配置方式: 通过
    crunch-cli config set wallet /path/to/wallet.json
    命令或每个命令的
    -w
    标志设置
  • 存储位置: 用户本地磁盘上的文件;路径记录在
    ~/.crunch/config.json
Agent钱包操作规则:
  • 除非用户明确要求且了解安全风险,否则绝不创建或生成钱包密钥对
  • 绝不读取或显示钱包密钥对文件的内容
  • 绝不将钱包文件提交到git —— 务必验证
    .gitignore
    已包含相关文件
  • 需向用户询问钱包路径 —— 绝不假设或自动搜索密钥对文件

Profile Config (
~/.crunch/config.json
)

配置文件(
~/.crunch/config.json

  • Stores network, wallet path, and RPC URL per profile
  • Managed via
    crunch-cli config
    commands — no need to edit manually
  • Never modify or delete existing profiles unless explicitly asked
  • 按配置文件存储网络、钱包路径和RPC URL
  • 通过
    crunch-cli config
    命令管理 —— 无需手动编辑
  • 除非用户明确要求,否则绝不修改或删除现有配置文件

Setup

安装设置

bash
npm install -g @crunchdao/crunch-cli
crunch-cli --version
bash
npm install -g @crunchdao/crunch-cli
crunch-cli --version

Profiles

配置文件管理

The CLI has built-in profile management via
~/.crunch/config.json
:
bash
crunch-cli config show                    # Show current config
crunch-cli config active                  # Show resolved active values
crunch-cli config list-profiles           # List available profiles
crunch-cli config save-profile <name>     # Save current config as profile
crunch-cli config use <profile>           # Switch profile
crunch-cli config set <key> <value>       # Set config value
Global flags can override config per-command:
FlagDescription
-n, --network
Solana network:
mainnet-beta
,
devnet
,
localhost
-u, --url
Custom RPC URL
-w, --wallet
Path to Solana keypair
-o, --output
Output format:
json
,
table
,
yaml
CLI通过
~/.crunch/config.json
内置配置文件管理功能:
bash
crunch-cli config show                    # 查看当前配置
crunch-cli config active                  # 查看已解析的当前生效配置
crunch-cli config list-profiles           # 列出所有可用配置文件
crunch-cli config save-profile <name>     # 将当前配置保存为新配置文件
crunch-cli config use <profile>           # 切换配置文件
crunch-cli config set <key> <value>       # 设置配置项
全局标志可在单命令中覆盖配置:
标志描述
-n, --network
Solana网络:
mainnet-beta
devnet
localhost
-u, --url
自定义RPC URL
-w, --wallet
Solana密钥对文件路径
-o, --output
输出格式:
json
table
yaml

Direct Phrase Mapping

语句与命令映射表

User PhraseCLI Command
get/show crunch <name>
crunch-cli crunch get "<name>"
list crunches
crunch-cli crunch list
get/show coordinator [address]
crunch-cli coordinator get [address]
list coordinators
crunch-cli coordinator list
get config
crunch-cli coordinator get-config
checkpoint for <name>
crunch-cli crunch checkpoint-get-current "<name>"
create checkpoint <name>
crunch-cli crunch checkpoint-create "<name>" prizes.json
deposit reward <name> <amount>
crunch-cli crunch deposit-reward "<name>" <amount>
drain <name>
crunch-cli crunch drain "<name>"
create/register cruncher
crunch-cli cruncher create
register for <name>
crunch-cli cruncher register "<name>"
claim rewards <name>
crunch-cli cruncher claim "<name>"
show staking positions
crunch-cli staking positions
stake/deposit <amount>
crunch-cli staking deposit <amount>
delegate to <coordinator>
crunch-cli staking delegate "<coordinator>" <amount>
show staking rewards
crunch-cli staking rewards
claim staking rewards
crunch-cli staking claim
undelegate from <coordinator>
crunch-cli staking undelegate "<coordinator>" <amount>
withdraw stake <amount>
crunch-cli staking withdraw <amount>
init workspace <name>
crunch-cli init-workspace "<name>"
list scenarios/simulations
crunch-cli model list
run simulation <scenario>
crunch-cli model run "<scenario>"
register coordinator <name>
crunch-cli coordinator register "<name>"
create crunch <name>
crunch-cli crunch create "<name>" <amount> [maxModels]
start/end crunch <name>
crunch-cli crunch start/end "<name>"
用户语句CLI命令
获取/查看竞赛 <名称>
crunch-cli crunch get "<name>"
列出所有竞赛
crunch-cli crunch list
获取/查看协调器 [地址]
crunch-cli coordinator get [address]
列出所有协调器
crunch-cli coordinator list
获取配置
crunch-cli coordinator get-config
获取<名称>的检查点
crunch-cli crunch checkpoint-get-current "<name>"
创建<名称>的检查点
crunch-cli crunch checkpoint-create "<name>" prizes.json
为<名称>存入奖励 <数量>
crunch-cli crunch deposit-reward "<name>" <amount>
提取<名称>的资金
crunch-cli crunch drain "<name>"
创建/注册cruncher账户
crunch-cli cruncher create
注册参加<名称>竞赛
crunch-cli cruncher register "<name>"
领取<名称>的奖励
crunch-cli cruncher claim "<name>"
查看质押仓位
crunch-cli staking positions
质押/存入 <数量>
crunch-cli staking deposit <amount>
委托给<协调器>
crunch-cli staking delegate "<coordinator>" <amount>
查看质押奖励
crunch-cli staking rewards
领取质押奖励
crunch-cli staking claim
从<协调器>撤销委托
crunch-cli staking undelegate "<coordinator>" <amount>
提取质押 <数量>
crunch-cli staking withdraw <amount>
初始化工作区 <名称>
crunch-cli init-workspace "<name>"
列出场景/模拟任务
crunch-cli model list
运行模拟 <场景>
crunch-cli model run "<scenario>"
注册协调器 <名称>
crunch-cli coordinator register "<name>"
创建竞赛 <名称>
crunch-cli crunch create "<name>" <amount> [maxModels]
启动/结束竞赛 <名称>
crunch-cli crunch start/end "<name>"

Execution Pattern

执行流程

  1. Parse — Identify action, target, name/identifier, parameters
  2. Resolve profile — If mentioned, switch profile or use flags
  3. Map — Use phrase mapping table
  4. Execute — Run command
  5. Format — Output for requested medium (Slack/Telegram/Discord/plain)
  1. 解析 —— 识别操作类型、目标对象、名称/标识符、参数
  2. 解析配置文件 —— 如果提及,切换配置文件或使用标志覆盖
  3. 映射 —— 使用语句映射表转换为CLI命令
  4. 执行 —— 运行命令
  5. 格式化 —— 根据指定平台(Slack/Telegram/Discord/纯文本)输出结果

Output Formatting

输出格式

Detect medium from user request ("for slack", "telegram format", etc.):
  • Slack:
    *bold*
    ,
    bullets,
    separators
  • Telegram:
    <b>bold</b>
    , emoji prefixes
  • Discord:
    ## headers
    ,
    **bold**
  • Plain: Simple key: value pairs
根据用户请求自动识别平台(如"for slack"、"telegram format"等):
  • Slack: 使用
    *粗体*
    项目符号、
    分隔符
  • Telegram: 使用
    <b>粗体</b>
    、表情符号前缀
  • Discord: 使用
    ## 标题
    **粗体**
  • 纯文本: 简单的键值对格式

Error Handling

错误处理

If command fails, suggest fixes:
  • Wrong network? Add
    -n mainnet-beta
    or
    -n devnet
  • Missing wallet? Add
    -w /path/to/wallet.json
  • Not found? List available with
    crunch-cli crunch list
如果命令执行失败,提供修复建议:
  • 网络错误?添加
    -n mainnet-beta
    -n devnet
    标志切换网络
  • 缺少钱包?添加
    -w /path/to/wallet.json
    标志指定钱包路径
  • 对象不存在?使用
    crunch-cli crunch list
    命令列出可用对象

Coordinator Node Setup

协调器节点搭建

Scaffold a new competition workspace:
bash
crunch-cli init-workspace my-challenge
This generates a full node workspace. See the coordinator-node-starter skill for customization.
快速生成新竞赛工作区:
bash
crunch-cli init-workspace my-challenge
该命令会生成完整的节点工作区。如需自定义,请参考coordinator-node-starter技能。

Reference

参考资料

For full CLI documentation: references/cli-reference.md
完整CLI文档请查看:references/cli-reference.md",