add command queues one or more downloads to a running Surge instance. It requires an active Surge server or TUI to be running.
Usage
Aliases
get
Description
Adds new downloads to the queue of a running Surge instance. The command:- Connects to the local or remote Surge server via HTTP API
- Sends download requests with optional output directory
- Supports batch file input for multiple URLs
- Auto-detects the running server port from the runtime directory
- Returns success count for queued downloads
This command requires a running Surge instance. Start one with
surge or surge server first.Arguments
One or more URLs to download. Can include mirror URLs separated by commas.Examples:
Flags
Path to a file containing URLs to download (one per line).Short form:
-bExample:Output directory for the downloads. If not specified, uses the server’s configured default download directory.Short form:
-oExample:Examples
Add Single Download
Add Multiple Downloads
Add from Batch File
Create a fileurls.txt:
Specify Output Directory
Add with Mirrors
Provide mirror URLs separated by commas:Using Alias
Batch File Format
Batch files should contain one URL per line:Connection Behavior
Auto-Detection
The command automatically detects a running local Surge instance by reading the port from the runtime directory (~/.surge/port or ~/.local/state/surge/port).
Remote Servers
To add downloads to a remote server, use the--host flag:
SURGE_HOST environment variable:
Authentication
For remote servers, you may need to provide a token:SURGE_TOKEN environment variable:
Error Handling
If no Surge instance is running:Related Commands
- surge - Launch TUI with initial downloads
- surge server - Start headless server
- surge ls - List queued downloads