scp-next 1.0.16 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,15 @@ scp-next download /var/log/example.log ./logs/example.log \
|
|
|
70
70
|
--password your-password
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
Output:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Downloading: /var/log/example.log 1.0 MB / 1.0 MB (100%)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Password arguments are convenient, but they may be exposed through shell history and process listings.
|
|
80
|
+
Prefer `SCP_NEXT_PASSWORD`, SSH agents, or protected private-key files for shared or production environments.
|
|
81
|
+
|
|
73
82
|
Use the library:
|
|
74
83
|
|
|
75
84
|
```ts
|
|
@@ -108,44 +117,66 @@ Destination paths follow familiar `cp`/`scp` behavior. If the destination exists
|
|
|
108
117
|
|
|
109
118
|
### Upload Examples
|
|
110
119
|
|
|
111
|
-
|
|
120
|
+
Preview a recursive deploy before connecting:
|
|
112
121
|
|
|
113
122
|
```bash
|
|
114
123
|
scp-next upload ./dist /var/www/example \
|
|
115
124
|
--host your-host \
|
|
116
125
|
--username your-username \
|
|
117
126
|
--password your-password \
|
|
118
|
-
--recursive
|
|
127
|
+
--recursive \
|
|
128
|
+
--dry-run
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Deploy with overwrite and verbose diagnostics:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
scp-next upload ./dist /var/www/example \
|
|
135
|
+
--host your-host \
|
|
136
|
+
--username your-username \
|
|
137
|
+
--password your-password \
|
|
138
|
+
--recursive \
|
|
139
|
+
--overwrite \
|
|
140
|
+
--verbose
|
|
119
141
|
```
|
|
120
142
|
|
|
121
|
-
|
|
143
|
+
Use an encrypted private key:
|
|
122
144
|
|
|
123
145
|
```bash
|
|
124
146
|
scp-next upload ./dist /var/www/example \
|
|
125
147
|
--host your-host \
|
|
126
148
|
--username your-username \
|
|
127
149
|
--private-key-file ~/.ssh/id_ed25519 \
|
|
150
|
+
--passphrase your-passphrase \
|
|
128
151
|
--recursive
|
|
129
152
|
```
|
|
130
153
|
|
|
131
154
|
### Download Examples
|
|
132
155
|
|
|
133
|
-
|
|
156
|
+
Download a remote directory recursively:
|
|
134
157
|
|
|
135
158
|
```bash
|
|
136
|
-
scp-next download /var/log/example
|
|
159
|
+
scp-next download /var/log/example ./logs/example \
|
|
137
160
|
--host your-host \
|
|
138
161
|
--username your-username \
|
|
139
|
-
--password your-password
|
|
162
|
+
--password your-password \
|
|
163
|
+
--recursive
|
|
140
164
|
```
|
|
141
165
|
|
|
142
|
-
|
|
166
|
+
Download and overwrite an existing local file:
|
|
143
167
|
|
|
144
168
|
```bash
|
|
145
169
|
scp-next download /var/log/example.log ./logs/example.log \
|
|
146
170
|
--host your-host \
|
|
147
171
|
--username your-username \
|
|
148
|
-
--
|
|
172
|
+
--password your-password \
|
|
173
|
+
--overwrite
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Run a configured download job:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
scp-next run download-logs --config ./scp-next.config.json
|
|
149
180
|
```
|
|
150
181
|
|
|
151
182
|
### CLI Options
|
|
@@ -257,12 +288,10 @@ await upload({
|
|
|
257
288
|
|
|
258
289
|
### Configuration Files
|
|
259
290
|
|
|
260
|
-
`scp-next`
|
|
291
|
+
Use `scp-next.config.json` in the current directory. `scp-next` also auto-detects these rc-style filenames: `.scp-nextrc`, `.scp-nextrc.json`.
|
|
261
292
|
|
|
262
293
|
```text
|
|
263
294
|
scp-next.config.json
|
|
264
|
-
.scp-nextrc
|
|
265
|
-
.scp-nextrc.json
|
|
266
295
|
```
|
|
267
296
|
|
|
268
297
|
Use `--config` for an explicit path:
|
|
@@ -298,6 +327,8 @@ Example:
|
|
|
298
327
|
}
|
|
299
328
|
```
|
|
300
329
|
|
|
330
|
+
Do not commit configuration files containing real passwords. Prefer `SCP_NEXT_PASSWORD` or another protected secret source for shared repositories and deployment environments.
|
|
331
|
+
|
|
301
332
|
Configuration file options:
|
|
302
333
|
|
|
303
334
|
| Key | Description |
|
|
@@ -396,7 +427,7 @@ Bash:
|
|
|
396
427
|
```bash
|
|
397
428
|
export SCP_NEXT_HOST="your-host"
|
|
398
429
|
export SCP_NEXT_USERNAME="your-username"
|
|
399
|
-
export
|
|
430
|
+
export SCP_NEXT_PASSWORD="your-password"
|
|
400
431
|
scp-next upload ./dist /var/www/example --recursive
|
|
401
432
|
```
|
|
402
433
|
|
|
@@ -405,7 +436,7 @@ PowerShell:
|
|
|
405
436
|
```powershell
|
|
406
437
|
$env:SCP_NEXT_HOST = "your-host"
|
|
407
438
|
$env:SCP_NEXT_USERNAME = "your-username"
|
|
408
|
-
$env:
|
|
439
|
+
$env:SCP_NEXT_PASSWORD = "your-password"
|
|
409
440
|
scp-next upload .\dist /var/www/example --recursive
|
|
410
441
|
```
|
|
411
442
|
|