# r4

> CLI for Radio4000

Latest version **2.1.3** (published 2026-08-05) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install r4
pnpm add r4
yarn add r4
bun add r4
```

Provides the command `r4`.

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2026-08-05 |
| First published | 2016-10-20 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 121.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | radio4000 |
| Maintainers | user-09876, oskarrough |

## Links

- npm: https://www.npmjs.com/package/r4
- Repository: https://github.com/radio4000/cli
- Homepage: https://github.com/radio4000/cli#readme
- Issues: https://github.com/radio4000/cli/issues
- npm.io page: https://npm.io/package/r4

## Dependencies (6)

- [zod](https://npm.io/package/zod.md) ^4.4.3
- [prompts](https://npm.io/package/prompts.md) ^2.4.2
- [ffmetadata](https://npm.io/package/ffmetadata.md) ^1.7.0
- [filenamify](https://npm.io/package/filenamify.md) ^7.0.2
- [@radio4000/sdk](https://npm.io/package/@radio4000/sdk.md) ^0.8.2
- [get-artist-title](https://npm.io/package/get-artist-title.md) ^1.3.1

## Recent versions

- 2.1.3 (latest) — 2026-08-05
- 2.1.2 — 2026-03-20
- 2.1.1 — 2026-02-18
- 2.1.0 — 2026-02-18
- 2.0.6 — 2026-02-05
- 2.0.5 — 2025-12-04
- 2.0.4 — 2025-12-03
- 2.0.3 — 2025-12-01
- 2.0.2 — 2025-11-14
- 2.0.0 — 2025-11-14
- 1.0.4 — 2021-07-13
- 1.0.3 — 2020-03-09
- 1.0.2 — 2020-01-29
- 1.0.1 — 2020-01-29
- 1.0.0 — 2018-06-22
- … 1 more at https://npm.io/package/r4/versions

## README

# r4

Command-line interface for [Radio4000](https://radio4000.com)
- browse, create, update, and download radio channels and tracks.

```bash
npm i -g r4
r4 help
```

Here's a quick overview:

```bash
r4 channel list --limit 10
r4 channel view ko002
r4 track list --channel ko002
r4 track list --channel ko002 --tag jazz,ambient
r4 download ko002                                     # downloads to ./ko002/
r4 download ko002 --base-url https://cdn.example.com  # absolute URLs in download.json
r4 download ko002 --backup-file                       # only write download.json, no download
r4 search "ambient"
r4 auth login
r4 channel create radio123 --name "Radio 123"
r4 track create --channel radio123 --title "Song" --url "https://youtube.com/..."
r4 track update <id> --title "Updated song"

# Pipe and compose
r4 track list --channel ko002 --limit 10 | jq '.[] | .title'

# Or export to sqlite
r4 schema | sqlite3 my.db
r4 track list --channel ko002 --format sql | sqlite3 my.db
```

Most commands support a  `--format` flag to print human-readable text, json or SQL.

> For the `r4 download` command to work, make sure [`yt-dlp`](https://github.com/yt-dlp/yt-dlp) is installed.

After downloading, a `download.json` is written alongside the tracks — a self-contained `ChannelBackup` (`{ version, created_at, channel, tracks[] }`) where each track's `url` points to its local file at `tracks/<filename>.<ext>`. Tracks that failed to download keep their original remote URL. Use `--base-url` to produce absolute URLs (e.g. when serving the folder over HTTP). Use `--no-metadata` to skip writing `download.json`.

## Development

```bash
git clone git@github.com:radio4000/cli.git
cd r4
bun install
bun link # optional for easy local dev
bun run check # format and lint
bun run test
```

---
_Source: https://npm.io/package/r4 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
