CLI and AI tools

The Free Your Music CLI

Applies to
  • macOS
  • Windows
  • Linux
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

  1. In a terminal, run npm i -g @freeyourmusic/cli.
  2. Run fym login. Your browser opens freeyourmusic.com/app/cli and the terminal shows a short code.
  3. 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.
  4. Run fym services connect spotify (or another service) and sign in to that service in the browser.
  5. 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?

GroupWhat it does
status, services, accountsSign-in state, connect and reconnect music services, list accounts
library, searchRead playlists, liked songs, albums and artists; search a service
transfersStart, follow, pause, resume, retry and delete transfers; Keep in sync
playlists, coversCreate, edit, sort, shuffle, remove duplicates, split, merge, copy, restore a version, covers
matchesReview songs that did not match and pick a replacement
insights, stats, exportsPlaylist insights, listening stats, library exports
account, premium, notificationsYour 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

CodeMeaningWhat to do
0SuccessNothing.
1A wrong input, or the server refused the inputCheck the command with --help.
2You are not signed in, or the session endedRun fym login.
3Free Your Music could not be reachedCheck your connection and try again.
4The command needs ProRun fym premium plans and get Pro.
5Too many requestsWait 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.

See the CLI page

Need help with the CLI? Contact support and paste the output of fym status.

Related articles

Contact

Still stuck?

Write to our support team at support@freeyourmusic.com. Tell us your platform and what you tried.

Fastest: from the app

  1. Account
  2. Help and support
  3. Write to support

The email then contains your platform, the app version and your account ID, so we can help sooner.

Real people read every email. Paid plans get priority support.