[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79471":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":16,"starSnapshotCount":16,"syncStatus":13,"lastSyncTime":42,"discoverSource":43},79471,"coding-with-beat","jaychempan\u002Fcoding-with-beat","jaychempan","🎵 将音乐搬进AI终端 · 打造Coding专属智能DJ · 听歌新范式 · 交互式音乐 ｜A retro pixel DJ for Claude Code \u002F Codex CLI \u002F Terminal with Apple Music \u002F QQ Music \u002F Local Music — plays music, shows synced lyrics, and 😱 panics when your tests fail. ","https:\u002F\u002Fcodebeat.top\u002F",null,"Python",112,2,79,4,0,34,44.83,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"anthropic","apple-music","claude-code","cli","karaoke","llm","lofi","lyrics","macos","mcp","music-player","python","statusline","terminal","tui","2026-06-12 04:01:24","\u003Cdiv align=\"center\">\n  \u003Cimg src=\"assets\u002Flogo_icon.png\" width=\"128\" alt=\"Coding with Beat\"\u002F>\n  \u003Ch1>Coding with Beat\u003C\u002Fh1>\n  \u003Cp>将音乐搬进AI终端 · 打造Coding专属智能DJ · 听歌新范式 · 交互式音乐\u003C\u002Fp>\n\u003C\u002Fdiv>\n\n![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.10+-3776AB?style=flat-square&logo=python&logoColor=white)\n![Platform](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-macOS-000000?style=flat-square&logo=apple&logoColor=white)\n![Claude Code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FClaude_Code-compatible-c85f41?style=flat-square)\n![Codex CLI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCodex_CLI-compatible-10a37f?style=flat-square)\n![MCP](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-38_tools-7c5cbf?style=flat-square)\n![Apple Music](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FApple_Music-supported-FC3C44?style=flat-square)\n![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green?style=flat-square)\n[![Website](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fwebsite-codebeat.top-9bbc0f?style=flat-square)](https:\u002F\u002Fcodebeat.top)\n[![Technical Report](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTechnical_Report-coming_soon-8b5cf6?style=flat-square)](#)\n\n> **When was the last time you sang and danced while vibecoding?**（上次 vibecoding 时又唱又跳是什么时候？）\n>\n> Right. You can't remember.（对，你已经不记得了。）\n\n![](assets\u002Fwelcome_log.png)\n\n**Your coding soundtrack, now inside the terminal.** Smart music selection, mood-aware playback, and a pixel DJ that vibes with every keystroke — works with Claude Code, Codex CLI, and any AI-powered terminal.\n\nA retro pixel DJ companion for AI coding sessions. It plays music, shows lyrics, celebrates when you commit, and panics with you when tests fail.\n\n[中文文档](README_CN.md) ／ [日本語](README_JP.md)\n\n\u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fc51dcac1-115e-4d30-b87f-b1e7043d1347\" controls autoplay loop muted width=\"100%\">\u003C\u002Fvideo>\n\n![](assets\u002Fdemo_2.png)\n\n\u003Cdetails>\n\u003Csummary>More screenshots\u003C\u002Fsummary>\n\n![](assets\u002Fdemo_1.png)\n\n![](assets\u002Fdemo.png)\n\n\u003C\u002Fdetails>\n\n> 💬 **We'd love your feedback!**\n> Using Coding with Beat? Tell us what you think — features you want, bugs you've hit, or just how it's changed your coding sessions.\n> **[→ Take the 7-min survey](https:\u002F\u002Fcodebeat.top\u002Fsurvey\u002F)** (EN \u002F 中文 both supported)\n\n---\n\n## Features\n\n- **MCP server** — 38 tools so you can tell your AI \"play some lofi\", \"skip this\", \"what's playing\" and it just works.\n- **`\u002Fcwb` skill** — Auto-registered routing brain: mood\u002Fvibe → multi-angle smart search, specific song\u002Fartist → catalog lookup, \"play 3\" → `play_number`. The AI always calls the right tool.\n\n  | Scene | Say… |\n  |-------|------|\n  | 🎧 Lofi | lofi · 深夜写代码 · chillhop |\n  | 🧠 Focus | 专注 · ambient · flow state |\n  | 🔥 Hype | workout · 充能 · 运动 |\n  | ☕ Jazz | jazz · 咖啡馆 · bossa nova |\n  | 🌆 Synthwave | synthwave · 赛博 · 夜驾 |\n  | 🌅 Relax | 放松 · unwind · 下班 |\n  | 🎹 Classical | 古典 · 钢琴 · classical |\n  | 💙 Sad | 伤感 · heartbreak · 难过 |\n  | 🎉 Party | party · edm · 蹦迪 |\n  | 🏮 Chinese | 国风 · 华语 · 古风 |\n  | 🌙 Sleep | 助眠 · sleep · 白噪音 |\n- **Playlists** — List and play your Apple Music playlists (user-created + subscription) directly from the AI: \"我有哪些歌单\" → numbered list → \"播放周杰伦代表作\". Queue syncs to `cwb watch` automatically.\n- **Play history** — `cwb history` \u002F `list_history` shows your recently played tracks sourced from Apple Music's native played date. `history_search` recommends new music based on your listening patterns.\n- **Music sources** — Apple Music (AppleScript, no GUI needed), local files (afplay), QQ Music (search + preview).\n- **Pixel UI** — Album art in half-block ANSI, GameBoy retro border, pseudo-spectrum equalizer.\n- **DJ Buddy** — A headphones-wearing pixel character that reacts to your coding state. Tests failing? It panics with you.\n- **Vibe engine** — CC hooks track what you're doing in real time and shift the mood. `git commit`? Victory pose. Tests explode? Panic mode.\n- **Statusline** — One line: face + current track + progress bar.\n- **Focus mode** — Built-in 25\u002F5 Pomodoro timer shown in the statusline.\n\n---\n\n## Installation\n\n### Claude Code\n\n```bash\ncurl -LsSf https:\u002F\u002Fraw.githubusercontent.com\u002Fjaychempan\u002Fcoding-with-beat\u002Fmain\u002Fbootstrap.sh | sh\n```\n\nOr manually:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fjaychempan\u002Fcoding-with-beat.git\ncd coding-with-beat\n.\u002Finstall.sh\n```\n\nThe installer configures Claude Code to use the HTTP MCP endpoint at `http:\u002F\u002F127.0.0.1:8765\u002Fmcp`, saves that URL to `~\u002F.coding-with-beat\u002Fmcp-url`, and on macOS starts a user LaunchAgent for the local MCP server.\n\nOpen a new shell and a new Claude Code session. When `(•_•)` appears in the statusline, you're good.\n\n### Codex CLI\n\n```bash\ncurl -LsSf https:\u002F\u002Fraw.githubusercontent.com\u002Fjaychempan\u002Fcoding-with-beat\u002Fmain\u002Fbootstrap_codex.sh | sh\n```\n\nOr manually:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fjaychempan\u002Fcoding-with-beat.git\ncd coding-with-beat\n.\u002Finstall_codex.sh\n```\n\nInstalls Codex CLI if needed, configures `~\u002F.codex\u002Fconfig.toml` with the MCP endpoint, writes hooks, and installs the `cwb` skill so Codex recognises music commands automatically. Proxy is auto-detected. Re-running is safe — already-completed steps are skipped automatically.\n\nSee **[README_CODEX.md](README_CODEX.md)** for the full integration guide — hooks, proxy, mood reactions, statusline alternatives, and debugging.\n\n---\n\n## Usage\n\n> [!TIP]\n> **Not sure what to say?** Just ask — `DJ 能做什么` \u002F `DJ help` — and DJ Buddy will show you a full list of phrases you can use.\n>\n> **Live player:** Open a second terminal and run `cwb watch` to see the currently playing track, lyrics, and progress bar in real time.\n>\n> **Apple Music:** The first time you play a catalog track, a popup will appear — click **Add to Library**, then repeat the play command.\n\n### Just talk to your AI assistant\n\n```\nplay some lofi\nskip this track\nwhat's playing\npause\nrecommend something based on my history  # history_search — analyzes your patterns, suggests new tracks\nshow my recently played tracks           # list_history — reads Apple Music's native play log\n基于我的历史推荐一些歌曲                    # same, in Chinese\n```\n\n`history_search` looks at your top artists, listening style, and tracks you haven't heard in a while, then runs a smart multi-angle search. Pick a number to play.\n\n### `\u002Fcwb` command\n\n```\n\u002Fcwb play \"lofi beats\"    # search and play\n\u002Fcwb play lofi beats\n\u002Fcwb search \"lofi beats\"  # search library + Apple Music, show numbered list\n\u002Fcwb play 2               # play track #2 from last search \u002F list results\n\u002Fcwb list                 # list all library tracks\n\u002Fcwb loved                # list loved\u002Fhearted tracks\n\u002Fcwb playlists            # list all playlists (user + subscription)\n\u002Fcwb play_playlist \u003Cname> # play a playlist by name\n\u002Fcwb history [n]          # recently played tracks\n\u002Fcwb next\n\u002Fcwb pause\n\u002Fcwb np                   # now playing\n\u002Fcwb like\n\u002Fcwb volume 70\n\u002Fcwb watch                # live player (q to quit)\n\u002Fcwb karaoke              # full-screen karaoke (q to quit)\n\u002Fcwb lyrics               # lyrics window\n\u002Fcwb bar auto             # statusline: auto \u002F show \u002F hide\n```\n\nNatural-language commands work too: `skip this track`, `pause`, `what's playing`, and `like this` are all valid.\n\n### `watch` \u002F `karaoke` shortcuts\n\n| Key | Action |\n|-----|--------|\n| `Space` | Play \u002F pause |\n| `n` | Next |\n| `p` | Previous |\n| `l` | Like |\n| `0-9` | Type a track number + `Enter` to jump to it |\n| `q` | Quit |\n\n---\n\n## Statusline\n\nOnce installed, a statusline appears at the bottom of Claude Code:\n\n```\n(•_•) ⚡  ▶ Midnight City — M83  ██████░░░░░░░░  [build]  ▃▆█▆▃  │ ♪ lyric preview\n```\n\n| Element | Example | Description |\n|---------|---------|-------------|\n| DJ face | `(•_•)` `(^_^)` `(T_T)` | Buddy's mood, shifts with coding events |\n| Activity | `⚡` \u002F `·` \u002F _(none)_ | `⚡` = tool call in last 15 s; `·` = last 90 s |\n| Play icon | `▶` \u002F `▷` \u002F `❚❚` | Blinks while playing; ❚❚ when paused |\n| Track | `Midnight City — M83  ██████░░░░░░░░` | Title + artist + progress bar |\n| Vibe | `[build]` `[focus]` etc. | Current coding vibe |\n| Pomodoro | `🍅 work 24:15` | Only shown when focus mode is active |\n| Beat wave | `▁▂▃▄▅` | Rises and falls each beat; dims when paused |\n| Lyrics | `│ ♪ lyrics here` | Current LRC lyric |\n\n\u003Cdetails>\n\u003Csummary>Little easter egg: show it anywhere\u003C\u002Fsummary>\n\n`cwb statusline` is the same renderer Claude Code uses. It reads optional JSON from stdin, uses `columns` as a width hint, and prints one compact status bar line to stdout.\n\n```bash\nprintf '{\"columns\":120}' | cwb statusline\n```\n\nThat makes it easy to plug into other status bars. For example, tmux can show CWB on the right side of its status bar:\n\n#### tmux status-right\n\n```tmux\nset -g status-right-length 180\nset -g status-interval 1\nset -g status-right '#(printf \"{\\\"columns\\\":170}\" | cwb statusline | perl -pe \"s\u002F\\e\\[[0-9;]*m\u002F\u002Fg\")'\n```\n\n`cwb statusline` currently emits ANSI-coloured terminal text. The `perl` bit strips ANSI escape codes because tmux status formats use their own styling syntax. Increase or decrease `columns` and `status-right-length` to control how much room lyrics get.\n\n#### Neovim statusline\n\nNeovim can also show CWB in its statusline. Keep the shell call asynchronous so editing never waits on music state:\n\n```lua\nlocal cwb = { text = \"\", running = false }\n\nlocal function strip_ansi(text)\n  return text:gsub(\"\\27%[[0-9;]*m\", \"\")\nend\n\nlocal function refresh()\n  if cwb.running or vim.fn.executable(\"cwb\") == 0 then\n    return\n  end\n  cwb.running = true\n  vim.system({ \"cwb\", \"statusline\" }, {\n    text = true,\n    stdin = vim.json.encode({ columns = 90 }),\n  }, function(result)\n    vim.schedule(function()\n      cwb.running = false\n      if result.code == 0 and result.stdout then\n        cwb.text = vim.trim(strip_ansi(result.stdout)):gsub(\"%%\", \"%%%%\")\n        vim.cmd.redrawstatus()\n      end\n    end)\n  end)\nend\n\n_G.cwb = cwb\nvim.fn.timer_start(1000, refresh, { [\"repeat\"] = -1 })\nrefresh()\nvim.o.statusline = \"%f %m%r %= %{v:lua.cwb.text}\"\n```\n\n\u003C\u002Fdetails>\n\n---\n\n## SSH Remote (Claude Code \u002F Codex CLI on a server)\n\nIf your AI CLI runs on a remote server while Apple Music runs on your local Mac, run the streamable HTTP MCP server on the Mac and reach it from the server through SSH reverse port forwarding:\n\n```bash\n# Local Mac: install and start the HTTP MCP LaunchAgent\n.\u002Finstall.sh          # for Claude Code\n.\u002Finstall_codex.sh    # for Codex CLI\n\n# Local Mac: expose it to the server's 127.0.0.1:8765\nssh -N -R 127.0.0.1:8765:127.0.0.1:8765 user@server\n\n# Server: install hooks\u002Fstatusline and point them at the forwarded endpoint\n.\u002Finstall.sh --mcp-url http:\u002F\u002F127.0.0.1:8765\u002Fmcp          # Claude Code\n.\u002Finstall_codex.sh --mcp-url http:\u002F\u002F127.0.0.1:8765\u002Fmcp    # Codex CLI\n```\n\nThe remote session, `\u002Fcwb`, statusline, hooks, and `cwb` CLI all use the same HTTP MCP URL. As long as the SSH tunnel is up, commands like `cwb play`, `cwb np`, `cwb next`, `cwb player`, and `cwb karaoke` control the Mac-side music client.\n\n---\n\n## CLI\n\n```\ncwb play [query]        # search and play, or resume\ncwb play \u003Cn>            # play track #n from last search or list results\ncwb search \u003Cquery>      # search library + Apple Music catalog (numbered list)\ncwb list [n]            # list all library tracks (default 100)\ncwb loved [n]           # list loved\u002Fhearted tracks (default 50)\ncwb playlists           # list all playlists (user + subscription)\ncwb play_playlist \u003Cname> # play a playlist by name\ncwb pause               # pause\ncwb next                # next track\ncwb prev                # previous track\ncwb np                  # now playing\ncwb like                # like current track\ncwb volume \u003C0-100>      # set volume\ncwb seek \u003Ct>            # seek: seconds (90) or mm:ss (1:30)\ncwb mode \u003Cmode>         # shuffle | sequential | repeat | repeat_one\ncwb player              # full pixel player\ncwb watch               # live TUI (q to quit)\ncwb karaoke             # full-screen karaoke (q to quit)\ncwb lyrics              # lyrics window\ncwb history [n]         # last n played tracks\ncwb bar \u003Cshow|hide|auto> # statusline visibility\ncwb statusline          # render one compact statusline frame\ncwb status              # current state\ncwb server              # MCP streamable HTTP server\n```\n\n---\n\n## Music sources\n\n| Feature | Apple Music | Local files | QQ Music |\n|---------|-------------|-------------|----------|\n| Now playing info | ✓ | ✓ | ⚠ preview only |\n| Play \u002F pause | ✓ | ✓ | ✓ |\n| Next \u002F prev | ✓ | ✓ | ✓ |\n| Seek | ✓ | ⚠ restart-based | ⚠ preview only |\n| Volume | ✓ | ✓ | ⚠ coarse steps |\n| Like \u002F favorite | ✓ | ✗ | ✓ |\n| Cover art | ✓ | ✓ | ✓ |\n| Full playback | ✓ subscription req. | ✓ | ✗ 30 s preview |\n| Play modes | ✓ | ✗ | ✓ |\n| Playlists | ✓ | ✗ | ✗ |\n| Play history | ✓ native | ✓ log-based | ✓ log-based |\n\n> QQ Music has no official API. Search metadata comes from public endpoints; audio is played as 30-second preview clips via afplay. Full tracks require the QQ Music desktop app.\n\n---\n\n## Uninstall\n\n```bash\n# Claude Code\n.\u002Funinstall.sh           # remove config, commands, PATH\n.\u002Funinstall.sh --purge   # same + delete ~\u002F.coding-with-beat\u002F\n\n# Codex CLI\n.\u002Funinstall_codex.sh           # remove Codex config, skill, LaunchAgent\n.\u002Funinstall_codex.sh --purge   # same + delete ~\u002F.coding-with-beat\u002F\n```\n\n---\n\n## Citation\n\nIf you use Coding with Beat in your research or project, please cite:\n\n```bibtex\n@misc{pan2025codingwithbeat,\n  author       = {Jiancheng Pan et al.},\n  title        = {Coding with Beat: Staying in Flow with Context-Aware Music in AI Coding Sessions},\n  year         = {2026},\n  howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fjaychempan\u002Fcoding-with-beat}},\n  note         = {Website: \\url{https:\u002F\u002Fcodebeat.top}}\n}\n```\n\n---\n\n## Star History\n\n\u003Ca href=\"https:\u002F\u002Fwww.star-history.com\u002F?repos=jaychempan%2Fcoding-with-beat&type=date&legend=top-left\">\n \u003Cpicture>\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fchart?repos=jaychempan\u002Fcoding-with-beat&type=date&theme=dark&legend=top-left\" \u002F>\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Fapi.star-history.com\u002Fchart?repos=jaychempan\u002Fcoding-with-beat&type=date&legend=top-left\" \u002F>\n   \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fchart?repos=jaychempan\u002Fcoding-with-beat&type=date&legend=top-left\" \u002F>\n \u003C\u002Fpicture>\n\u003C\u002Fa>\n\n---\n\n## License\n\nMIT License — see [LICENSE](LICENSE) for details.\n","Coding with Beat 是一个将音乐融入AI终端的项目，旨在为编码者提供专属的智能DJ体验。它使用Python开发，支持Apple Music、QQ音乐以及本地音乐播放，并能显示同步歌词，同时根据代码测试结果给出反馈，如测试失败时会触发特殊反应。项目通过MCP服务器集成38种工具，实现语音控制音乐播放等功能，还具备根据心情或场景智能选择音乐的能力。适用于希望在编程过程中享受个性化背景音乐的开发者，特别是在长时间编码或需要集中注意力的工作环境中，能够显著提升用户体验。","2026-06-11 03:58:05","CREATED_QUERY"]