superseedr 1.0.5

A BitTorrent Client in your Terminal.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# CLI Guide

## What The CLI Is For

The Superseedr CLI is the main user-facing control surface for scripting,
automation, and headless operation.

It works in:

- standalone mode
- shared cluster mode
- online mode with a running client
- offline mode from persisted state when supported

The CLI is file-oriented rather than network-oriented. Commands either talk to a
running client through local/shared control files or operate directly on
persisted state when offline behavior is supported.

## Global Options

### `--json`

Return structured JSON output instead of text output.

Example:

```bash
superseedr --json status
```

## Quick Start

Add a torrent:

```bash
superseedr add "/path/to/example.torrent"
```

Add a magnet:

```bash
superseedr add "magnet:?xt=urn:btih:..."
```

Inspect current state:

```bash
superseedr status
superseedr torrents
superseedr journal
```

Pause and resume:

```bash
superseedr pause <INFO_HASH_HEX_OR_PATH>
superseedr resume <INFO_HASH_HEX_OR_PATH>
```

## Targeting Torrents

Many commands accept either:

- `INFO_HASH_HEX`
- a unique file path belonging to the torrent

Supported commands:

- `info`
- `files`
- `pause`
- `resume`
- `remove`
- `purge`
- `priority`

Behavior:

- if the target is already an info hash, Superseedr uses it directly
- if the target is a file path, Superseedr reverse-resolves it to the owning torrent
- if the file path matches more than one torrent, the command fails and asks for the info hash
- if no torrent matches, the command returns an error

## Command Reference

### `add`

```bash
superseedr add <INPUT>...
```

Add one or more torrent file paths or magnet links.

Inputs can be:

- `.torrent` paths
- magnet links

In shared mode, cross-host `.path` adds are portable when the `.torrent` file
is on the shared root.

### `stop-client`

```bash
superseedr stop-client
```

Request graceful shutdown of the running client.

Behavior:

- standalone mode: targets the local running client
- shared mode: targets the current leader through the shared inbox

### `journal`

```bash
superseedr journal
```

Show the event journal.

Behavior:

- text mode: human-readable entries
- `--json`: structured JSON envelope
- shared mode: merged view of shared command events and host-local runtime events

### `set-shared-config`

```bash
superseedr set-shared-config <PATH>
```

Persist the shared mount root for launcher and protocol-handler starts.

Accepted forms:

- the shared mount root
- an explicit `.../superseedr-config` path

Superseedr normalizes both to the shared mount root.

### `clear-shared-config`

```bash
superseedr clear-shared-config
```

Remove the persisted shared-config launcher setting.

### `show-shared-config`

```bash
superseedr show-shared-config
```

Show whether shared mode is enabled, the effective shared selection, and the
source of that selection.

Shared-config precedence is:

1. `SUPERSEEDR_SHARED_CONFIG_DIR`
2. persisted launcher shared-config sidecar
3. normal standalone mode

### `set-host-id`

```bash
superseedr set-host-id <HOST_ID>
```

Persist an explicit host identity for shared mode.

This is optional. If you do not set one, Superseedr derives a host identity
automatically.

### `clear-host-id`

```bash
superseedr clear-host-id
```

Remove the persisted shared host identity.

### `show-host-id`

```bash
superseedr show-host-id
```

Show the effective host identity and its source.

Host-id precedence is:

1. `SUPERSEEDR_SHARED_HOST_ID`
2. persisted launcher host-id sidecar
3. hostname fallback

### `to-shared`

```bash
superseedr to-shared <PATH>
```

Convert the current standalone config into layered shared config at the given
shared root.

### `to-standalone`

```bash
superseedr to-standalone
```

Convert the active shared config back into local standalone config.

### `torrents`

```bash
superseedr torrents
```

List configured torrents.

### `info`

```bash
superseedr info <INFO_HASH_HEX_OR_PATH>
```

Show a single torrent by info hash or unique file path.

