You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c417b1f
Browse filesBrowse the repository at this point in the historyBrowse files
* feat: improve the get command to be able to do things like
- surge get <id> info
- surge get <id> pause
- surge get <id> resume
- surge get <id> delete
* fix: ensure startDownload doesnt duplicate id and uses the one given by get
* docs: update readme
* test: added integration tests for the new get commands
Copy file name to clipboardExpand all lines: README.md
+46-25Lines changed: 46 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ Designed for power users who prefer a keyboard-driven workflow and want full con
18
18
19
19
[](https://github.com/surge-downloader/surge/releases/latest)
20
20
21
-
22
21
### Homebrew (macOS/Linux)
23
22
24
23
```bash
@@ -43,24 +42,30 @@ go build -o surge .
43
42
```
44
43
45
44
---
45
+
46
46
<details><summary>
47
47
<h2> Architecture & Modes </h2>
48
48
</summary>
49
49
50
50
Surge employs a **Strict Single Instance Architecture** to ensure data integrity and efficient resource usage.
51
51
52
52
### 1. The Engine (Host)
53
+
53
54
Only **one** instance of Surge runs at a time (the "Host"). This instance holds the lock file (`~/.surge/surge.lock`) and manages all downloads.
55
+
54
56
-**TUI Mode**: Starts the interactive dashboard.
55
57
-**Headless Mode**: Starts as a background daemon (`surge --headless`).
56
58
57
59
### 2. The Client (CLI)
60
+
58
61
If you run `surge` or `surge get` while another instance is running, it automatically acts as a **Client**.
62
+
59
63
- It detects the running Host.
60
64
- Offloads the download request to the Host via HTTP.
61
65
- Exits immediately (fire-and-forget) or waits if acting as a temporary host.
62
66
63
67
This means you can open multiple terminals and queue downloads freely; they will all be managed by the single active engine.
68
+
64
69
</details>
65
70
66
71
---
@@ -113,18 +118,36 @@ surge get --batch urls.txt
113
118
114
119
```
115
120
121
+
### Managing Downloads (CLI)
122
+
123
+
You can check status, pause, resume, or delete a specific download using its ID.
124
+
125
+
```bash
126
+
# Get status info
127
+
surge get <ID> info
128
+
129
+
# Pause a download
130
+
surge get <ID> pause
131
+
132
+
# Resume a paused download
133
+
surge get <ID> resume
134
+
135
+
# Delete a download
136
+
surge get <ID> delete
137
+
```
138
+
116
139
---
117
140
118
141
## Features
119
142
120
-
***High-speed Downloads** with multi-connection support
121
-
***Beautiful TUI** built with Bubble Tea & Lipgloss
122
-
***Pause/Resume** downloads seamlessly
123
-
***Real-time Progress** with speed graphs and ETA
124
-
***Auto-retry** on connection failures
125
-
***Batch Downloads**
126
-
***Browser Extension** integration
127
-
***Clipboard Integration**
143
+
-**High-speed Downloads** with multi-connection support
144
+
-**Beautiful TUI** built with Bubble Tea & Lipgloss
145
+
-**Pause/Resume** downloads seamlessly
146
+
-**Real-time Progress** with speed graphs and ETA
147
+
-**Auto-retry** on connection failures
148
+
-**Batch Downloads**
149
+
-**Browser Extension** integration
150
+
-**Clipboard Integration**
128
151
129
152
---
130
153
@@ -140,35 +163,33 @@ Not all connections are created equal; there are fast connections and slow conne
140
163
The top 3 optimizations we did in Surge are:
141
164
142
165
1.**Split the Largest Chunk:** Split the largest chunk whenever possible so that workers do not remain idle.
143
-
144
166
2.**Work Stealing:** Near the end, when fast workers are finished and slow workers are still processing, make the fast, idle workers "steal work" from the slow workers.
145
-
146
167
3.**Restart Slow Workers:** Calculate the mean speed of all workers. If a worker is performing at less than **0.3x** of the mean, restart it in the hopes that it will secure a better pathway to the server, which will be faster.
0 commit comments