Download and manage files
Use this guide when Surge is already running locally or when you know which server you want to control.
Queue a download
Section titled “Queue a download”Start the TUI and queue a URL in one step:
surge https://example.com/video.mp4To add work to a running Surge server without opening the TUI, use add (or
its alias, get):
surge add https://example.com/video.mp4surge get https://example.com/audio.flac --output ~/DownloadsUse --confirm to review the queued URLs before they start. To queue one URL
per line from a file, use --batch:
surge add --batch urls.txtInspect downloads
Section titled “Inspect downloads”List downloads with their IDs:
surge lsPass an ID, or an unambiguous ID prefix, to inspect one download. Use --json
when another program needs structured output, and --watch to refresh the list
once per second.
surge ls ab12surge ls --jsonsurge ls --watchPause, resume, and refresh
Section titled “Pause, resume, and refresh”surge pause ab12surge resume ab12Use --all with pause or resume to affect every eligible download. If an
expired or changed URL leaves a download paused or in an error state, update its
source before resuming it:
surge refresh ab12 https://example.com/replacement-urlsurge resume ab12Control speed
Section titled “Control speed”Set a limit for one download, for all current downloads, or as the default for
new downloads. Use 0 or unlimited to remove a limit.
surge limit ab12 10MiBsurge limit --global 50MiBsurge limit --default unlimitedRun surge limit --help for the accepted speed formats and full command
syntax.
Remove downloads
Section titled “Remove downloads”Removing a download only removes it from Surge’s queue by default; it does not delete the downloaded file.
surge rm ab12surge rm --cleansurge rm --clean-failed[!WARNING]
surge rm <ID> --purgealso deletes the downloaded file or files from disk. Check the ID and destination before using it.
Control another server
Section titled “Control another server”Add --host and an authentication token to any control command:
surge --host https://192.168.1.10:1700 --token "$SURGE_TOKEN" lsUse HTTPS for a remote token-authenticated connection. For repeated use, set
SURGE_HOST and SURGE_TOKEN in your environment. See
Connect to a remote server.