### `status`

```bash
superseedr status [--follow | --stop | --interval <SECONDS>]
```

Read status, stream status updates, or adjust standalone runtime status dumping.

Behavior:

- plain `status`: prints one current snapshot
- `--follow`: continuously prints new status snapshots
- `--interval <SECONDS>`: changes standalone runtime dump interval
- `--stop`: stops standalone runtime status dumping

Shared-mode rules:

- shared CLI status follows the current leader snapshot
- `status --follow` works in shared mode
- non-stream start/stop controls are not supported in shared mode because shared leaders always keep cluster status snapshots enabled
- if no shared leader is running, `status` falls back to offline shared state

### `pause`

```bash
superseedr pause <INFO_HASH_HEX_OR_PATH>...
```

Pause one or more torrents.

### `resume`

```bash
superseedr resume <INFO_HASH_HEX_OR_PATH>...
```

Resume one or more torrents.

### `remove`

```bash
superseedr remove <INFO_HASH_HEX_OR_PATH>...
```

Remove one or more torrents from desired state without deleting payload data.

### `purge`

```bash
superseedr purge <INFO_HASH_HEX_OR_PATH>...
```

Remove one or more torrents and delete payload data when the file layout can be
resolved safely.

### `files`

```bash
superseedr files <INFO_HASH_HEX_OR_PATH>
```

List files for a torrent, including relative and resolved full paths when
available.

### `priority`

```bash
superseedr priority <INFO_HASH_HEX_OR_PATH> (--file-index <N> | --file-path <PATH>) <normal|high|skip>
```

Set priority for one file within a torrent.

Target the file by:

- `--file-index`
- `--file-path`

## Online And Offline Behavior

### Standalone Online

With a running standalone client, control commands queue to the local runtime.

Examples:

- `pause`
- `resume`
- `remove`
- `priority`
- `stop-client`

### Standalone Offline

When no standalone runtime is running, supported commands operate from persisted
local state.

Offline-capable read commands:

- `status`
- `journal`
- `torrents`
- `info`
- `files`

Offline-capable mutation commands:

- `pause`
- `resume`
- `remove`
- `priority`
- `purge` when the file layout can be resolved safely

### Shared Online

With a running shared leader:

- shared read commands follow cluster state
- mutating commands queue through the shared inbox for the leader

Examples:

- follower-issued `pause` is queued and applied by the leader
- shared `status` reads the leader snapshot

### Shared Offline

When shared mode is enabled but no leader is running:

- shared `status` falls back to offline shared state
- offline-capable shared mutations write shared config directly instead of queueing

Offline-capable shared mutations:

- `pause`
- `resume`
- `remove`
- `priority`
- `purge` when the file layout can be resolved safely

## Shared Mode Notes

### Cross-Host `.torrent` Adds

In shared mode, a `.torrent` path is only portable across hosts if the `.torrent`
file lives on the shared root.

Good:

```bash
superseedr add "/shared/root/shared-fixtures/example.torrent"
```

Not portable across hosts:

```bash
superseedr add "/home/me/local-only/example.torrent"
```

Magnet links are naturally portable across hosts.

### Shared Status Behavior

Shared leaders always keep cluster status snapshots enabled.

That means:

- `status --follow` is supported in shared mode
- `status --interval ...` is not supported in shared mode
- `status --stop` is not supported in shared mode

### Shared Root Requirements

Shared runtime startup requires:

- an existing shared root
- a writable shared root
- write access to the host-specific shared runtime area

If the shared root is missing or not writable, startup fails with an explicit
shared-root accessibility error.

See [`docs/shared-config.md`](shared-config.md) for the full shared-mode and
cluster guide.

## JSON Output

With `--json`, successful commands return a common envelope:

```json
{
  "ok": true,
  "command": "status",
  "data": {}
}
```

Errors return:

```json
{
  "ok": false,
  "command": "status",
  "error": "..."
}
```