Turn your osu!lazer beatmap library into a terminal music player or a local music server for clients such as Kopuz.
- Node.js
20+ - An osu!lazer install with beatmaps available locally
mpvavailable on yourPATHfor the terminal player (not required for API or playlist export modes)
If you're developing locally, Realm's native bindings are still the one awkward part of this stack. Use the repo's setup script so Bun install and the Realm repair step happen in the right order.
npm install -g osu-playOr run it without a global install:
npx osu-play# Launch the TUI player
osu-play
# Export a playlist file
osu-play --exportPlaylist playlist.txt
# Loop the playlist
osu-play --loop
# Start in shuffle mode
osu-play --shuffle
# Serve your library to Kopuz and other compatible clients
osu-play --apiUp/Downorj/k: Move through the playlistLeft/Rightorh/l: Seek backward or forward by 5 secondsEnter: Play the selected trackSpace: Pause or resume playbacko: Reveal the selected track in the native file managern/p: Next or previous trackPageUp/PageDown: Jump faster through the playlistx: Toggle shuffle moder: Toggle loopings: Stop playbackq: Quit/: Enter search mode- Type in search mode: Filter tracks by title
Up/DownorCtrl+P/Ctrl+Nin search mode: Navigate matching tracksCtrl+Win search mode: Delete the previous wordBackspace: Edit the search queryEnterin search mode: Play the selected match, leave search entry, and keep the filterEsc: Leave search mode, or clear the current query outside search mode
osu!play 1.4 adds a localhost music-provider mode that makes your existing beatmap library available inside Kopuz—with album grouping, beatmap backgrounds as artwork, original-quality streaming, and no separate library import.
Start the provider:
osu-play --apiThe server listens only on http://127.0.0.1:4533. In Kopuz:
- Add a media server and choose Custom (manual API).
- Enter
http://127.0.0.1:4533as the server URL. - Enter any non-empty username and password.
The provider exposes each osu! beatmap set as an album, streams the original audio files, and uses beatmap backgrounds as cover art. It is intentionally read-only: favorites and playlists are shown as empty and remote mutations are not supported. Changes to the osu!lazer library are picked up the next time Kopuz starts a library sync.
Use a different local port if needed:
osu-play --api --apiPort 5533The API binds only to localhost and is not intended for LAN or internet exposure.
import { getLazerDB, getRealmDBPath } from "osu-play";
const realmPath = getRealmDBPath({ osuDataDir: "/path/to/osu" });
const db = await getLazerDB(realmPath);--api: Run the localhost Subsonic-compatible provider instead of the TUI--apiPort: Provider port (default:4533)--reload, -r: Deprecated and ignored--exportPlaylist: Export the discovered track paths to a file instead of launching the TUI--osuDataDir, -d: Override the osu!lazer data directory--configDir, -c: Deprecated and ignored--loop, -l: Restart from the beginning when playback reaches the end--shuffle, -s: Play the playlist in shuffled order--help, -h: Show help
Bun 1.3+ is required only for development and contributing; it is not needed to run the published CLI via npm install -g or npx osu-play.
bun run setup
bun run dev
bun run checkUseful day-to-day commands:
bun run dev
bun run dev -- --loop
bun run dev -- --exportPlaylist playlist.txt
bun run test
bun run packageIf you hit a Realm native-binding error like realm.node missing or Node failing to load Realm:
bun install
bun run repair:realmIf osu-play fails with an mpv startup or IPC error, make sure mpv is installed and available on your shell PATH.
bun run package builds the distributable files and creates a local npm tarball with bun pm pack.
osu-play now reads osu!lazer's live client.realm directly in read-only mode instead of copying it into a separate app directory.
Standalone Bun executables are intentionally not part of the release flow right now. The current Realm dependency uses native bindings, and Bun's standalone executable support does not yet cover that path cleanly enough for this app.
MIT