# webtorrent-cli

> WebTorrent, the streaming torrent client. For the command line.

Latest version **6.0.1** (published 2026-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install webtorrent-cli
pnpm add webtorrent-cli
yarn add webtorrent-cli
bun add webtorrent-cli
```

Provides the command `webtorrent`.

## 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 | 6.0.1 |
| Published | 2026-08-19 |
| First published | 2016-03-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 17 |
| Unpacked size | 38.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1375 |
| Author | WebTorrent LLC |
| Maintainers | feross, mafintosh, flet, watson, diegorbaquero, hicom150, jhiesey, webtorrent-bot, alxhotel |
| Keywords | bittorrent, bittorrent client, download, mad science, streaming, torrent, webrtc, webrtc data, webtorrent |

## Links

- npm: https://www.npmjs.com/package/webtorrent-cli
- Repository: https://github.com/webtorrent/webtorrent-cli
- Homepage: https://webtorrent.io
- Issues: https://github.com/webtorrent/webtorrent-cli/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/webtorrent-cli

## Dependencies (17)

- [mime](https://npm.io/package/mime.md) ^3.0.0
- [open](https://npm.io/package/open.md) ^11.0.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [yargs](https://npm.io/package/yargs.md) ^17.0.1
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [winreg](https://npm.io/package/winreg.md) ^1.2.4
- [ecstatic](https://npm.io/package/ecstatic.md) ^4.1.4
- [inquirer](https://npm.io/package/inquirer.md) ^8.2.2
- [dlnacasts](https://npm.io/package/dlnacasts.md) ^0.1.0
- [webtorrent](https://npm.io/package/webtorrent.md) ^3.0.0
- [common-tags](https://npm.io/package/common-tags.md) ^1.8.0
- [vlc-command](https://npm.io/package/vlc-command.md) ^1.2.0
- [parse-torrent](https://npm.io/package/parse-torrent.md) ^9.1.3
- [create-torrent](https://npm.io/package/create-torrent.md) ^6.0.17
- [prettier-bytes](https://npm.io/package/prettier-bytes.md) ^1.0.4
- [network-address](https://npm.io/package/network-address.md) ^1.1.2
- [memory-chunk-store](https://npm.io/package/memory-chunk-store.md) ^1.3.5

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 6.0.1 (latest) — 2026-08-19
- 6.0.0 — 2026-04-14
- 5.1.3 — 2024-12-12
- 5.1.2 — 2024-06-14
- 5.1.1 — 2024-06-13
- 5.1.0 — 2024-06-02
- 5.0.1 — 2024-06-02
- 5.0.0 — 2024-06-02
- 4.1.0 — 2022-06-02
- 4.0.4 — 2022-03-09
- 4.0.3 — 2022-02-03
- 4.0.2 — 2022-01-04
- 4.0.1 — 2022-01-04
- 4.0.0 — 2021-09-17
- 3.5.4 — 2021-08-06
- … 61 more at https://npm.io/package/webtorrent-cli/versions

## README

<h1 align="center">
  <br>
  <a href="https://webtorrent.io"><img src="https://webtorrent.io/img/WebTorrent.png" alt="WebTorrent" width="200"></a>
  <br>
  WebTorrent CLI
  <br>
  <br>
</h1>

<h4 align="center">The streaming torrent client. For the command line.</h4>

<p align="center">
    <a href="https://github.com/webtorrent/webtorrent-cli/actions/workflows/ci.yml"><img src="https://github.com/webtorrent/webtorrent-cli/actions/workflows/ci.yml/badge.svg?branch=master" alt="ci"></a>
    <a href="https://npmjs.com/package/webtorrent-cli"><img src="https://img.shields.io/npm/v/webtorrent-cli.svg" alt="npm version"></a>
    <a href="https://npmjs.org/package/webtorrent-cli"><img src="https://img.shields.io/npm/dm/webtorrent-cli.svg" alt="npm downloads"></a>
    <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="javascript style guide"></a>
</p>
<br>

**WebTorrent** is the first BitTorrent client that works in the **browser**, but `webtorrent-cli`,
i.e. *THIS PACKAGE*, is for using WebTorrent from the **command line**.

`webtorrent-cli` is a simple torrent client for use in node.js, as a command line app. It
uses TCP, UDP and WebRTC to talk to other torrent clients.

To use WebTorrent in the browser, see [`webtorrent`](https://www.npmjs.com/package/webtorrent).

### Features

- **Use [WebTorrent](https://webtorrent.io) from the command line!**
- **Insanely fast**
- Streaming
  - Stream to **AirPlay**, **Chromecast**, **VLC player**, **IINA**, and many other devices/players
  - Fetches pieces from the network on-demand so seeking is supported (even before torrent is finished)
  - Seamlessly switches between sequential and rarest-first piece selection strategy
- Supports advanced torrent client features
  - **magnet uri** support via **[ut_metadata](https://www.npmjs.com/package/ut_metadata)**
  - **peer discovery** via **[dht](https://www.npmjs.com/package/bittorrent-dht)**,
    **[tracker](https://www.npmjs.com/package/bittorrent-tracker)**, and
    **[ut_pex](https://www.npmjs.com/package/ut_pex)**
  - **[protocol extension api](https://www.npmjs.com/package/bittorrent-protocol#extension-api)**
    for adding new extensions
  - Check all the **[supported BEPs here](https://github.com/webtorrent/webtorrent/blob/master/docs/bep_support.md)**

### Install

To install a `webtorrent` command line program, run:

```bash
npm install webtorrent-cli -g
```

### Usage

```bash
$ webtorrent --help
               _     _                            _
 __      _____| |__ | |_ ___  _ __ _ __ ___ _ __ | |_
 \ \ /\ / / _ \ '_ \| __/ _ \| '__| '__/ _ \ '_ \| __|
  \ V  V /  __/ |_) | || (_) | |  | | |  __/ | | | |_
   \_/\_/ \___|_.__/ \__\___/|_|  |_|  \___|_| |_|\__|

