crunch-coordinate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCrunch Protocol CLI Skill
Crunch Protocol CLI Skill
Translates natural language queries into commands. Supports profiles and output formatting for Slack, Telegram, Discord, or plain text.
crunch-cli将自然语言查询转换为命令。支持配置文件以及Slack、Telegram、Discord或纯文本的输出格式。
crunch-cliPrerequisites
前置条件
- 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):
| Package | Source | Purpose |
|---|---|---|
| npm | CrunchDAO protocol CLI (coordinators, competitions, staking) |
Agent rules for package installation:
- Only install from the official npm registry
@crunchdao/crunch-cli - No custom registry URLs — no overrides
--registry - Ask the user before installing if not already present
本技能通过npm全局安装包:
| 包 | 来源 | 用途 |
|---|---|---|
| npm | CrunchDAO协议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 or
crunch-cli config set wallet /path/to/wallet.jsonflag per command-w - 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 covers them
.gitignore - 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配置文件(~/.crunch/config.json
)
~/.crunch/config.json- Stores network, wallet path, and RPC URL per profile
- Managed via commands — no need to edit manually
crunch-cli config - Never modify or delete existing profiles unless explicitly asked
- 按配置文件存储网络、钱包路径和RPC URL
- 通过命令管理 —— 无需手动编辑
crunch-cli config - 除非用户明确要求,否则绝不修改或删除现有配置文件
Setup
安装设置
bash
npm install -g @crunchdao/crunch-cli
crunch-cli --versionbash
npm install -g @crunchdao/crunch-cli
crunch-cli --versionProfiles
配置文件管理
The CLI has built-in profile management via :
~/.crunch/config.jsonbash
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 valueGlobal flags can override config per-command:
| Flag | Description |
|---|---|
| Solana network: |
| Custom RPC URL |
| Path to Solana keypair |
| Output format: |
CLI通过内置配置文件管理功能:
~/.crunch/config.jsonbash
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> # 设置配置项全局标志可在单命令中覆盖配置:
| 标志 | 描述 |
|---|---|
| Solana网络: |
| 自定义RPC URL |
| Solana密钥对文件路径 |
| 输出格式: |
Direct Phrase Mapping
语句与命令映射表
| User Phrase | CLI Command |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 用户语句 | CLI命令 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Execution Pattern
执行流程
- Parse — Identify action, target, name/identifier, parameters
- Resolve profile — If mentioned, switch profile or use flags
- Map — Use phrase mapping table
- Execute — Run command
- Format — Output for requested medium (Slack/Telegram/Discord/plain)
- 解析 —— 识别操作类型、目标对象、名称/标识符、参数
- 解析配置文件 —— 如果提及,切换配置文件或使用标志覆盖
- 映射 —— 使用语句映射表转换为CLI命令
- 执行 —— 运行命令
- 格式化 —— 根据指定平台(Slack/Telegram/Discord/纯文本)输出结果
Output Formatting
输出格式
Detect medium from user request ("for slack", "telegram format", etc.):
- Slack: ,
*bold*bullets,•separators━ - Telegram: , emoji prefixes
<b>bold</b> - 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 or
-n mainnet-beta-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-challengeThis 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",