On this page6 sections ▾
The Free Your Music CLI puts the Free Your Music web app in your terminal. It uses your Free Your Music account, so it sees the same connected services, transfers and playlists as the web app. The CLI is part of Pro.
What you need
- Node.js 20 or newer with npm, on macOS, Windows or Linux.
- A Free Your Music account with Pro: the same account you use at freeyourmusic.com/app.
Install and sign in
Install the Free Your Music CLI and sign in
- In a terminal, run npm i -g @freeyourmusic/cli.
- Run fym login. Your browser opens freeyourmusic.com/app/cli and the terminal shows a short code.
- Sign in with email, Apple or Google. Check that the code in the browser matches the code in the terminal, then tap Allow. Without Pro, the page offers Pro first.
- Run fym services connect spotify (or another service) and sign in to that service in the browser.
- Run fym library playlists to see your playlists.
On a computer with no browser, run fym login --no-browser and open the link on your phone. The session lasts while you use it: the CLI renews it by itself. fym logout signs out this computer.
What can I do with it?
| Group | What it does |
|---|---|
| status, services, accounts | Sign-in state, connect and reconnect music services, list accounts |
| library, search | Read playlists, liked songs, albums and artists; search a service |
| transfers | Start, follow, pause, resume, retry and delete transfers; Keep in sync |
| playlists, covers | Create, edit, sort, shuffle, remove duplicates, split, merge, copy, restore a version, covers |
| matches | Review songs that did not match and pick a replacement |
| insights, stats, exports | Playlist insights, listening stats, library exports |
| account, premium, notifications | Your account, Pro plans and checkout, licence keys, email settings |
Run fym help for every command and add --help to a command for its flags. Add --json to any command to get output that scripts can read. Commands that delete or replace data need --yes. There is no transfer cancel: pause or delete a transfer.
Exit codes
| Code | Meaning | What to do |
|---|---|---|
| 0 | Success | Nothing. |
| 1 | A wrong input, or the server refused the input | Check the command with --help. |
| 2 | You are not signed in, or the session ended | Run fym login. |
| 3 | Free Your Music could not be reached | Check your connection and try again. |
| 4 | The command needs Pro | Run fym premium plans and get Pro. |
| 5 | Too many requests | Wait a moment and try again. |
How it works and what stays private
The CLI calls the Free Your Music API over HTTPS, as the web app does. After you tap Allow, it keeps your session in ~/.fym/credentials.json, a file only your user account can read. Your music service logins stay on Free Your Music servers; the CLI never sees your passwords.
For scripts and CI, set FYM_TOKEN instead of signing in. fym account sign-out-everywhere ends every other session of your account, on the web, in the apps and in other CLIs.
The CLI adds no tracking. Published versions report unexpected errors to our crash-reporting tool, without your command arguments or credentials. Set FYM_DISABLE_TELEMETRY=1 to turn that off.
Frequently asked questions
Is the CLI free?
No. The CLI and the MCP server are part of Pro. Every one-time transfer is free in the web app and in the iPhone and Android apps.
How do I upgrade to Pro from the CLI?
Run fym premium plans to see the plans, then fym premium buy with the plan you want. It gives you a checkout link to open in the browser.
Should I use the CLI or the MCP server?
Use the CLI for scripts, cron jobs and CI. Use the MCP server when you want to ask an AI assistant to work with your music in a chat. Both share one sign-in on your computer.
Need help with the CLI? Contact support and paste the output of fym status.