Usage:
  webtorrent [command] <torrent-id> [options]

Examples:
  webtorrent download "magnet:..." --vlc
  webtorrent "magnet:..." --vlc --player-args="--video-on-top --repeat"

Default output location:
  * when streaming: Temp folder
  * when downloading: Current directory

Specify <torrent-id> as one of:
  * magnet uri
  * http url to .torrent file
  * filesystem path to .torrent file
  * info hash (hex string)

Commands:
  webtorrent download [torrent-ids...]      Download a torrent                             [default]
  webtorrent downloadmeta <torrent-ids...>  Download metadata of torrent
  webtorrent seed <inputs...>               Seed a file or a folder
  webtorrent create <input>                 Create a .torrent file
  webtorrent info <torrent-id>              Show torrent information
  webtorrent version                        Show version information
  webtorrent help                           Show help information

Options (streaming):
      --airplay     Apple TV                                                               [boolean]
      --chromecast  Google Chromecast                                                 [default: all]
      --dlna        DLNA                                                                   [boolean]
      --mplayer     MPlayer                                                                [boolean]
      --mpv         MPV                                                                    [boolean]
      --omx         OMX                                                              [default: hdmi]
      --vlc         VLC                                                                    [boolean]
      --iina        IINA                                                                   [boolean]
      --smplayer    SMPlayer                                                               [boolean]
      --xbmc        XBMC                                                                   [boolean]
      --stdout      Standard out (implies --quiet)                                         [boolean]

Options (simple):
  -o, --out                 Set download destination                                        [string]
  -s, --select              Select specific file in torrent                    [default: List files]
  -i, --interactive-select  Interactively select specific file in torrent                  [boolean]
  -t, --subtitles           Load subtitles file                                             [string]
  -h, --help                Show help information                                          [boolean]
  -v, --version             Show version information                                       [boolean]

Options (advanced)
  -p, --port            Change the http server port                         [number] [default: 8000]
  -b, --blocklist       Load blocklist file/url                                             [string]
  -a, --announce        Tracker URL to announce to                                          [string]
  -q, --quiet           Don't show UI on stdout                                            [boolean]
  -d, --download-limit  Maximum download speed in kb/s                 [number] [default: unlimited]
  -u, --upload-limit    Maximum upload speed in kb/s                   [number] [default: unlimited]
      --pip             Enter Picture-in-Picture if supported by the player                [boolean]
      --verbose         Show torrent protocol details                                      [boolean]
      --playlist        Open files in a playlist if supported by the player                [boolean]
      --player-args     Add player specific arguments (see example)                         [string]
      --torrent-port    Change the torrent seeding port                   [number] [default: random]
      --dht-port        Change the dht port                               [number] [default: random]
      --not-on-top      Don't set "always on top" option in player                         [boolean]
      --keep-seeding    Don't quit when done downloading                                   [boolean]
      --no-quit         Don't quit when player exits                                       [boolean]
      --on-done         Run script after torrent download is done                           [string]
      --on-exit         Run script before program exit                                      [string]
```

To download a torrent:

```bash
$ webtorrent magnet_uri
```

To stream a torrent to a device like **AirPlay** or **Chromecast**, just pass a flag:

```bash
$ webtorrent magnet_uri --airplay
```

In addition to magnet uris, webtorrent supports many ways to specify a torrent:

- magnet uri (string)
- torrent file (buffer)
- info hash (hex string or buffer)
- parsed torrent (from [parse-torrent](https://www.npmjs.com/package/parse-torrent))
- http/https url to a torrent file (string)
- filesystem path to a torrent file (string)

### License

MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org) and [WebTorrent, LLC](https://webtorrent.io).

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