Skip to content

Commit 38682c7

Browse files
add some clarifications to the readme
1 parent 6872321 commit 38682c7

File tree

2 files changed

+24
-121
lines changed

2 files changed

+24
-121
lines changed

README.md

Lines changed: 23 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
# noisytransfer-cli
22

3-
Fast E2EE WebRTC file transfer (DTLS by default, optional PQ) with human-readable pairing codes.
3+
Fast end-to-end encrypted (E2EE) file transfer over WebRTC with short, human-readable pairing codes. The CLI speaks DTLS by default and can opt-in to a post-quantum (PQ) handshake with SAS confirmation.
44

5-
- Post-quantum (PQ) mode with SAS verification for authenticated setup.
6-
- Fast, E2EE transfers over WebRTC data channels (DTLS by default).
7-
- Code-based rendezvous (no accounts or prior pairing).
8-
- Single file, directory, or multiple paths (multi-path → `.tar` on the wire).
9-
- Prebuilt binaries for Linux/macOS/Windows, or build from source.
5+
## Installation
106

11-
## Install
7+
Requires Node.js **22 or newer** for development builds.
128

139
### npm
1410

1511
```bash
16-
npm i -g noisytransfer-cli
12+
# CLI (global)
13+
npm i -g @noisytransfer/cli
1714
# or as a lib:
18-
npm i noisytransfer-cli
15+
16+
# library usage (local dependency)
17+
npm i @noisystransfer/cli
18+
19+
# quick try without installing
20+
npx noisytransfer-cli --help
1921
```
2022

2123
### Binaries
2224

23-
Download from your releases (or build locally):
25+
Download the latest release artifacts or build them locally:
2426

2527
```bash
2628
# local build
2729
npm run build
28-
npm run pkg
29-
# binaries in ./release or ./dist (based on your scripts)
30+
npm pack
3031
```
3132

3233
## Quick start
@@ -44,9 +45,9 @@ nt send report.pdf ./docs ./assets
4445
You’ll see:
4546

4647
```
47-
Code: 49b47940
48-
nt 49b47940
49-
nt recv --code 49b47940 --relay http://127.0.0.1:40971
48+
Code: 4932
49+
nt 4932
50+
nt recv 4932
5051
```
5152

5253
### Receive
@@ -55,39 +56,22 @@ You can use **any** of the following:
5556

5657
```bash
5758
# simplest: positional shorthand
58-
nt 49b47940
59+
nt 4932
5960

6061
# explicit command & code, default output = current dir
61-
nt recv 49b47940
62-
63-
# or with an explicit output directory
64-
nt recv ./downloads 49b47940
65-
66-
# or with the flag form
67-
nt recv ./downloads --code 49b47940
68-
69-
# skip redeem if you already have the appID
70-
nt recv ./downloads --app 49b47940-0cb1-43b3-bdb9-6f7f31f9a47d
71-
```
72-
73-
To write to stdout:
74-
75-
```bash
76-
nt recv - --code 49b47940 > received.bin
62+
nt recv 4932
7763
```
7864

7965
### Post-quantum (PQ) mode
8066

81-
Append `-pq` to the code or pass `--pq`:
67+
Pass `--pq`:
8268

8369
```bash
8470
# sender prints "Code: 5527e74d-pq"
85-
nt send --pq ./big.iso
86-
71+
nt send ./big.iso --pq
72+
> Code: 4932
8773
# receiver can use the suffix, or just --pq explicitly
88-
nt recv ./downloads 5527e74d-pq
89-
# or
90-
nt recv ./downloads --code 5527e74d --pq
74+
nt recv 1234-pq ./downloads
9175
```
9276

9377
## Behavior & flags
@@ -96,75 +80,9 @@ nt recv ./downloads --code 5527e74d --pq
9680
- Multi-path sends are **tarred**; receiver writes `bundle.tar`. If a file exists and `--overwrite` is not set, the receiver dedupes as `bundle-1.tar`, `bundle-2.tar`, …
9781
- `--overwrite`: replace existing file instead of deduping.
9882
- `-y, --yes`: auto-accept SAS (useful for non-interactive invocations). Does **not** imply `--overwrite`.
99-
- `--json`: JSON logs on stderr (all debug routed through the logger).
10083
- `-v` (repeatable): increase verbosity; includes `[NT_DEBUG]` traces.
10184
- Filenames are sanitized on the receiver (no path traversal / reserved names). Output directory is always the **receiver’s** choice.
10285

