A command-line utility for interacting with SqueezeBox players over the network.
pip install -e .piCorePlayer uses a minimal Linux distribution that may not have Python 3.11+ by default. Follow these steps to set up the environment:
-
First, connect to your piCorePlayer device via SSH:
ssh tc@YOUR_PI_IP_ADDRESS
-
Install Python 3.11 using piCore's package manager:
tce-load -wi python3.11
-
Ensure pip is installed:
tce-load -wi python3.11-pip
-
Install the squeeze package:
pip3 install git+https://github.com/wilson/squeeze.git
-
Make your changes persistent (so they survive reboots):
filetool.sh -b
Note: If you encounter issues with Python version availability, you have a few options:
- Use a virtual environment with a newer Python version
- Use Docker to run squeeze in a container
- For advanced users, you can modify the code to work with an earlier Python version (mainly by changing the type annotations and using
dictinstead ofdict[str, Any]format)
Squeeze can be configured using a configuration file at ~/.squeezerc in TOML format:
[server]
url = "http://your-squeezebox-server:9000"You can set the server URL using the command:
squeeze config --set-server "http://your-squeezebox-server:9000"Squeeze uses the SqueezeBox server's JSON-RPC API for clean and reliable communication.
squeeze playerssqueeze status [player_id]If no player ID is provided, the command will display an interactive selection menu to choose a player. All commands that require a player ID support this feature.
You can control the interactive behavior:
--interactive: Force interactive mode (default when player ID is not provided)--no-interactive: Disable interactive mode (will just list players if no ID provided)--live: Show continuously updated live status with keyboard controls
# Force interactive selection
squeeze status --interactive
# Just list players without interactive selection
squeeze status --no-interactive
# Live status mode with real-time updates and keyboard controls
squeeze status --liveThe --live flag activates an enhanced display mode with:
- Real-time status updates
- Rich, formatted terminal UI
- Keyboard controls for common playback functions
| Key | Action |
|---|---|
| ← (Left) / p | Previous track or restart track |
| → (Right) / n | Next track |
| ↑ (Up) / + | Volume up (5%) |
| ↓ (Down) / - | Volume down (5%) |
| v | Reset volume (special devices) |
| q | Quit live mode |
Notes:
- Left arrow/p will restart the current track if more than 5 seconds have elapsed, otherwise it will go to the previous track.
- Volume controls (Up/Down/+/-) will only work for devices that support server-controlled volume.
- The 'v' key is only shown for devices that may have external volume control.
Play:
squeeze play [player_id]Pause:
squeeze pause [player_id]Stop:
squeeze stop [player_id]Set volume:
squeeze volume <0-100> [player_id]Power on/off:
squeeze power on [player_id]
squeeze power off [player_id]Shuffle mode:
# Set a specific shuffle mode
squeeze shuffle off [player_id]
squeeze shuffle songs [player_id]
squeeze shuffle albums [player_id]
# Cycle through shuffle modes (off -> songs -> albums -> off)
squeeze shuffle [player_id]Repeat mode:
# Set a specific repeat mode
squeeze repeat off [player_id]
squeeze repeat one [player_id]
squeeze repeat all [player_id]
# Cycle through repeat modes (off -> all -> one -> off)
squeeze repeat [player_id]Now Playing screen:
# Activate the Now Playing screen (like pressing the 'Now Playing' button on the remote)
squeeze now [player_id]Remote control navigation:
# Arrow buttons
squeeze remote up [player_id]
squeeze remote down [player_id]
squeeze remote left [player_id]
squeeze remote right [player_id]
# Select/OK button
squeeze remote select [player_id]
# Browse music library
squeeze remote browse [player_id]Note: Square brackets [] indicate optional parameters. If omitted, you'll get an interactive player selection.
Search for music:
squeeze search "search term"
squeeze search --type artists "Beatles"
squeeze search --type albums "Abbey Road"
squeeze search --type tracks "Yesterday"Get server status:
squeeze serverThis project requires Python 3.11 or higher and has the following dependencies:
- tomli-w: For TOML file handling
- rich: For enhanced terminal UI in live status mode
- piCorePlayer is designed to be minimalist, so it may not have all dependencies by default
- Python packages installed with pip may not persist across reboots unless you run
filetool.sh -b - For performance reasons, consider setting up a lightweight caching mechanism if you're polling server status frequently
- Terminal capabilities may be limited, so certain UI features might not work as expected
-
v0.3.0:
- Breaking changes:
- Removed HTML API support, now exclusively uses JSON API
- Simplified client factory to only create JSON clients
- Benefits:
- Reduced code complexity
- More consistent behavior
- Breaking changes:
-
v0.2.0:
- Added new commands:
shuffle- Control shuffle mode (off/songs/albums)repeat- Control repeat mode (off/one/all)now- Show Now Playing screenremote- Send remote control button presses (up/down/left/right/select)
- Breaking changes:
- Removed backward compatibility layer (
client.py) - Direct imports from
squeeze.clientshould be changed tosqueeze.html_client - Renamed
SqueezeClienttoSqueezeHtmlClientfor clarity
- Removed backward compatibility layer (
- Added pre-commit hooks for code quality (black, isort, ruff, mypy)
- Added new commands:
-
v0.1.0 - Initial release
We use pre-commit hooks to maintain code quality. To set up the pre-commit hooks, run:
pip install pre-commit
pre-commit installThe pre-commit hooks enforce:
- Black for code formatting
- isort for import sorting
- ruff for linting
- mypy for type checking
You can manually run all checks with:
pre-commit run --all-filesOr check specific files:
pre-commit run --files file1.py file2.pyMIT