lxmusic-skill
imlishiyuan/lxmusic-skill
一个 [Agent Skill](https://agentskills.io/),让 agent(Claude Code、Codex 等)能够与 [LX Music(洛雪音乐)](https://lxmusic.toside.cn/) 进行交互。通过自然语言即可控制播放、搜索歌曲、管理歌单等。
Instalação
npx convez-ai imlishiyuan/lxmusic-skill1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
README
A tradução para o português deste README ainda está na fila.
🎵 LX Music Agent Skill
An Agent Skill that enables AI coding assistants (Claude Code, Codex, and others) to interact with LX Music — a free, open-source desktop music player. Control playback, search songs, manage playlists, and more — all through natural language.
Features
- Playback Control — play, pause, skip, seek, volume, mute
- Player Status — get current song info, progress, lyrics, volume level, favorite status
- Real-time Monitoring — subscribe to playback state changes via Server-Sent Events
- Music Search — search songs by keywords, optionally scoped to a specific source platform
- Playlist Operations — open and play playlists from any supported music source
- Lyrics Retrieval — fetch LRC lyrics, translations, romaji, and word-level lyrics
- Custom Source Development — guidance for writing custom music source scripts via the
globalThis.lxJavaScript API - Smart Launch — detect if LX Music isn't running and launch it with appropriate startup parameters
Prerequisites
- LX Music desktop app v2.7.0 or later
- Open API enabled: Settings → Open API → Enable
curlandpython3available on your system (the helper script uses Python for correct UTF-8 URL encoding)
Installation
Clone into your agent's skills directory:
# For Claude Code
git clone https://github.com/imlishiyuan/lxmusic-skill.git ~/.claude/skills/lxmusic-skill
# Or as a project-local skill
git clone https://github.com/imlishiyuan/lxmusic-skill.git ./your-project/.claude/skills/lxmusic-skill
Quick Start
Once installed, just talk to your AI assistant in plain language:
"What's playing right now?"
"Pause the music."
"Search for Jay Chou songs on NetEase."
"Set volume to 60%."
"Favorite this song."
"Show me the lyrics."
"Where does LX Music store its data?"
"Help me write a custom music source for XYZ platform."
The assistant uses this skill to call LX Music's local HTTP API and scheme URLs to fulfill your request.
Helper Script
A bash script is included for direct terminal use:
# Status & lyrics
bash scripts/lxmusic.sh status text # Human-readable now-playing
bash scripts/lxmusic.sh lyric # Current lyrics (LRC)
bash scripts/lxmusic.sh lyric-all # All lyric types (JSON)
# Playback control
bash scripts/lxmusic.sh play # Resume
bash scripts/lxmusic.sh pause # Pause
bash scripts/lxmusic.sh toggle # Toggle play/pause
bash scripts/lxmusic.sh next # Skip to next
bash scripts/lxmusic.sh prev # Skip to previous
bash scripts/lxmusic.sh seek 30 # Seek to 30 seconds
bash scripts/lxmusic.sh volume 80 # Set volume to 80%
# Collection
bash scripts/lxmusic.sh collect # Favorite current song
bash scripts/lxmusic.sh uncollect # Unfavorite current song
# Launch & search
bash scripts/lxmusic.sh launch # Launch and wait for API
bash scripts/lxmusic.sh launch '-search=周杰伦' # Launch and search
bash scripts/lxmusic.sh launch '-play=type=songList&source=myList&name=Default'
# Scheme URL generation
bash scripts/lxmusic.sh scheme-search "keyword" kw
bash scripts/lxmusic.sh scheme-search-play "Song - Artist"
bash scripts/lxmusic.sh scheme-open-playlist kw 12345
# Custom port
bash scripts/lxmusic.sh -p 23331 status
Structure
lxmusic-skill/
├── SKILL.md # Main skill: metadata + agent instructions
├── scripts/
│ └── lxmusic.sh # Bash helper: API calls + scheme URL generation
├── references/
│ ├── open-api.md # HTTP REST API endpoints reference
│ ├── scheme-url.md # lxmusic:// protocol reference
│ ├── custom-source.md # Custom music source development guide
│ ├── run-params.md # Startup parameters reference
│ └── datapath.md # Data storage paths reference
└── README.md
How It Works
The skill follows the Agent Skills specification with progressive disclosure:
- Metadata (~100 tokens) — name and description loaded at startup
- Instructions (~500 lines) —
SKILL.mdloaded when the skill activates - References (on-demand) — detailed API docs loaded only when needed
API Coverage
| Category | Mechanism | Endpoint |
|---|---|---|
| Status | HTTP GET | /status, /lyric, /lyric-all |
| Real-time | SSE | /subscribe-player-status |
| Playback | HTTP GET | /play, /pause, /skip-next, /skip-prev, /seek, /volume, /mute |
| Collection | HTTP GET | /collect, /uncollect |
| Search & Play | Scheme URL | lxmusic://music/search/*, lxmusic://music/searchPlay/* |
| Playlist | Scheme URL | lxmusic://songlist/open/*, lxmusic://songlist/play/* |
| Player actions | Scheme URL | lxmusic://player/play, /pause, /togglePlay, /skipNext, /skipPrev, /collect, /uncollect, /dislike |
Supported Music Sources
| Code | Platform |
|---|---|
kw | Kuwo |
kg | Kugou |
tx | Tencent (QQ Music) |
wy | NetEase (Wangyi) |
mg | Migu |
License
LX Music is a third-party open-source music player. This skill is an unofficial community project.