103-
## Logging
104-
105-
- Human-facing lines (stable for scripts/tests):
106-
- `Code: …`, `nt …` hints
107-
- `Receiving → …`
108-
- SAS lines: `[SAS A] …`, `[SAS B] …`
109-
- The two-column progress line
110-
111-
- Debug: `-v` or `NT_DEBUG=1` (on stderr).
112-
- Structured: `--json` (each line is a JSON object on stderr).
113-
114-
Example:
115-
116-
```bash
117-
nt send ./file -v --json 2> send.jsonl
118-
```
119-
120-
## Programmatic API
121-
122-
```js
123-
import { send, recv, createCode, redeemCode } from "noisytransfer-cli";
124-
125-
// receive into ./downloads (auto-redeem code)
126-
const r = await recv("./downloads", {
127-
relay: "http://127.0.0.1:40971",
128-
yes: true,
129-
code: "49b47940",
130-
});
131-
// r = { bytesWritten, announcedBytes, label, path, mode, appID }
132-
133-
await send(["./file.txt"], { relay: "http://127.0.0.1:40971", yes: true });
134-
```
135-
136-
TypeScript types are included. Key shapes:
137-
138-
```ts
139-
type Mode = "dtls" | "pq";
140-
141-
interface CommonOpts {
142-
relay?: string;
143-
headers?: Record<string, string>;
144-
pq?: boolean;
145-
yes?: boolean;
146-
}
147-
interface SendOptions extends CommonOpts {
148-
app?: string;
149-
name?: string;
150-
stdinName?: string;
151-
size?: number;
152-
}
153-
interface RecvOptions extends CommonOpts {
154-
app?: string;
155-
overwrite?: boolean;
156-
}
157-
158-
interface RecvResult {
159-
bytesWritten: number;
160-
announcedBytes: number;
161-
label: string | null;
162-
path: string | null;
163-
mode: Mode;
164-
appID: string;
165-
}
166-
```
167-
16886
## Build from source
16987

17088
Requirements: Node 18+.
@@ -180,15 +98,7 @@ npm test
18098
npm run build
18199

182100
# make standalone binaries (Linux/macOS/Windows)
183-
npm run pkg
184-
```
185-
186-
If your CI uses `npm ci`, commit `package-lock.json`:
187-
188-
```bash
189-
npm i --package-lock-only
190-
git add package-lock.json
191-
git commit -m "chore: lockfile"
101+
npm pack
192102
```
193103

194104
## Security model (short)
@@ -197,12 +107,6 @@ git commit -m "chore: lockfile"
197107
- Rendezvous codes are short-lived; both sides display a 6-digit SAS you can compare out-of-band.
198108
- The receiver owns the destination directory; announced filenames are sanitized to safe **leaf** names.
199109

200-
## Troubleshooting
201-
202-
- **“recv: either --code or --app is required”** – pass a code: `nt recv ./out --code <8-hex>` or just `nt <code>`.
203-
- **NAT / firewalls** – set `--relay` to your reachable rendezvous service.
204-
- **Windows** – native WebRTC addon is embedded; if you build locally, ensure the `.node` is present in `assets/native/win32-*` (your scripts copy these into `dist/assets/native/...` for the binary).
205-
206110
## Future features
207111
Status: currently disabled/broken; will be re-enabled with proper tests.
208112

@@ -235,7 +139,6 @@ cat report.pdf | nt send - --stdin-name report.pdf
235139
# default would be "stdin.bin" if omitted
236140
```
237141

238-
239142
## License
240143

241144
AGPL-3.0-only

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "noisytransfer-cli",
2+
"name": "@noisytransfer/cli",
33
"version": "0.2.1",
44
"description": "Fast E2EE WebRTC file transfer (DTLS by default, optional PQ) with human-readable pairing codes.",
55
"license": "AGPL-3.0-only",

0 commit comments

Comments
 (0)