How webtorrent/webtorrent-cli works
WebTorrent CLI turns command-line torrent identifiers or input files into torrent operations: create, inspect, download, seed, or fetch metadata. The main download workflow uses WebTorrent, serves selected torrent files over HTTP for streaming, and can hand playback URLs to external players. The README documents peer discovery and streaming capabilities, but the excerpts do not expose their internal implementation, so those are represented as WebTorrent capabilities rather than speculative internal modules. Several command stages share bin/cmd.js; source excerpts are partial.
Main entry points: cmd.js Command interface · version.cjs Version output
Components 16
CLI Interface
- Command interface
bin/cmd.js - Version output
version.cjs
Torrent Operations
- Torrent input parsing
bin/cmd.js - Torrent creation
bin/cmd.js - Torrent info
bin/cmd.js - Metadata download
bin/cmd.js - Torrent download
bin/cmd.js - Torrent seeding
bin/cmd.js
Streaming and Playback
- File selection
bin/cmd.js - HTTP file server
bin/cmd.js - Subtitle server
bin/cmd.js - Player launch
bin/cmd.js
Torrent Networking
- WebTorrent client
bin/cmd.js
Other components
- CLI user
- Torrent peers
- External players
Connections 16
- CLI user → Command interface: invokes
README.md - Command interface → Version output: reads version
version.cjs - Command interface → Torrent input parsing: parses input
bin/cmd.js - Command interface → Torrent creation: routes create
README.md - Command interface → Torrent info: routes info
README.md - Command interface → Metadata download: routes metadata
README.md - Command interface → Torrent download: routes download
README.md - Command interface → Torrent seeding: routes seed
README.md - Torrent creation → WebTorrent client: creates torrent
bin/cmd.js - Torrent download → WebTorrent client: adds torrent
bin/cmd.js - WebTorrent client → Torrent peers: discovers peers
README.md - Torrent download → File selection: selects files
README.md - WebTorrent client → HTTP file server: creates server
bin/cmd.js - HTTP file server → Player launch: provides stream URL
bin/cmd.js - Player launch → External players: opens stream
README.md - Subtitle server → Player launch: provides subtitles
bin/cmd.js