[ Languages: English | 日本語 (Japanese) ]
ContextDJ - AI Music Curator. It turns your vague requests (e.g., "Play music that fits the mood of a walk by the sea. I want to listen to piano jazz from 11 PM.") into a perfectly curated scheduling of tracks.
Unlike standard shuffle or playlists, ContextDJ builds a context-aware schedule, mimicking a radio DJ that understands the flow of time and mood.
🌐 Try it now: contextdj.remoteroom.jp
(Screenshot: Inputting a request)
(Screenshot: Main player interface with AI-generated queue)
- 📸 Context Vision: Use your camera to "show" the DJ your environment. The AI analyzes visual context, artistic mood/lighting to suggest perfect soundtracks.
- ♻️ Context Recall: Instantly re-summon past moods. Clicking archived schedule items lets you remix and reuse previous contexts.
- ✨ DJ Insight: Real-time visibility into the AI's creative "train of thought," explaining why each track and transition was chosen.
- 🎯 AI Filtering: An automated verification layer that ensures Spotify search results genuinely match your complex requests.
- 🥣 Auto-Refill (Okawari): An intelligent, endless loop that automatically generates new schedule items before the music stops.
- 🔒 Privacy First (BYOK): Direct client-to-service communication. Your API keys (Spotify, OpenAI, Gemini) never leave your browser.
To use ContextDJ (even the hosted version), you need:
- Spotify Premium Account: Required for the Web API playback controls.
- Spotify Client ID: Create an application in the Spotify Developer Dashboard.
- APIs used: Make sure to check and enable
Web API(⚠️ Omitting this will cause track search and playback to fail withQUOTA_EXCEEDEDor authorization errors). - Redirect URIs: Add the appropriate URI(s) based on your usage (you can register multiple URIs and share a single Client ID between Web and CLI):
- Web Hosted:
https://contextdj.remoteroom.jp/ - CLI / Terminal:
http://127.0.0.1:8888/callback - Local Web Dev:
http://127.0.0.1:3000/
- Web Hosted:
- APIs used: Make sure to check and enable
- AI API Key: key from either OpenAI or Google AI Studio.
- Go to ContextDJ.

- Click the Settings (⚙️) icon in the top right.

- Enter your Spotify Client ID.
- Enter your AI API Key (OpenAI or Gemini).
- Click Save Configuration.
- Return to the home page, type a prompt (e.g., "Bright jazz for the afternoon, and winter a cappella for the night"), and hit Send!
If you want to run ContextDJ locally or contribute:
-
Clone the repository
git clone https://github.com/mah-jp/context-dj.git cd context-dj -
Install dependencies
npm install # or yarn install -
Run the development server
npm run dev
-
Open http://127.0.0.1:3000 with your browser.
A terminal-native CUI (TUI) dashboard is built into ContextDJ, allowing you to control playback and interact with the AI curator directly from your terminal. It provides real-time ASCII visualization of the playback schedule, currently playing track, DJ thoughts, and an interactive prompt.
# Install dependencies (first time only)
npm install
# Launch interactive TUI dashboard
npm run cli
# Launch and submit an initial music request directly
npm run cli -- "Chill beats for late night coding"
# Run interactive setup wizard
npm run cli -- setup- On first run,
npm run clidisplays an authorization URL in your terminal. - Open the URL in your local browser and approve the request.
- Copy the redirected URL (
http://127.0.0.1:8888/callback?code=...) from your browser's address bar and paste it into the terminal. - The obtained
refresh_tokenis saved in~/.config/context-dj/config.jsonand refreshed silently in the background.
Important
Spotify Client ID Tips:
- Ensure
Web APIis enabled when creating your Spotify App (omitting it prevents track searches and playback controls from working). - You can reuse your existing Web Client ID by simply adding
http://127.0.0.1:8888/callbackto the Redirect URIs under your app's Settings.
- Request Input:
Enter: Submit music request to trigger AI schedule curation and playback.↑/↓: Navigate request history. Automatically restores unsaved draft inputs when returning to the bottom (persisted to~/.config/context-dj/history.json).
- Quick Playback Controls (when input prompt is empty):
Space: Play / Pause togglen: Skip to next trackp: Go to previous trackqorCtrl+C: Quit
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: CSS Modules (Custom Dark Theme)
- State Management: React Context API
- APIs:
- Spotify Web API
- OpenAI API / Google Gemini API
ContextDJ is a client-side application.
- We allow you to input your sensitive API keys only to communicate directly with the respective services (Spotify, OpenAI, Google) from your browser.
- No data is sent to our servers. All configuration is persisted in your browser's
localStorage.
This project is licensed under the MIT License - see the LICENSE file for details.
