Yes, you can listen to Pandora from the command line, but not through an official Pandora client. The practical approach is to use a third-party, open-source player like pianobar (for Linux and macOS) or pandora-cli (a Node.js-based tool). These tools log into your Pandora account, fetch station data, and stream audio directly to your terminal, often with keyboard shortcuts for control.
Why Use a Command-Line Client?
Command-line music players appeal to users who live in a terminal—developers, sysadmins, or anyone who prefers minimal resource usage and keyboard-driven control. A CLI Pandora client offers several advantages over the web player or desktop app:
- Low overhead: No browser tabs, no Electron-based apps eating RAM; just a lightweight process.
- Scriptability: You can pipe output to other tools, automate station switching with cron, or integrate with window managers (e.g., i3, tmux).
- Remote access: SSH into a server or Raspberry Pi and control music without a GUI.
- Keyboard-centric: All controls are single keystrokes—no mouse needed.
However, these clients are not official, so they rely on Pandora’s internal (undocumented) API. That means they can break if Pandora changes its backend, and they may violate Pandora’s Terms of Service. Use them with that understanding.
How These Clients Work
Pandora’s streaming is not a simple MP3 URL; it uses a proprietary protocol with encryption and partner credentials. Third-party clients reverse-engineer this protocol. For example, pianobar (written in C) implements the same handshake that the official mobile apps use. It sends your username and password (or a partner-specific authentication token) to Pandora’s servers, receives a session ID, and then requests audio streams for a station. The audio is typically delivered as a series of MP3 or AAC segments, which the client plays via an external audio player like mpg123 or ffplay.
Because the API is unofficial, clients often require you to provide a “partner” username and password—these are not your Pandora credentials but are hardcoded in the client’s source code. The client uses them to obtain a temporary token, then logs in with your account. This is why some clients break when Pandora updates its partner keys.
Choosing a Client: pianobar vs. pandora-cli
Two main options dominate the command-line Pandora scene:
- pianobar – The oldest and most mature. Written in C, it runs on Linux, macOS (via Homebrew), and even Windows (with Cygwin). It supports station creation, thumbs up/down, sleep timer, and song history. It requires a separate audio player (e.g., mpg123) to actually output sound.
- pandora-cli – A Node.js package that bundles its own audio output (using the
speakermodule). It’s easier to install if you already have Node.js, but it’s less actively maintained than pianobar. It offers similar features but with a different interface.
For most users, pianobar is the recommended choice because it’s battle-tested and has a large user base. You can install it on Debian/Ubuntu with sudo apt install pianobar, on macOS with brew install pianobar, or compile from source. After installation, you need to configure it by creating a ~/.config/pianobar/config file with your email and password (or use the -e flag to enter them interactively).
Step-by-Step: Setting Up pianobar
- Install pianobar – Use your package manager (apt, dnf, brew) or build from source. Ensure you also have an audio player like
mpg123installed (sudo apt install mpg123). - Create config file – In
~/.config/pianobar/config, add lines like:
user = your_email@example.com
password = your_password
audio_player = mpg123 -q -(this tells pianobar to pipe audio to mpg123). - Run pianobar – Type
pianobarin your terminal. It will connect, list your stations, and start playing the first one. Use the interactive keys:sto skip,pto pause,+/-to change volume,tto thumb up,dto thumb down,nto create a new station,qto quit. - Handle errors – If you get “Auth failed” or “Network error,” check your internet connection, ensure your Pandora account is active, and verify that your audio player is installed and can play from stdin.
Common Problems and Fixes
- “Unable to authenticate” – This often happens when Pandora updates its partner keys. Update pianobar to the latest version or apply a patch from the community. Some users have to set
tls_fingerprintin the config to a specific value (found in the pianobar GitHub issues). - No sound – Check that your audio player is correctly specified. If you use
mpg123, test it withecho test | mpg123 -. Also ensure your system’s audio output is not muted. - Stream cuts out after a few seconds – This is often a network issue or a problem with the audio player’s buffer. Try increasing the
audio_buffersetting in pianobar’s config (e.g.,audio_buffer = 4096). - “Station list empty” – Your account may have no stations, or the client can’t fetch them. Try creating a station via the web player first, then restart pianobar.
Security and Account Safety
Using a third-party client means you’re entering your Pandora password into a program not controlled by Pandora. While pianobar and pandora-cli are open source and have been audited by the community, there’s always a risk. To minimize danger:
- Use a unique password for Pandora that you don’t reuse elsewhere.
- Do not run the client on a shared or compromised machine.
- Be aware that Pandora may detect the unofficial client and could throttle or ban your account, though this is rare.
Also, these clients do not support Pandora’s paid tiers (Plus/Premium) beyond basic streaming; you’ll get the free, ad-supported experience (though ads may not play correctly).
Alternatives to Command-Line Pandora
If you want a terminal-based music experience but don’t need Pandora specifically, consider:
- mpd (Music Player Daemon) with a client like
ncmpcpp– This plays your local music library, not streaming services. - youtube-dl (or yt-dlp) – You can stream audio from YouTube by extracting the audio URL, but that’s not Pandora’s catalog.
- Spotify’s official CLI – Spotify doesn’t have an official CLI, but there are community tools like
spotify-clithat control the desktop app via D-Bus.
For Pandora specifically, the command-line route is really the only option if you refuse the GUI.
Frequently Asked Questions
Is this legal?
Using a third-party client to access Pandora likely violates Pandora’s Terms of Service, which prohibit unauthorized access to their API. However, it’s not illegal in a criminal sense; it’s a civil contract issue. Pandora could terminate your account if they detect unusual activity.
Will this work on Windows?
Pianobar can be compiled on Windows with Cygwin or MSYS2, but it’s not straightforward. A simpler alternative is to use the Windows Subsystem for Linux (WSL) and install pianobar there, but audio output can be finicky. Many users prefer running it on a Linux VM or a Raspberry Pi.
Can I use my Pandora Plus/Premium account?
Yes, you can log in with any Pandora account. However, the client may not support all premium features like offline listening or high-quality streams. It will typically stream at the standard quality.
Why does it keep asking for a “partner user”?
Some clients require you to enter a partner username and password, which are not your Pandora credentials. These are hardcoded in the client’s source code. If you see this prompt, you’re likely using an older version; check the client’s documentation for the correct values.
Can I control it from my phone?
Not directly, but you can run pianobar on a server and use SSH from your phone to control it. Some users set up a simple web interface or use tmux to keep the session alive.
What if Pandora changes its API?
If the client stops working, check the project’s GitHub repository for updates. Often a patch is released within days. If not, you may need to wait for a new fork or switch to the web player temporarily.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Hide PHP Version HTTP Header: How To
- CentOS Stream for Developers: A Practical Guide
- How to Replace a Game Controller Battery Safely
- Man-Sized 3D Printer? Why You Probably Don’t Need One100.0 cm³/h
- Scroll Horizontally with Mouse Wheel by Holding Shift5.00 min/km
- AI Competitor Monitoring Tools & Strategies