Surge README

The project's README from github.com/SurgeDM/Surge. As one markdown file: README.md.

Surge

Blazing fast TUI download manager built in Go for power users

Ask DeepWiki Release Go Version License BuyMeACoffee Stars

Documentation • Installation • Usage • Themes • Fonts • Benchmarks • Extension • Settings • CLI Reference


What is Surge?

Surge is designed for power users who prefer a keyboard-driven workflow. It features a beautiful Terminal User Interface (TUI), as well as a background Headless Server and a CLI tool for automation.

Surge Demo


Why use Surge?

Most browsers open a single connection for a download. Surge opens multiple (up to 16 by default), splits the file, and downloads chunks in parallel. But we take it a step further:

For a deep dive into how we make downloads faster (like work stealing and slow worker handling), check out our Optimization Guide.


Support the Project

We are just two CS students building Surge in between classes and exams. We love working on this, but maintaining a project of this scale takes time and resources. That's where you come in!

If Surge saves you time, consider supporting the development! Donations go directly toward:

☕ Buy us a coffee

Totally optional-your stars, issues, and contributions already mean the world to us! :)


Installation

Surge is available on multiple platforms. Choose the method that works best for you.

Platform / Method Command / Instructions Notes
Prebuilt Binary Download from Releases Easiest method. Just download and run.
Linux AppImage Download from Releases Run chmod +x Surge_..._linux_x86_64.AppImage, then ./Surge_..._linux_x86_64.AppImage. Supports delta updates.
Arch Linux (AUR) yay -S surge Managed via AUR.
macOS / Linux (Homebrew) brew install SurgeDM/tap/surge Recommended for Mac/Linux users.
Nix / NixOS nix run github:SurgeDM/Surge Via Nix flake. NixOS config: inputs.surge.packages.${pkgs.system}.default
Windows winget install surge-downloader.surge
or
scoop install surge
or
choco install surge
Recommended for Windows users.
Dockerfile See instructions Run Surge in server mode with Docker Compose
Go Install go install github.com/SurgeDM/Surge@latest Requires Go 1.25+

Usage

Surge has two main modes: TUI (Interactive) and Server (Headless).

For a full reference, see the customization guide, Settings & Configuration Guide and the CLI reference.

1. Interactive TUI Mode

Just run surge to enter the dashboard. This is where you can visualize progress, manage the queue, and see speed graphs. If you encounter any issues, press ? to open the bug reporting wizard. You can also press Shift + A or use your terminal's paste shortcut to automatically parse a copied browser 'cURL' command straight into a new download.

# Start the TUI
surge

# Start the TUI without the local HTTP API server
surge --no-server

# Start TUI with downloads queued
surge https://example.com/file1.zip https://example.com/file2.zip

# Combine URLs and batch file
surge https://example.com/file.zip --batch urls.txt

--no-server keeps the TUI fully local and skips the embedded HTTP API. CLI control commands such as surge add, surge pause, and browser-extension requests will not be able to target that instance.

2. Server Mode (Headless)

Great for servers, Raspberry Pis, or background processes.

# Start the server
surge server

# Start the server with a download
surge server https://url.com/file.zip

# Start with explicit API token
surge server --token <token>

3. Auto-Start Service

Surge provides an official way to manage it as a system service (daemon). This is the recommended way for servers and reproducible deployments.

# Install Surge as a system service
surge service install

# Manage the service
surge service start
surge service stop
surge service status
surge service token

# Uninstall the service
surge service uninstall

[!NOTE] On Linux, these commands may require sudo. On Windows, they should be run in an elevated (Administrator) terminal.

4. Remote TUI

surge and surge server bind the HTTP API to 0.0.0.0 (all interfaces) by default. This means the server is accessible via localhost (127.0.0.1) as well as your local network IP.

The API is token-protected. Generate/read your token by running:

# Get the standard token
surge token

# Get the token if Surge is installed as a system service
surge service token

Alternatively, you can find it in the TUI under Settings > Extension.

3. Remote TUI

Connect to a running Surge daemon (local or remote).

# Connect to local server (auto-detected)
surge connect

# Connect to a remote daemon
surge connect 192.168.1.10:1700 --token <token>

# Equivalent global-flag form
surge --host 192.168.1.10:1700 --token <token>

By default, surge connect uses:

4. Global Connection Flags (CLI + TUI)

These global flags are available on all commands:

Environment variable fallbacks:

5. Server Mode with Docker Compose

Download the compose file and start the container:

wget https://raw.githubusercontent.com/SurgeDM/Surge/refs/heads/main/docker/compose.yml
docker compose up -d

Get the API token:

docker compose exec surge surge token

Save this token - you'll need it to authenticate API requests and connect remotely.

Check downloads/API availability:

docker compose exec surge surge ls

View logs:

docker compose logs -f surge

Fonts

Surge ships a bundled Nerd Font for the TUI, but your terminal controls the actual font selection. See the customization guide for install steps and licensing details.


Benchmarks

We tested Surge against standard tools. Because of our connection optimization logic, Surge significantly outperforms single-connection tools.

