Thank you for contributing to halpradio! Whether you are expanding the public station catalog, building new TUI features, or fixing bugs, this guide will help you get set up quickly.
- Go: Version
1.21or higher. - Git: For version control.
- Audio Player (Optional):
mpv,vlc, orffmpeginstalled on your system for testing multi-format audio streams (or use the built-in native Go player).
# Fork & clone the repository
git clone https://github.com/halpworld/halpradio.git
cd halpradio
# Run directly
go run main.go
# Run unit tests
go test ./...Expanding the catalog is the fastest way to contribute!
- Launch
halpradio(go run main.go). - Search or browse for a station (or press
ato create a custom station). - Select the station and press
p. - halpradio will generate the exact YAML snippet and copy it directly to your system clipboard!
- Open
stations.yamland paste your snippet in the appropriate genre section. - Commit your changes and open a Pull Request.
Add an entry to stations.yaml adhering to this schema:
stations:
- id: station-unique-id
name: "Station Name"
url: "https://stream.example.com/live.mp3"
genre: "Genre / Tags"
country: "US" # 2-letter ISO country code (e.g. US, GB, SE, DE, FR, JP)
bitrate: 128 # Stream bitrate in kbps (e.g. 128, 192, 320)
codec: "MP3" # MP3, AAC, OGG, etc.
homepage: "https://example.com"Important
- Verify stream URLs are publicly accessible over HTTP/HTTPS.
- Ensure 2-letter ISO country codes are valid uppercase strings (e.g.,
US,GB,DE,FR,JP,BR). - Keep genre tags concise (e.g.,
Lofi,Synthwave,Ambient,Jazz,Rock,Classical,News).
Read our Architecture Documentation to understand the Elm Architecture (Bubble Tea) used in halpradio:
pkg/ui/model.go: Global state.pkg/ui/update.go: Input and event handling.pkg/ui/view.go: Lipgloss frame rendering.pkg/ui/components/: Sub-views (Header, StationList, PlayerBar, Modals, WhichKey).pkg/player/player.go: Audio backends & ICY stream reader.
- Formatting: Always format your code with
gofmt -s -w .before committing. - Testing: Add or update unit tests in
pkg/*/*_test.gowhen adding new business logic. - No Unhandled Panic: Always return or log errors gracefully without calling
panic(). - Theme Token Usage: Do not hardcode HEX color strings in UI components; always use tokens from
pkg/theme/theme.go.
halpradio uses automated GitHub Actions workflows for continuous integration and multi-platform release distribution:
- Executes on every
pushandpull_requestagainst themainbranch. - Runs cross-platform matrix testing on Ubuntu and macOS runners.
- Verifies code formatting with
gofmt, executes static analysis withgo vet, and tests with race detection (go test -race). - Checks cross-compilation across
darwin/arm64,darwin/amd64,linux/amd64, andlinux/arm64.
- Triggered automatically on pushing a version tag (e.g.
git tag v1.0.0 && git push origin v1.0.0). - Cross-compiles standalone release binaries for:
- macOS Apple Silicon (
darwin_arm64) - macOS Intel (
darwin_amd64) - Linux x86_64 (
linux_amd64) - Linux ARM64 (
linux_arm64)
- macOS Apple Silicon (
- Packages tarballs, generates SHA256 checksums, and publishes GitHub Release assets.
- Automatically generates and publishes Homebrew Formula to
halpworld/homebrew-tap.
Before submitting your PR:
- Code compiles cleanly with
go build main.go. - All unit tests pass with
go test ./.... - Code is formatted with
gofmt -s -w .. - Documentation or comments are updated if changing CLI flags, configuration, or keybindings.
- PR title is descriptive (e.g.,
feat(ui): add visualizer wave modeorfix(player): resolve mpv process leak).
Thank you for making halpradio awesome! 🎧