guitar-chord
Display ASCII guitar chord diagrams using ascii_chord — an open-source Rust CLI (MIT license, authored by the same person as this skill).
The source code is bundled with this skill — no cloning needed.
Required Tools
| Tool | Purpose | Check |
|---|
| cargo / Rust | Build and run the CLI | INLINECODE0 |
Installing Rust (if not already installed)
CODEBLOCK0
Or download from rustup.rs.
Note: Installing Rust via rustup creates ~/.cargo and ~/.rustup in your home directory and may modify your shell PATH.
Post-Install Setup
After installing, run the init script once:
CODEBLOCK1
This will:
- 1. Create a
.gitignore in the skill directory to exclude cargo build artifacts (/target) from git - Pre-warm the cargo build cache so the first chord lookup is fast
First Run Warning
If you skip the init script, the first cargo run will take 30–60 seconds while cargo compiles the binary. This is normal — subsequent runs are fast (binary is cached in target/). Do not interrupt the first build.
Diagram Legend
CODEBLOCK2
Numbers on the left (when shown) indicate the starting fret position for higher-up chords.
Usage
The skill directory contains the full Rust source. Run from there:
Single chord:
CODEBLOCK3
Multiple chords side by side:
CODEBLOCK4
List all supported chords:
CODEBLOCK5
Replace <skill_dir> with the path where this skill is installed (e.g. ~/.openclaw/workspace/skills/ascii-chord).
Examples
CODEBLOCK6
Discovering Supported Chords
Not all chord voicings are supported. If a user asks for a chord that fails, use all to list every supported chord name and find the closest match:
CODEBLOCK7
Notes
- - Suppress build warnings with INLINECODE11
- Chord names are case-sensitive (
Am not am, B7 not b7) - After first build, subsequent runs are fast (binary cached by cargo in
target/) - Source repo: https://github.com/ascii-music/ascii_chord (MIT licensed)
guitar-chord
使用 ascii_chord 显示 ASCII 吉他和弦图——这是一个开源 Rust 命令行工具(MIT 许可证,与本技能为同一作者)。
源代码已与本技能捆绑——无需克隆。
所需工具
| 工具 | 用途 | 检查 |
|---|
| cargo / Rust | 构建并运行命令行工具 | cargo --version |
安装 Rust(如果尚未安装)
bash
macOS(Homebrew — 推荐)
brew install rustup-init && rustup-init
或从 rustup.rs 下载。
注意: 通过 rustup 安装 Rust 会在您的主目录中创建 ~/.cargo 和 ~/.rustup,并可能修改您的 shell PATH。
安装后设置
安装完成后,运行一次初始化脚本:
bash
bash ~/.openclaw/workspace/skills/ascii-chord/scripts/init.sh
这将:
- 1. 在技能目录中创建 .gitignore,以排除 cargo 构建产物(/target)被 git 跟踪
- 预热 cargo 构建缓存,使首次和弦查询更快
首次运行警告
如果跳过初始化脚本,首次 cargo run 将需要 30–60 秒,因为 cargo 需要编译二进制文件。这是正常现象——后续运行会很快(二进制文件缓存在 target/ 中)。请勿中断首次构建。
图示图例
✕ = 静音此弦(不弹奏)
◯ = 空弦(弹奏不按弦)
● = 按此品位(实心圆点)
═ = 弦枕(指板顶部)
─ = 品丝
│ = 琴弦
左侧的数字(如果显示)表示高把位和弦的起始品位位置。
使用方法
技能目录包含完整的 Rust 源代码。请在该目录中运行:
单个和弦:
bash
cd <技能目录> && cargo run -- get <和弦名称> 2>/dev/null
多个和弦并排显示:
bash
cd <技能目录> && cargo run -- list <和弦1> <和弦2> ... 2>/dev/null
列出所有支持的和弦:
bash
cd <技能目录> && cargo run -- all 2>/dev/null
将 <技能目录> 替换为本技能安装的路径(例如 ~/.openclaw/workspace/skills/ascii-chord)。
示例
bash
单个和弦
cd ~/.openclaw/workspace/skills/ascii-chord && cargo run -- get Am 2>/dev/null
多个并排显示(非常适合和弦进行)
cd ~/.openclaw/workspace/skills/ascii-chord && cargo run -- list C G Am F 2>/dev/null
所有支持的和弦名称完整列表
cd ~/.openclaw/workspace/skills/ascii-chord && cargo run -- all 2>/dev/null
查找支持的和弦
并非所有和弦指法都受支持。如果用户请求的和弦失败,请使用 all 列出所有支持的和弦名称并找到最接近的匹配:
bash
cd ~/.openclaw/workspace/skills/ascii-chord && cargo run -- all 2>/dev/null
注意事项
- - 使用 2>/dev/null 抑制构建警告
- 和弦名称区分大小写(Am 而非 am,B7 而非 b7)
- 首次构建后,后续运行速度很快(二进制文件由 cargo 缓存在 target/ 中)
- 源代码仓库:https://github.com/ascii-music/ascii_chord(MIT 许可证)