somafm-cli

module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT

README

SomaFM CLI

CI Release

A terminal-based music player for SomaFM radio stations built in Go.

Demo

Features

  • Stream all SomaFM radio stations
  • Rich terminal UI with station browser
  • Volume control with visual feedback
  • Pause/resume playback
  • Stations sorted by listener count
  • Favorites management
  • Persistent configuration (volume, favorites, last station)
  • Customizable color themes
  • Automatic retry on stream failure

Installation

macOS
brew install glebovdev/tap/somafm
Windows
scoop bucket add glebovdev https://github.com/glebovdev/scoop-bucket
scoop install somafm

Or download somafm_*_windows_amd64.zip from the Releases page.

Go Install
go install github.com/glebovdev/somafm-cli/cmd/somafm@latest

Usage

somafm              # Start the player
somafm --random     # Start with a random station
somafm --version    # Show version information
somafm --debug      # Enable debug logging
somafm --help       # Show help and config file path

Keyboard Shortcuts

Key Action
Navigate list
Enter Play selected station
Space Pause / Resume
< > Previous / Next station
r Random station
or + - Volume up / down
m Mute / Unmute
f Toggle favorite
? Show help
a About
q Esc Quit

Configuration

Configuration is saved automatically to ~/.config/somafm/config.yml.

volume: 70                    # Volume level (0-100)
buffer_seconds: 5             # Audio buffer size (0-60 seconds)
last_station: groovesalad     # Last played station ID
autostart: false              # Auto-play last station on launch (true/false)
favorites:                    # List of favorite station IDs
  - groovesalad
  - dronezone
theme:                        # Color customization
  background: "#1a1b25"
  foreground: "#a3aacb"
  borders: "#40445b"
  highlight: "#ff9d65"

Settings are saved when you adjust volume, select a station, or toggle favorites.

Theme Options

Colors support names (white, red, darkcyan), hex codes (#ff0000), or default for terminal colors.

Available theme properties:

Property Description
background Main background color
foreground Text color
borders Border color
highlight Selection highlight
muted_volume Volume bar color when muted
header_background Header section background
help_background Help panel background
help_foreground Help panel text
help_hotkey Hotkey highlight color
modal_background Modal dialog background

Built With

  • tview - Terminal UI framework
  • tcell - Terminal cell management
  • beep - Audio playback
  • resty - HTTP client
  • zerolog - Structured logging

About SomaFM

SomaFM is listener-supported, commercial-free internet radio. If you enjoy their stations, please consider supporting them.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Directories

Path Synopsis
cmd
somafm command
internal
api
Package api provides the HTTP client for the SomaFM API.
Package api provides the HTTP client for the SomaFM API.
cache
Package cache provides image caching functionality for station logos.
Package cache provides image caching functionality for station logos.
service
Package service provides the business logic layer for managing station data.
Package service provides the business logic layer for managing station data.
station
Package station defines the data structures for SomaFM radio stations.
Package station defines the data structures for SomaFM radio stations.
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL