Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Make Sonic feel like a real terminal product, not a code sketch. Favor changes t
- expressive terminal UI and visualizers
- switchable curated themes with a persisted default
- SoundCloud and Mixcloud search
- direct YouTube, SoundCloud, and Mixcloud link playback
- direct YouTube, SoundCloud, Mixcloud, and Spotify link playback
- optional Spotify remote control through `spogo` (audio plays in a Spotify app, not mpv)

## Commands

Expand All @@ -32,6 +33,7 @@ System dependencies:

```bash
brew install yt-dlp mpv
brew install steipete/tap/spogo # optional, for Spotify
```

## File Map
Expand All @@ -40,6 +42,7 @@ brew install yt-dlp mpv
bin/sonic.js CLI state machine
lib/search.js search adapter
lib/player.js mpv controller
lib/spotify.js Spotify search and remote control via spogo
lib/channels.js content presets
lib/ui.js TUI rendering
lib/system.js system checks and safe URL opening
Expand Down
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<p align="center">
SONIC is a vibes-based CLI music player to join alongside your other terminal tabs<br>
Supports YouTube, Mixcloud, and Soundcloud as of now.
Supports YouTube, SoundCloud, Mixcloud, and Spotify.
</p>

<p align="center">
<img src="https://img.shields.io/badge/node-%3E%3D22-green?style=flat-square&logo=node.js" alt="Node">
<img src="https://img.shields.io/badge/license-MIT-yellow?style=flat-square" alt="License">
<img src="https://img.shields.io/badge/sources-3-purple?style=flat-square" alt="Sources">
<img src="https://img.shields.io/badge/sources-4-purple?style=flat-square" alt="Sources">
</p>

## Quick Start
Expand Down Expand Up @@ -58,6 +58,7 @@ sonic # open the picker
sonic "deep house" # search and play
sonic --soundcloud "liquid dnb" # search SoundCloud
sonic --mixcloud "techno mix" # search Mixcloud
sonic --spotify "daft punk" # search Spotify
sonic "https://youtu.be/..." # play a link (quote it)
sonic doctor # check setup
sonic --help # full help
Expand All @@ -71,6 +72,7 @@ sonic --help # full help
| `Space` | — | Pause / resume |
| `/` | Search | Search (stops playback) |
| `j` `k` / arrows | Move through lists | — |
| `1`–`0` | Quick pick a vibe | — |
| `Tab` / `Left` `Right` | Switch tabs | — |
| `n` / `p` | — | Next / previous track |
| `f` | Open favorites | Favorite track |
Expand All @@ -97,11 +99,28 @@ Five modes: **Bars**, **Tape**, **Wave**, **Rain**, **Flame**. Press `v` during

## Sources

YouTube, SoundCloud, and Mixcloud. All use `mpv` for playback and require no auth. Press `m` to cycle.
YouTube, SoundCloud, and Mixcloud play through `mpv` and need no account. Press `m` to cycle. Live streams show a **LIVE** badge instead of a fake length.

### Spotify

Spotify is optional. Sonic acts as a remote: audio plays in a Spotify app (desktop, phone, or web player), and Sonic searches, starts, skips, seeks, and shows what is playing.

```bash
brew install steipete/tap/spogo # Spotify CLI that Sonic drives
# log in at https://open.spotify.com in Chrome, then:
spogo auth import --browser chrome # one-time; copies your Spotify session cookies
sonic --spotify "daft punk"
```

- **Vibes and sessions** open Spotify playlists. **Search** finds tracks. Spotify links (`open.spotify.com/...` or `spotify:` URIs) play directly.
- **How auth works:** [spogo](https://github.com/steipete/spogo) uses your own Spotify web session cookies, stored locally. Sonic never sees or stores your password, and no developer app is needed.
- **Premium:** Spotify only allows remote playback control for Premium accounts. On macOS with the Spotify desktop app open, spogo can drive the app directly instead.
- Spotify shows up in the `m` cycle once `spogo` is installed. `sonic doctor` reports whether you are logged in.
- Unofficial: this uses Spotify's web player endpoints the same way your browser does. Use it with your own account.

## Requirements

**Node.js** 22+ &nbsp;&middot;&nbsp; **yt-dlp** &nbsp;&middot;&nbsp; **mpv** &nbsp;&middot;&nbsp; macOS or Linux
**Node.js** 22+ &nbsp;&middot;&nbsp; **yt-dlp** &nbsp;&middot;&nbsp; **mpv** &nbsp;&middot;&nbsp; macOS or Linux &nbsp;&middot;&nbsp; optional: **spogo** for Spotify

## Contributing

Expand Down
Binary file modified assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 28 additions & 29 deletions assets/demo.tape
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Sonic CLI Demo
# Run: vhs assets/demo.tape
# Run from the repo root: vhs assets/demo.tape
# Tip: set "volume": 0 in ~/.config/sonic/store.json while recording.

Output assets/demo.gif

Set Shell zsh
Set FontFamily "JetBrains Mono"
Set FontFamily "Menlo"
Set FontSize 15
Set Width 900
Set Height 550
Set Padding 16
Set Width 1000
Set Height 820
Set Padding 20
Set Framerate 15
Set TypingSpeed 50ms
Set Theme "Catppuccin Mocha"
Expand All @@ -23,42 +24,40 @@ Down
Sleep 400ms
Down
Sleep 400ms
Down
Sleep 400ms
Up
Sleep 500ms

# Switch tab and back
# Peek at sessions and back
Tab
Sleep 1s
Sleep 1.2s
Tab
Sleep 800ms

# Cycle themes
Type "t"
Sleep 1s
Type "t"
Sleep 1s

# Search
Type "/"
Sleep 500ms
Type "lofi chill beats"
Sleep 300ms
Enter
Sleep 4s
# Quick pick: synthwave
Type "8"
Sleep 8s

# Play first result
# Play the first mix
Enter
Sleep 8s
Sleep 10s

# Switch visualizer
# Visualizers
Type "v"
Sleep 3s
Sleep 2.5s
Type "v"
Sleep 2.5s
Type "v"
Sleep 2.5s
Type "v"
Sleep 3s
Sleep 2.5s

# Cycle theme during playback
# Themes
Type "t"
Sleep 2.5s
Sleep 2s
Type "t"
Sleep 2s
Type "v"
Sleep 2s

# Quit
Type "q"
Expand Down
Loading
Loading