Skip to content

`surge add`

Add one or more URLs to a running Surge server without opening the TUI. get is an alias for this command.

surge add [url]...
surge get [url]...

A local TUI or headless server must already be running. Start one in another terminal if needed:

Terminal window
surge
# or, without the TUI
surge server

If the TUI was started with --no-server, add cannot connect to it.

Terminal window
surge add https://example.com/releases/surge.tar.gz

Surge adds the URL to the running server’s queue. Use surge ls to find its ID and monitor the result.

Terminal window
surge add https://example.com/releases/surge.tar.gz --output ~/Downloads

The output directory defaults to the current working directory. Quote paths that contain spaces:

Terminal window
surge add https://example.com/releases/surge.tar.gz --output "$HOME\My Downloads"

Pass URLs as separate arguments:

Terminal window
surge add \
https://example.com/one.iso \
https://example.com/two.iso

For a longer list, create a plain-text file with one URL per line and use --batch:

urls.txt
https://example.com/one.iso
https://example.com/two.iso
Terminal window
surge add --batch urls.txt

Use --confirm when a batch file or pasted list needs a final check:

Terminal window
surge add --batch urls.txt --confirm

Supply the remote host and its token before the command:

Terminal window
surge --host https://192.168.1.10:1700 --token "$SURGE_TOKEN" add \
https://example.com/releases/surge.tar.gz

Remote connections that send a token should use HTTPS. Set SURGE_HOST and SURGE_TOKEN when you use the same server regularly. See Connect to a remote server for connection and security guidance.