@tinyrack/devsync 1.3.0 → 1.4.0
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 +116 -78
- package/dist/cli/base-command.d.ts +3 -0
- package/dist/cli/base-command.d.ts.map +1 -1
- package/dist/cli/base-command.js +7 -1
- package/dist/cli/base-command.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +3 -4
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/index.d.ts +4 -4
- package/dist/cli/commands/index.js +4 -4
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +1 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/{machine → profile}/list.d.ts +1 -1
- package/dist/cli/commands/profile/list.d.ts.map +1 -0
- package/dist/cli/commands/profile/list.js +14 -0
- package/dist/cli/commands/profile/list.js.map +1 -0
- package/dist/cli/commands/{machine → profile}/use.d.ts +2 -2
- package/dist/cli/commands/{machine → profile}/use.d.ts.map +1 -1
- package/dist/cli/commands/profile/use.js +26 -0
- package/dist/cli/commands/profile/use.js.map +1 -0
- package/dist/cli/commands/pull.d.ts +1 -1
- package/dist/cli/commands/pull.d.ts.map +1 -1
- package/dist/cli/commands/pull.js +7 -8
- package/dist/cli/commands/pull.js.map +1 -1
- package/dist/cli/commands/push.d.ts +1 -1
- package/dist/cli/commands/push.d.ts.map +1 -1
- package/dist/cli/commands/push.js +6 -7
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/status.d.ts +1 -1
- package/dist/cli/commands/status.d.ts.map +1 -1
- package/dist/cli/commands/status.js +8 -9
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/track.d.ts +1 -1
- package/dist/cli/commands/track.d.ts.map +1 -1
- package/dist/cli/commands/track.js +18 -18
- package/dist/cli/commands/track.js.map +1 -1
- package/dist/cli/commands/untrack.d.ts.map +1 -1
- package/dist/cli/commands/untrack.js +2 -3
- package/dist/cli/commands/untrack.js.map +1 -1
- package/dist/config/global-config.d.ts +7 -7
- package/dist/config/global-config.js +11 -11
- package/dist/config/platform.d.ts +3 -3
- package/dist/config/platform.d.ts.map +1 -1
- package/dist/config/platform.js +1 -1
- package/dist/config/platform.js.map +1 -1
- package/dist/config/sync.d.ts +17 -18
- package/dist/config/sync.d.ts.map +1 -1
- package/dist/config/sync.js +48 -49
- package/dist/config/sync.js.map +1 -1
- package/dist/config/xdg.js +1 -1
- package/dist/config/xdg.js.map +1 -1
- package/dist/lib/output.d.ts +24 -16
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +179 -146
- package/dist/lib/output.js.map +1 -1
- package/dist/services/add.d.ts +3 -4
- package/dist/services/add.d.ts.map +1 -1
- package/dist/services/add.js +38 -40
- package/dist/services/add.js.map +1 -1
- package/dist/services/config-file.d.ts +3 -3
- package/dist/services/config-file.js +3 -3
- package/dist/services/config-file.js.map +1 -1
- package/dist/services/doctor.d.ts +2 -3
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +23 -20
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/filesystem.d.ts +2 -3
- package/dist/services/filesystem.d.ts.map +1 -1
- package/dist/services/filesystem.js +0 -1
- package/dist/services/filesystem.js.map +1 -1
- package/dist/services/forget.d.ts +1 -2
- package/dist/services/forget.d.ts.map +1 -1
- package/dist/services/forget.js +20 -18
- package/dist/services/forget.js.map +1 -1
- package/dist/services/init.d.ts +1 -2
- package/dist/services/init.d.ts.map +1 -1
- package/dist/services/init.js +19 -20
- package/dist/services/init.js.map +1 -1
- package/dist/services/local-materialization.d.ts +1 -1
- package/dist/services/local-materialization.js +4 -4
- package/dist/services/local-snapshot.d.ts +1 -1
- package/dist/services/local-snapshot.js +4 -4
- package/dist/services/local-snapshot.js.map +1 -1
- package/dist/services/paths.d.ts +3 -7
- package/dist/services/paths.d.ts.map +1 -1
- package/dist/services/paths.js +2 -3
- package/dist/services/paths.js.map +1 -1
- package/dist/services/profile.d.ts +39 -0
- package/dist/services/profile.d.ts.map +1 -0
- package/dist/services/profile.js +117 -0
- package/dist/services/profile.js.map +1 -0
- package/dist/services/pull.d.ts +5 -5
- package/dist/services/pull.d.ts.map +1 -1
- package/dist/services/pull.js +15 -12
- package/dist/services/pull.js.map +1 -1
- package/dist/services/push.d.ts +5 -5
- package/dist/services/push.d.ts.map +1 -1
- package/dist/services/push.js +16 -14
- package/dist/services/push.js.map +1 -1
- package/dist/services/repo-artifacts.d.ts +9 -9
- package/dist/services/repo-artifacts.js +22 -22
- package/dist/services/repo-snapshot.js +12 -12
- package/dist/services/runtime.d.ts +11 -20
- package/dist/services/runtime.d.ts.map +1 -1
- package/dist/services/runtime.js +20 -27
- package/dist/services/runtime.js.map +1 -1
- package/dist/services/set.d.ts +7 -9
- package/dist/services/set.d.ts.map +1 -1
- package/dist/services/set.js +24 -24
- package/dist/services/set.js.map +1 -1
- package/dist/services/status.d.ts +5 -7
- package/dist/services/status.d.ts.map +1 -1
- package/dist/services/status.js +16 -14
- package/dist/services/status.js.map +1 -1
- package/package.json +7 -7
- package/dist/cli/commands/machine/list.d.ts.map +0 -1
- package/dist/cli/commands/machine/list.js +0 -12
- package/dist/cli/commands/machine/list.js.map +0 -1
- package/dist/cli/commands/machine/use.js +0 -28
- package/dist/cli/commands/machine/use.js.map +0 -1
- package/dist/services/machine.d.ts +0 -40
- package/dist/services/machine.d.ts.map +0 -1
- package/dist/services/machine.js +0 -113
- package/dist/services/machine.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
# devsync
|
|
2
2
|
|
|
3
|
-
`devsync` is a cross-platform CLI for managing the configuration files in your home directory with git and syncing them across multiple
|
|
3
|
+
`devsync` is a cross-platform CLI for managing the configuration files in your home directory with git and syncing them across multiple devices.
|
|
4
4
|
|
|
5
|
-
Instead of treating the repository as the source of truth, `devsync` treats your actual local config as the truth. You choose files and directories under `HOME`, `devsync` mirrors them into a git-backed sync repository, and later restores that repository onto another
|
|
5
|
+
Instead of treating the repository as the source of truth, `devsync` treats your actual local config as the truth. You choose files and directories under `HOME`, `devsync` mirrors them into a git-backed sync repository, and later restores that repository onto another device when you need it.
|
|
6
6
|
|
|
7
7
|
## 1. Purpose and how it differs
|
|
8
8
|
|
|
9
|
-
Most dotfiles tools start from the repository and ask you to shape your local
|
|
9
|
+
Most dotfiles tools start from the repository and ask you to shape your local system around it.
|
|
10
10
|
|
|
11
11
|
`devsync` takes the opposite approach:
|
|
12
12
|
|
|
13
13
|
- Your real config under `HOME` is the source of truth.
|
|
14
14
|
- The git repository is a sync artifact, not the primary authoring location.
|
|
15
|
-
- `push` captures your current
|
|
16
|
-
- `pull` applies the repository back onto another
|
|
15
|
+
- `push` captures your current local state into the repository.
|
|
16
|
+
- `pull` applies the repository back onto another device.
|
|
17
17
|
|
|
18
18
|
That makes `devsync` a good fit when you want to:
|
|
19
19
|
|
|
20
20
|
- manage existing dotfiles and app configs without reorganizing your home directory,
|
|
21
|
-
- keep
|
|
21
|
+
- keep profile-specific config workflows intact,
|
|
22
22
|
- sync plain files and encrypted secrets together,
|
|
23
|
-
- use normal git remotes as the transport layer between PCs
|
|
23
|
+
- use normal git remotes as the transport layer between PCs,
|
|
24
|
+
- handle platform-specific paths across Windows, macOS, and Linux.
|
|
24
25
|
|
|
25
26
|
Core capabilities:
|
|
26
27
|
|
|
@@ -28,6 +29,8 @@ Core capabilities:
|
|
|
28
29
|
- store synced artifacts in `~/.config/devsync/sync`,
|
|
29
30
|
- mark paths as `normal`, `secret`, or `ignore`,
|
|
30
31
|
- encrypt secret artifacts with `age`,
|
|
32
|
+
- assign entries to profiles so different machines sync different subsets,
|
|
33
|
+
- support platform-specific local paths per entry,
|
|
31
34
|
- preview both directions with `status`, `push --dry-run`, and `pull --dry-run`.
|
|
32
35
|
|
|
33
36
|
## 2. Installation
|
|
@@ -71,9 +74,9 @@ devsync init
|
|
|
71
74
|
Track a few configs:
|
|
72
75
|
|
|
73
76
|
```bash
|
|
74
|
-
devsync
|
|
75
|
-
devsync
|
|
76
|
-
devsync
|
|
77
|
+
devsync track ~/.gitconfig
|
|
78
|
+
devsync track ~/.zshrc
|
|
79
|
+
devsync track ~/.config/mytool --mode secret
|
|
77
80
|
```
|
|
78
81
|
|
|
79
82
|
Review what would be captured:
|
|
@@ -92,14 +95,13 @@ devsync push
|
|
|
92
95
|
Open the sync repository and publish it with git:
|
|
93
96
|
|
|
94
97
|
```bash
|
|
95
|
-
devsync
|
|
96
|
-
git status
|
|
98
|
+
cd "$(devsync dir)"
|
|
97
99
|
git add .
|
|
98
100
|
git commit -m "Update synced config"
|
|
99
101
|
git push
|
|
100
102
|
```
|
|
101
103
|
|
|
102
|
-
On another
|
|
104
|
+
On another device, clone and restore from the same repo:
|
|
103
105
|
|
|
104
106
|
```bash
|
|
105
107
|
devsync init https://example.com/my-sync-repo.git
|
|
@@ -118,7 +120,7 @@ Notes:
|
|
|
118
120
|
|
|
119
121
|
### How tracking works
|
|
120
122
|
|
|
121
|
-
- You
|
|
123
|
+
- You track files or directories that live under your home directory.
|
|
122
124
|
- `devsync` mirrors them into `~/.config/devsync/sync/default/<repoPath>` for the default profile, or `~/.config/devsync/sync/<profile>/<repoPath>` for a named profile.
|
|
123
125
|
- Plain artifacts are stored as-is.
|
|
124
126
|
- Secret artifacts are stored with the `.devsync.secret` suffix.
|
|
@@ -138,58 +140,81 @@ Each tracked path can use one of three modes:
|
|
|
138
140
|
- `secret`: encrypt before storing in the repo
|
|
139
141
|
- `ignore`: skip during push and pull
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
Set modes when tracking, or update them later:
|
|
142
144
|
|
|
143
|
-
|
|
145
|
+
```bash
|
|
146
|
+
devsync track ~/.config/mytool --mode secret
|
|
147
|
+
devsync track ~/.config/mytool/cache --mode ignore
|
|
148
|
+
devsync track ~/.config/mytool/public.json --mode normal
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Child entries inside a tracked directory inherit the parent mode unless explicitly overridden.
|
|
144
152
|
|
|
145
|
-
|
|
153
|
+
### Profiles
|
|
154
|
+
|
|
155
|
+
Profiles let you sync different subsets of entries on different machines. Each entry can be assigned to one or more profiles. When a profile is active, only entries assigned to that profile (plus entries with no profile restriction) are synced.
|
|
146
156
|
|
|
147
157
|
```bash
|
|
148
|
-
devsync
|
|
149
|
-
devsync
|
|
150
|
-
devsync
|
|
151
|
-
devsync
|
|
158
|
+
devsync track ~/.ssh/config --mode secret --profile work
|
|
159
|
+
devsync track ~/.gitconfig --profile work --profile personal
|
|
160
|
+
devsync track ~/.zshrc
|
|
161
|
+
devsync profile use work
|
|
162
|
+
devsync profile list
|
|
152
163
|
```
|
|
153
164
|
|
|
154
|
-
|
|
165
|
+
Key behaviors:
|
|
166
|
+
|
|
167
|
+
- Entries without `--profile` are synced on all profiles (including when no profile is active).
|
|
168
|
+
- Entries with `--profile` are only synced when one of the listed profiles is active.
|
|
169
|
+
- Pass `--profile ''` to clear profile restrictions from an entry.
|
|
170
|
+
- The `default` profile namespace is reserved for entries with no profile restriction.
|
|
171
|
+
- Commands like `push`, `pull`, and `status` accept `--profile` to override the active profile for a single operation.
|
|
155
172
|
|
|
156
|
-
-
|
|
157
|
-
- Use `devsync set --profile <name>` only for child paths inside tracked directories.
|
|
158
|
-
- Profile-specific rules inherit the parent root mode and only override nested paths.
|
|
159
|
-
- Named profile artifacts are stored under `<profile>/<repoPath>`.
|
|
160
|
-
- `default` is reserved for the base layout and cannot be used as a named profile.
|
|
161
|
-
- Standalone profiled roots and profiled file entries are not supported.
|
|
173
|
+
### Platform-specific paths
|
|
162
174
|
|
|
163
|
-
|
|
175
|
+
Entries can specify different local paths per platform, so the same sync config works across Windows, macOS, and Linux:
|
|
176
|
+
|
|
177
|
+
Example `manifest.json`:
|
|
164
178
|
|
|
165
179
|
```json
|
|
166
180
|
{
|
|
167
|
-
"version":
|
|
181
|
+
"version": 6,
|
|
168
182
|
"age": {
|
|
169
183
|
"identityFile": "$XDG_CONFIG_HOME/devsync/age/keys.txt",
|
|
170
184
|
"recipients": ["age1example..."]
|
|
171
185
|
},
|
|
172
186
|
"entries": [
|
|
187
|
+
{
|
|
188
|
+
"kind": "file",
|
|
189
|
+
"localPath": {
|
|
190
|
+
"default": "~/.gitconfig",
|
|
191
|
+
"win": "%USERPROFILE%/.gitconfig"
|
|
192
|
+
},
|
|
193
|
+
"mode": "normal"
|
|
194
|
+
},
|
|
173
195
|
{
|
|
174
196
|
"kind": "directory",
|
|
175
|
-
"localPath":
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"cache/": "ignore"
|
|
197
|
+
"localPath": {
|
|
198
|
+
"default": "~/.config/mytool",
|
|
199
|
+
"win": "%APPDATA%/mytool"
|
|
179
200
|
},
|
|
180
|
-
"
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
201
|
+
"mode": "normal",
|
|
202
|
+
"profiles": ["work"]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"kind": "file",
|
|
206
|
+
"localPath": {
|
|
207
|
+
"default": "~/.config/mytool/token.json"
|
|
186
208
|
},
|
|
187
|
-
"
|
|
209
|
+
"mode": "secret",
|
|
210
|
+
"profiles": ["work"]
|
|
188
211
|
}
|
|
189
212
|
]
|
|
190
213
|
}
|
|
191
214
|
```
|
|
192
215
|
|
|
216
|
+
The `localPath` object supports `default`, `win`, `mac`, and `linux` keys. The `default` key is required and is used as a fallback when no platform-specific path is set for the current OS.
|
|
217
|
+
|
|
193
218
|
### Common workflow
|
|
194
219
|
|
|
195
220
|
Check what changed:
|
|
@@ -204,7 +229,7 @@ Capture local config into the repository:
|
|
|
204
229
|
devsync push
|
|
205
230
|
```
|
|
206
231
|
|
|
207
|
-
Restore repository state
|
|
232
|
+
Restore repository state locally:
|
|
208
233
|
|
|
209
234
|
```bash
|
|
210
235
|
devsync pull
|
|
@@ -217,6 +242,14 @@ devsync push --dry-run
|
|
|
217
242
|
devsync pull --dry-run
|
|
218
243
|
```
|
|
219
244
|
|
|
245
|
+
Override the active profile for a single operation:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
devsync push --profile work
|
|
249
|
+
devsync pull --profile personal
|
|
250
|
+
devsync status --profile work
|
|
251
|
+
```
|
|
252
|
+
|
|
220
253
|
### Command reference
|
|
221
254
|
|
|
222
255
|
#### `init`
|
|
@@ -229,47 +262,31 @@ devsync init https://example.com/my-sync-repo.git
|
|
|
229
262
|
devsync init --identity "$XDG_CONFIG_HOME/devsync/age/keys.txt" --recipient age1...
|
|
230
263
|
```
|
|
231
264
|
|
|
232
|
-
#### `
|
|
265
|
+
#### `track`
|
|
233
266
|
|
|
234
267
|
Track a file or directory under your home directory.
|
|
235
268
|
|
|
236
269
|
```bash
|
|
237
|
-
devsync
|
|
238
|
-
devsync
|
|
239
|
-
devsync
|
|
270
|
+
devsync track ~/.gitconfig
|
|
271
|
+
devsync track ~/.gitconfig ~/.zshrc ~/.config/nvim
|
|
272
|
+
devsync track ~/.ssh/config --mode secret
|
|
273
|
+
devsync track ~/.ssh/config --mode secret --profile work
|
|
274
|
+
devsync track ~/.config/mytool/cache --mode ignore
|
|
240
275
|
```
|
|
241
276
|
|
|
242
|
-
|
|
277
|
+
If the target is already tracked, its mode is updated. Targets may also be repository paths inside a tracked directory to create child entries with a specific mode.
|
|
243
278
|
|
|
244
|
-
#### `
|
|
279
|
+
#### `untrack`
|
|
245
280
|
|
|
246
|
-
|
|
281
|
+
Remove a tracked entry from the sync config.
|
|
247
282
|
|
|
248
283
|
```bash
|
|
249
|
-
devsync
|
|
250
|
-
devsync
|
|
251
|
-
devsync
|
|
284
|
+
devsync untrack ~/.gitconfig
|
|
285
|
+
devsync untrack ~/.config/mytool
|
|
286
|
+
devsync untrack .config/mytool/token.json
|
|
252
287
|
```
|
|
253
288
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
#### `forget`
|
|
257
|
-
|
|
258
|
-
Remove a tracked path or nested override from config.
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
devsync forget ~/.gitconfig
|
|
262
|
-
devsync forget ~/.config/mytool
|
|
263
|
-
devsync forget .config/mytool/token.json --profile work
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
#### `list`
|
|
267
|
-
|
|
268
|
-
Show tracked entries, default modes, root overrides, and profile-specific child overrides.
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
devsync list
|
|
272
|
-
```
|
|
289
|
+
This only updates the sync config; actual file changes happen on the next push or pull.
|
|
273
290
|
|
|
274
291
|
#### `status`
|
|
275
292
|
|
|
@@ -277,6 +294,7 @@ Preview planned push and pull changes.
|
|
|
277
294
|
|
|
278
295
|
```bash
|
|
279
296
|
devsync status
|
|
297
|
+
devsync status --profile work
|
|
280
298
|
```
|
|
281
299
|
|
|
282
300
|
#### `doctor`
|
|
@@ -294,24 +312,45 @@ Write local state into the sync repository.
|
|
|
294
312
|
```bash
|
|
295
313
|
devsync push
|
|
296
314
|
devsync push --dry-run
|
|
315
|
+
devsync push --profile work
|
|
297
316
|
```
|
|
298
317
|
|
|
299
318
|
#### `pull`
|
|
300
319
|
|
|
301
|
-
Apply repository state back onto
|
|
320
|
+
Apply repository state back onto local paths.
|
|
302
321
|
|
|
303
322
|
```bash
|
|
304
323
|
devsync pull
|
|
305
324
|
devsync pull --dry-run
|
|
325
|
+
devsync pull --profile work
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
#### `profile list`
|
|
329
|
+
|
|
330
|
+
Show configured profiles and which one is active.
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
devsync profile list
|
|
306
334
|
```
|
|
307
335
|
|
|
308
|
-
#### `
|
|
336
|
+
#### `profile use`
|
|
337
|
+
|
|
338
|
+
Set or clear the active sync profile.
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
devsync profile use work
|
|
342
|
+
devsync profile use
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Omit the profile name to clear the active profile.
|
|
346
|
+
|
|
347
|
+
#### `dir`
|
|
309
348
|
|
|
310
|
-
|
|
349
|
+
Print the sync repository path.
|
|
311
350
|
|
|
312
351
|
```bash
|
|
313
|
-
devsync
|
|
314
|
-
devsync
|
|
352
|
+
devsync dir
|
|
353
|
+
cd "$(devsync dir)"
|
|
315
354
|
```
|
|
316
355
|
|
|
317
356
|
For flag-level details, use built-in help:
|
|
@@ -319,8 +358,7 @@ For flag-level details, use built-in help:
|
|
|
319
358
|
```bash
|
|
320
359
|
devsync --help
|
|
321
360
|
devsync init --help
|
|
322
|
-
devsync
|
|
323
|
-
devsync set --help
|
|
361
|
+
devsync track --help
|
|
324
362
|
```
|
|
325
363
|
|
|
326
364
|
## Development
|
|
@@ -6,6 +6,9 @@ type CommandError = Error & {
|
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
export declare abstract class BaseCommand extends Command {
|
|
9
|
+
static baseFlags: {
|
|
10
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
};
|
|
9
12
|
protected print(output: string): void;
|
|
10
13
|
protected printError(message: Error | string): void;
|
|
11
14
|
catch(error: CommandError): Promise<unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../../src/cli/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../../src/cli/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAS7C,KAAK,YAAY,GAAG,KAAK,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAMF,8BAAsB,WAAY,SAAQ,OAAO;IAC/C,OAAuB,SAAS;;MAK9B;IAEF,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM;IAI9B,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,GAAG,MAAM;IAItB,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;CAQnE"}
|
package/dist/cli/base-command.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { Command } from "@oclif/core";
|
|
1
|
+
import { Command, Flags } from "@oclif/core";
|
|
2
2
|
import { formatErrorMessage, writeStderr, writeStdout, } from "#app/lib/output.js";
|
|
3
3
|
import { formatDevsyncError } from "#app/services/error.js";
|
|
4
4
|
const resolveExitCode = (error) => {
|
|
5
5
|
return error.oclif?.exit ?? error.exitCode ?? 1;
|
|
6
6
|
};
|
|
7
7
|
export class BaseCommand extends Command {
|
|
8
|
+
static baseFlags = {
|
|
9
|
+
verbose: Flags.boolean({
|
|
10
|
+
default: false,
|
|
11
|
+
summary: "Show detailed output including file paths",
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
8
14
|
print(output) {
|
|
9
15
|
writeStdout(output);
|
|
10
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-command.js","sourceRoot":"","sources":["../../src/cli/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"base-command.js","sourceRoot":"","sources":["../../src/cli/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAS5D,MAAM,eAAe,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC9C,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,MAAM,OAAgB,WAAY,SAAQ,OAAO;IACxC,MAAM,CAAU,SAAS,GAAG;QACjC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,2CAA2C;SACrD,CAAC;KACH,CAAC;IAEQ,KAAK,CAAC,MAAc;QAC5B,WAAW,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;IAES,UAAU,CAAC,OAAuB;QAC1C,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,CAAC;IAEe,KAAK,CAAC,KAAK,CAAC,KAAmB;QAC7C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC3C,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,OAAuB,OAAO,SAC2C;IAEzE,OAAuB,WAAW,SACsK;IAExM,OAAuB,QAAQ,WAA2C;IAEpD,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAU3C"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { BaseCommand } from "#app/cli/base-command.js";
|
|
2
2
|
import { formatSyncDoctorResult } from "#app/lib/output.js";
|
|
3
3
|
import { runSyncDoctor } from "#app/services/doctor.js";
|
|
4
|
-
import { createSyncContext } from "#app/services/runtime.js";
|
|
5
4
|
export default class SyncDoctor extends BaseCommand {
|
|
6
5
|
static summary = "Check sync repository, config, age identity, and tracked local paths";
|
|
7
6
|
static description = "Run health checks for the local sync setup, including repository availability, config validity, age identity configuration, and whether tracked local paths still exist where devsync expects them.";
|
|
8
7
|
static examples = ["<%= config.bin %> <%= command.id %>"];
|
|
9
8
|
async run() {
|
|
10
|
-
await this.parse(SyncDoctor);
|
|
11
|
-
const result = await runSyncDoctor(
|
|
12
|
-
this.print(formatSyncDoctorResult(result));
|
|
9
|
+
const { flags } = await this.parse(SyncDoctor);
|
|
10
|
+
const result = await runSyncDoctor(process.env);
|
|
11
|
+
this.print(formatSyncDoctorResult(result, { verbose: flags.verbose }));
|
|
13
12
|
if (result.hasFailures) {
|
|
14
13
|
this.exit(1);
|
|
15
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IAC1C,MAAM,CAAU,OAAO,GAC5B,sEAAsE,CAAC;IAElE,MAAM,CAAU,WAAW,GAChC,qMAAqM,CAAC;IAEjM,MAAM,CAAU,QAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAC;IAE1D,KAAK,CAAC,GAAG;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAEhD,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAEvE,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACf,CAAC;IACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import SyncDir from "#app/cli/commands/dir.js";
|
|
2
2
|
import SyncDoctor from "#app/cli/commands/doctor.js";
|
|
3
3
|
import SyncInit from "#app/cli/commands/init.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import SyncProfileList from "#app/cli/commands/profile/list.js";
|
|
5
|
+
import SyncProfileUse from "#app/cli/commands/profile/use.js";
|
|
6
6
|
import SyncPull from "#app/cli/commands/pull.js";
|
|
7
7
|
import SyncPush from "#app/cli/commands/push.js";
|
|
8
8
|
import SyncStatus from "#app/cli/commands/status.js";
|
|
@@ -12,8 +12,8 @@ export declare const COMMANDS: {
|
|
|
12
12
|
dir: typeof SyncDir;
|
|
13
13
|
doctor: typeof SyncDoctor;
|
|
14
14
|
init: typeof SyncInit;
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"profile:list": typeof SyncProfileList;
|
|
16
|
+
"profile:use": typeof SyncProfileUse;
|
|
17
17
|
pull: typeof SyncPull;
|
|
18
18
|
push: typeof SyncPush;
|
|
19
19
|
status: typeof SyncStatus;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import SyncDir from "#app/cli/commands/dir.js";
|
|
2
2
|
import SyncDoctor from "#app/cli/commands/doctor.js";
|
|
3
3
|
import SyncInit from "#app/cli/commands/init.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import SyncProfileList from "#app/cli/commands/profile/list.js";
|
|
5
|
+
import SyncProfileUse from "#app/cli/commands/profile/use.js";
|
|
6
6
|
import SyncPull from "#app/cli/commands/pull.js";
|
|
7
7
|
import SyncPush from "#app/cli/commands/push.js";
|
|
8
8
|
import SyncStatus from "#app/cli/commands/status.js";
|
|
@@ -12,8 +12,8 @@ export const COMMANDS = {
|
|
|
12
12
|
dir: SyncDir,
|
|
13
13
|
doctor: SyncDoctor,
|
|
14
14
|
init: SyncInit,
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"profile:list": SyncProfileList,
|
|
16
|
+
"profile:use": SyncProfileUse,
|
|
17
17
|
pull: SyncPull,
|
|
18
18
|
push: SyncPush,
|
|
19
19
|
status: SyncStatus,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,OAAuB,OAAO,SAA8C;IAE5E,OAAuB,WAAW,SAC8N;IAEhQ,OAAuB,QAAQ,WAI7B;IAEF,OAAuB,IAAI;;MAKzB;IAEF,OAAuB,KAAK;;;MAc1B;IAEoB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB3C"}
|
|
@@ -2,7 +2,6 @@ import { Args, Flags } from "@oclif/core";
|
|
|
2
2
|
import { BaseCommand } from "#app/cli/base-command.js";
|
|
3
3
|
import { formatSyncInitResult } from "#app/lib/output.js";
|
|
4
4
|
import { initializeSync } from "#app/services/init.js";
|
|
5
|
-
import { createSyncContext } from "#app/services/runtime.js";
|
|
6
5
|
export default class SyncInit extends BaseCommand {
|
|
7
6
|
static summary = "Initialize the git-backed sync directory";
|
|
8
7
|
static description = "Create or connect the local devsync repository under your XDG config directory, then store the sync settings used by later pull and push operations. If you omit the repository argument, devsync initializes a local git repository in the sync directory.";
|
|
@@ -36,7 +35,7 @@ export default class SyncInit extends BaseCommand {
|
|
|
36
35
|
identityFile: flags.identity,
|
|
37
36
|
recipients: flags.recipient ?? [],
|
|
38
37
|
repository: args.repository,
|
|
39
|
-
},
|
|
38
|
+
}, process.env), { verbose: flags.verbose });
|
|
40
39
|
this.print(output);
|
|
41
40
|
}
|
|
42
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IACxC,MAAM,CAAU,OAAO,GAAG,0CAA0C,CAAC;IAErE,MAAM,CAAU,WAAW,GAChC,6PAA6P,CAAC;IAEzP,MAAM,CAAU,QAAQ,GAAG;QAChC,qCAAqC;QACrC,0EAA0E;QAC1E,4GAA4G;KAC7G,CAAC;IAEK,MAAM,CAAU,IAAI,GAAG;QAC5B,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,kDAAkD;YAC/D,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH,CAAC;IAEK,MAAM,CAAU,KAAK,GAAG;QAC7B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;YACrB,SAAS,EAAE,MAAM;YACjB,OAAO,EAAE,mCAAmC;YAC5C,WAAW,EACT,gJAAgJ;SACnJ,CAAC;QACF,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC;YACtB,SAAS,EAAE,WAAW;YACtB,OAAO,EAAE,qCAAqC;YAC9C,WAAW,EACT,uIAAuI;YACzI,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAC;IAEc,KAAK,CAAC,GAAG;QACvB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,oBAAoB,CACjC,MAAM,cAAc,CAClB;YACE,YAAY,EAAE,KAAK,CAAC,QAAQ;YAC5B,UAAU,EAAE,KAAK,CAAC,SAAS,IAAI,EAAE;YACjC,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,EACD,OAAO,CAAC,GAAG,CACZ,EACD,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAC3B,CAAC;QAEF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,OAAuB,OAAO,SAA8C;IAE5E,OAAuB,WAAW,SACgH;IAE5H,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAS3C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from "#app/cli/base-command.js";
|
|
2
|
+
import { formatSyncProfileListResult } from "#app/lib/output.js";
|
|
3
|
+
import { listSyncProfiles } from "#app/services/profile.js";
|
|
4
|
+
export default class SyncProfileList extends BaseCommand {
|
|
5
|
+
static summary = "Show configured and active sync profiles";
|
|
6
|
+
static description = "List the profile names referenced by the current sync configuration and show which profile is active through ~/.config/devsync/settings.json.";
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(SyncProfileList);
|
|
9
|
+
this.print(formatSyncProfileListResult(await listSyncProfiles(process.env), {
|
|
10
|
+
verbose: flags.verbose,
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/cli/commands/profile/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IAC/C,MAAM,CAAU,OAAO,GAAG,0CAA0C,CAAC;IAErE,MAAM,CAAU,WAAW,GAChC,+IAA+I,CAAC;IAElI,KAAK,CAAC,GAAG;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAEpD,IAAI,CAAC,KAAK,CACR,2BAA2B,CAAC,MAAM,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC/D,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CACH,CAAC;IACJ,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseCommand } from "#app/cli/base-command.js";
|
|
2
|
-
export default class
|
|
2
|
+
export default class SyncProfileUse extends BaseCommand {
|
|
3
3
|
static summary: string;
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static args: {
|
|
7
|
-
|
|
7
|
+
profile: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
8
|
};
|
|
9
9
|
run(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/profile/use.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IACrD,OAAuB,OAAO,SAA0C;IAExE,OAAuB,WAAW,SACuJ;IAEzL,OAAuB,QAAQ,WAG7B;IAEF,OAAuB,IAAI;;MAKzB;IAEoB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAW3C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Args } from "@oclif/core";
|
|
2
|
+
import { BaseCommand } from "#app/cli/base-command.js";
|
|
3
|
+
import { formatSyncProfileUpdateResult } from "#app/lib/output.js";
|
|
4
|
+
import { clearSyncProfiles, useSyncProfile } from "#app/services/profile.js";
|
|
5
|
+
export default class SyncProfileUse extends BaseCommand {
|
|
6
|
+
static summary = "Set or clear the active sync profile";
|
|
7
|
+
static description = "Write ~/.config/devsync/settings.json so plain push, pull, status, and doctor commands use the selected profile layer by default. Omit the profile name to clear the active profile.";
|
|
8
|
+
static examples = [
|
|
9
|
+
"<%= config.bin %> <%= command.id %> work",
|
|
10
|
+
"<%= config.bin %> <%= command.id %>",
|
|
11
|
+
];
|
|
12
|
+
static args = {
|
|
13
|
+
profile: Args.string({
|
|
14
|
+
description: "Profile name to activate (omit to clear)",
|
|
15
|
+
required: false,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(SyncProfileUse);
|
|
20
|
+
const result = args.profile !== undefined
|
|
21
|
+
? await useSyncProfile(args.profile, process.env)
|
|
22
|
+
: await clearSyncProfiles(process.env);
|
|
23
|
+
this.print(formatSyncProfileUpdateResult(result, { verbose: flags.verbose }));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=use.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.js","sourceRoot":"","sources":["../../../../src/cli/commands/profile/use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IAC9C,MAAM,CAAU,OAAO,GAAG,sCAAsC,CAAC;IAEjE,MAAM,CAAU,WAAW,GAChC,sLAAsL,CAAC;IAElL,MAAM,CAAU,QAAQ,GAAG;QAChC,0CAA0C;QAC1C,qCAAqC;KACtC,CAAC;IAEK,MAAM,CAAU,IAAI,GAAG;QAC5B,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;YACnB,WAAW,EAAE,0CAA0C;YACvD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH,CAAC;IAEc,KAAK,CAAC,GAAG;QACvB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACzD,MAAM,MAAM,GACV,IAAI,CAAC,OAAO,KAAK,SAAS;YACxB,CAAC,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;YACjD,CAAC,CAAC,MAAM,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE3C,IAAI,CAAC,KAAK,CACR,6BAA6B,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAClE,CAAC;IACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@ export default class SyncPull extends BaseCommand {
|
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
7
|
"dry-run": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
|
|
8
|
+
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
9
|
};
|
|
10
10
|
run(): Promise<void>;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/pull.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/pull.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,WAAW;IAC/C,OAAuB,OAAO,SACiC;IAE/D,OAAuB,WAAW,SACyL;IAE3N,OAAuB,QAAQ,WAI7B;IAEF,OAAuB,KAAK;;;MAY1B;IAEoB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAe3C"}
|
|
@@ -2,32 +2,31 @@ import { Flags } from "@oclif/core";
|
|
|
2
2
|
import { BaseCommand } from "#app/cli/base-command.js";
|
|
3
3
|
import { formatSyncPullResult } from "#app/lib/output.js";
|
|
4
4
|
import { pullSync } from "#app/services/pull.js";
|
|
5
|
-
import { createSyncContext } from "#app/services/runtime.js";
|
|
6
5
|
export default class SyncPull extends BaseCommand {
|
|
7
6
|
static summary = "Apply the git-backed sync repository to local config paths";
|
|
8
7
|
static description = "Read tracked artifacts from the sync repository and materialize them back onto local paths under your home directory. Secret artifacts are decrypted with the configured age identity before they are written locally.";
|
|
9
8
|
static examples = [
|
|
10
9
|
"<%= config.bin %> <%= command.id %>",
|
|
11
10
|
"<%= config.bin %> <%= command.id %> --dry-run",
|
|
12
|
-
"<%= config.bin %> <%= command.id %> --
|
|
11
|
+
"<%= config.bin %> <%= command.id %> --profile work",
|
|
13
12
|
];
|
|
14
13
|
static flags = {
|
|
15
14
|
"dry-run": Flags.boolean({
|
|
16
15
|
default: false,
|
|
17
16
|
summary: "Preview local file updates only",
|
|
18
|
-
description: "Show which local files and directories devsync would create, update, or remove without touching the
|
|
17
|
+
description: "Show which local files and directories devsync would create, update, or remove without touching the local state.",
|
|
19
18
|
}),
|
|
20
|
-
|
|
21
|
-
summary: "Use a specific
|
|
22
|
-
description: "Override the persisted active
|
|
19
|
+
profile: Flags.string({
|
|
20
|
+
summary: "Use a specific profile layer for this command",
|
|
21
|
+
description: "Override the persisted active profile for this pull operation only.",
|
|
23
22
|
}),
|
|
24
23
|
};
|
|
25
24
|
async run() {
|
|
26
25
|
const { flags } = await this.parse(SyncPull);
|
|
27
26
|
const output = formatSyncPullResult(await pullSync({
|
|
28
27
|
dryRun: flags["dry-run"],
|
|
29
|
-
|
|
30
|
-
},
|
|
28
|
+
profile: flags.profile,
|
|
29
|
+
}, process.env), { verbose: flags.verbose });
|
|
31
30
|
this.print(output);
|
|
32
31
|
}
|
|
33
32
|
}
|