Tool Time Speed Comparison
Surge 28.93s 35.40 MB/s -
aria2c 40.04s 25.57 MB/s 1.38× slower
curl 57.57s 17.79 MB/s 1.99× slower
wget 61.81s 16.57 MB/s 2.14× slower

Test details: 1GB file, Windows 11, Ryzen 5 5600X, 360 Mbps Network. Results averaged over 5 runs.

We would love to see you benchmark Surge on your system!

To compare fixed and adaptive concurrency under deterministic throttling, run:

go test ./internal/strategy/concurrent -run '^$' -bench BenchmarkThrottle -benchtime=1x -count=5

The native Go benchmark runs persistent-overload and burst-recovery workloads with both policies and reports elapsed time, request amplification, throttled requests, and peak accepted concurrency.


Browser Extension

The Surge extension intercepts browser downloads and sends them straight to your terminal. It communicates with the Surge client on port 1700 by default.

[!IMPORTANT] An Auth Token is required to connect the extension to your Surge server. This can be obtained from the TUI under Settings > Extension, or by running surge token (or surge service token if installed as a system service).

Chrome / Edge / Brave

  1. Stable: Get the Extension from Chrome Web Store
  2. Development:
    • Download extension-chrome.zip from the latest GitHub release.
    • Unzip it somewhere on disk.
    • Open your browser and navigate to chrome://extensions.
    • Enable "Developer mode" in the top right corner.
    • Click "Load unpacked".
    • Select the unzipped extension-chrome folder.
    • Click the Surge icon in your browser toolbar and enter your Auth Token in the settings.

Firefox

  1. Stable: Get the Add-on
  2. Development:
    • Download extension-firefox.zip from the latest GitHub release.
    • Navigate to about:debugging#/runtime/this-firefox.
    • Click "Load Temporary Add-on...".
    • Select the zip file (or unzip and select manifest.json).
    • Click the Surge icon in your browser toolbar and enter your Auth Token in the settings.

Acknowledgements

Huge thanks to the teams and sponsors helping us build and ship Surge:


Community & Contributing

We love community contributions! Whether it's a bug fix, a new feature, or just cleaning up typos. PRs are always welcome. For a quick guide, see CONTRIBUTING.md.

You can check out the Discussions for any questions or ideas, or follow us on X (Twitter)!

License

Distributed under the MIT License. See LICENSE for more information.


Star History Chart
If Surge saved you some time, consider giving it a ⭐ to help others find it!

Surge (SurgeDM/Surge)

Searching Database…

3.6K ·GitHub
这是什么?Surge 是一个用 Go 编写的基于终端(TUI)的下载管理器,面向想要快速、键盘驱动、多连接下载的高级用户。
Surge 只是个终端应用,还是也能在后台运行?它同时是三样东西:交互式 TUI 仪表盘、后台无头服务器(守护进程),以及用于自动化的 CLI 工具,它们都与同一个共享引擎进程通信。
怎么安装 Surge?从 Releases 下载预编译二进制文件,或使用包管理器:brew install SurgeDM/tap/surge,Windows 上用 winget install surge-downloader.surge / scoop / choco,Arch 上用 yay -S surge,或 nix run github:SurgeDM/Surge。也可以 go install github.com/SurgeDM/Surge@latest。
使用它需要安装 Go 吗?不需要,预编译二进制和包管理器安装不需要任何额外依赖;只有 'go install' 方式需要 Go 1.25 或更新版本。
让远程服务器一直开着安全吗?默认情况下,HTTP API 会绑定到所有网络接口(0.0.0.0)而不只是 localhost,因此本地网络里的设备都能访问它,而且它仅靠一个 bearer token 保护,并非完整的身份验证。
Surge 能在 Linux、macOS 和 Windows 上运行吗,还是只支持单一平台?它为 Linux、macOS 和 Windows 提供预编译包(通过 Homebrew、AUR、winget、scoop、choco、Nix 或 Docker),并且设计上也能在服务器和树莓派上以无头方式运行。
Surge 究竟是怎么做到比 curl 或 wget 更快的?它把单个下载拆分成最多 16 个并行分块,并能同时从多个镜像拉取,把工作线程分布到各个源上,在某个镜像缓慢或失败时自动切换。
浏览器扩展是做什么的?它会拦截在 Chrome、Edge、Brave 或 Firefox 中发起的下载,通过 1700 端口直接转发给你的 Surge 终端客户端,并使用 Surge 生成的令牌进行认证。
与其他下载工具相比,Surge 快多少?在 README 自己对 1GB 文件的基准测试中,Surge 达到了 35.40 MB/s,而 aria2c 慢 1.38 倍、curl 慢 1.99 倍、wget 慢 2.14 倍。
流式模式(Streaming Mode)是什么?它是一个按严格顺序而非并行方式下载文件分块的选项,对于想在下载完成前就开始预览的媒体文件很有用。
What are similar projects?hydra, Ketch, hister, FluxDown, Motrix, pinchtab, glances, kubo
Creator
SurgeDM
Size
44.2 MB
Stars
3.6K
Age
11mo
Commits · 90 Days