cmus Music Player
/install cmus
cmus (OpenClaw Playback Controller)
Workflow: Receive file path from yt-dlp -> Launch cmus UI (if not running) -> Wait for socket -> Apply user's specific playback rules -> Play.
Find the active daemon & Launch UI
When OpenClaw runs in the background, it lacks X11/Wayland display variables. The agent MUST inject the environment variables and dynamically poll for the cmus socket instead of using hardcoded sleep.
Execute this precise bash block to ensure the terminal opens and the socket is ready: export DISPLAY=${DISPLAY:-:0.0} export XAUTHORITY=${XAUTHORITY:-$HOME/.Xauthority} export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
if ! pgrep -x cmus > /dev/null; then xfce4-terminal -e cmus & for i in {1..20}; do cmus-remote -C "status" >/dev/null 2>&1 && break sleep 0.5 done fi
Playback Rule Engine
The agent must parse the user's prompt to determine the playback mode. CRITICAL: The agent MUST resolve \x3Cpath_to_file> using eval echo to ensure absolute pathing before passing to cmus-remote.
Mode A: Play track and shuffle the rest (Default)
Trigger Intent: "Play this track", "Open song...", "Play and shuffle". Execute this bash block: TARGET_FILE=$(eval echo "\x3Cpath_to_file>") cmus-remote -C "clear" cmus-remote -C "add $HOME/.openclaw/workspace/music/" cmus-remote -C "set continue=true" cmus-remote -C "set shuffle=true" cmus-remote -f "$TARGET_FILE"
Mode B: Play ONLY the requested track
Trigger Intent: "Play only this track", "Do not shuffle", "Single track mode". Execute this bash block: TARGET_FILE=$(eval echo "\x3Cpath_to_file>") cmus-remote -C "clear" cmus-remote -C "add $TARGET_FILE" cmus-remote -C "set continue=false" cmus-remote -C "set repeat=false" cmus-remote -p
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cmus - 安装完成后,直接呼叫该 Skill 的名称或使用
/cmus触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
cmus Music Player 是什么?
AI skill to launch cmus in a Xubuntu terminal and enforce playback rules (single track vs shuffle folder). Robust against high latency and headless daemon en... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 130 次。
如何安装 cmus Music Player?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cmus」即可一键安装,无需额外配置。
cmus Music Player 是免费的吗?
是的,cmus Music Player 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
cmus Music Player 支持哪些平台?
cmus Music Player 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 cmus Music Player?
由 nhathuynguyen19(@nhathuynguyen19)开发并维护,当前版本 v1.0.1。