@ai-dossier/cli 0.4.2 → 0.5.1
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 +434 -0
- package/dist/cli.js +5 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/checksum.d.ts.map +1 -1
- package/dist/commands/checksum.js +1 -2
- package/dist/commands/checksum.js.map +1 -1
- package/dist/commands/config-cmd.d.ts.map +1 -1
- package/dist/commands/config-cmd.js +206 -209
- package/dist/commands/config-cmd.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +4 -6
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/export.d.ts +1 -0
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +21 -6
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/get.d.ts.map +1 -1
- package/dist/commands/get.js +8 -8
- package/dist/commands/get.js.map +1 -1
- package/dist/commands/history.d.ts +6 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +80 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/info.js +3 -5
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/list.d.ts +1 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +155 -145
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +12 -59
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/pull.d.ts +1 -0
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +27 -15
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +11 -50
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +132 -17
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/search.d.ts +1 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +30 -40
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/skill-export.d.ts.map +1 -1
- package/dist/commands/skill-export.js +11 -50
- package/dist/commands/skill-export.js.map +1 -1
- package/dist/config.d.ts +11 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -10
- package/dist/config.js.map +1 -1
- package/dist/credentials.d.ts +9 -1
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +19 -12
- package/dist/credentials.js.map +1 -1
- package/dist/helpers.d.ts +57 -0
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +117 -2
- package/dist/helpers.js.map +1 -1
- package/dist/multi-registry.d.ts +6 -4
- package/dist/multi-registry.d.ts.map +1 -1
- package/dist/multi-registry.js +38 -22
- package/dist/multi-registry.js.map +1 -1
- package/dist/registry-client.d.ts +1 -10
- package/dist/registry-client.d.ts.map +1 -1
- package/dist/registry-client.js +1 -17
- package/dist/registry-client.js.map +1 -1
- package/dist/run-log.d.ts +37 -0
- package/dist/run-log.d.ts.map +1 -0
- package/dist/run-log.js +78 -0
- package/dist/run-log.js.map +1 -0
- package/dist/write-auth.d.ts +24 -0
- package/dist/write-auth.d.ts.map +1 -0
- package/dist/write-auth.js +85 -0
- package/dist/write-auth.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,6 +148,214 @@ safe-run-dossier https://example.com/dossier.ds.md cursor
|
|
|
148
148
|
|
|
149
149
|
---
|
|
150
150
|
|
|
151
|
+
## Registry Commands
|
|
152
|
+
|
|
153
|
+
### Search
|
|
154
|
+
|
|
155
|
+
Search for dossiers across all configured registries:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Basic search
|
|
159
|
+
ai-dossier search "deployment"
|
|
160
|
+
|
|
161
|
+
# Filter by category
|
|
162
|
+
ai-dossier search "ci" --category devops
|
|
163
|
+
|
|
164
|
+
# Search dossier body content (-c is short for --content)
|
|
165
|
+
ai-dossier search "docker" -c
|
|
166
|
+
|
|
167
|
+
# Limit total results
|
|
168
|
+
ai-dossier search "setup" --limit 50
|
|
169
|
+
|
|
170
|
+
# Paginate results
|
|
171
|
+
ai-dossier search "setup" --page 2 --per-page 10
|
|
172
|
+
|
|
173
|
+
# JSON output
|
|
174
|
+
ai-dossier search "auth" --json
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### List
|
|
178
|
+
|
|
179
|
+
List dossiers from the registry, a local directory, or a GitHub repo:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# List all registry dossiers
|
|
183
|
+
ai-dossier list --source registry
|
|
184
|
+
|
|
185
|
+
# List with JSON output
|
|
186
|
+
ai-dossier list --source registry --json
|
|
187
|
+
|
|
188
|
+
# Paginate registry results
|
|
189
|
+
ai-dossier list --source registry --page 2 --per-page 10
|
|
190
|
+
|
|
191
|
+
# Filter by category (registry mode)
|
|
192
|
+
ai-dossier list --source registry --category security
|
|
193
|
+
|
|
194
|
+
# List local dossiers (-r is short for --recursive)
|
|
195
|
+
ai-dossier list .
|
|
196
|
+
ai-dossier list ./dossiers -r
|
|
197
|
+
|
|
198
|
+
# List from a GitHub repo
|
|
199
|
+
ai-dossier list github:owner/repo
|
|
200
|
+
|
|
201
|
+
# Filter local/GitHub results by risk level or signed status
|
|
202
|
+
ai-dossier list . --risk high
|
|
203
|
+
ai-dossier list . --signed-only
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Pull
|
|
207
|
+
|
|
208
|
+
Download dossiers from the registry to the local cache (`~/.dossier/cache/`):
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Pull a dossier (latest version)
|
|
212
|
+
ai-dossier pull org/my-dossier
|
|
213
|
+
|
|
214
|
+
# Pull a specific version
|
|
215
|
+
ai-dossier pull org/my-dossier@1.2.0
|
|
216
|
+
|
|
217
|
+
# Pull multiple dossiers
|
|
218
|
+
ai-dossier pull org/dossier-a org/dossier-b
|
|
219
|
+
|
|
220
|
+
# Force re-download
|
|
221
|
+
ai-dossier pull org/my-dossier --force
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Pulled dossiers are cached locally with checksum verification. Subsequent `pull` calls skip the download if the version is already cached (use `--force` to override).
|
|
225
|
+
|
|
226
|
+
### Export
|
|
227
|
+
|
|
228
|
+
Download a dossier and save it to a local file:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Export to default filename (org-name.ds.md)
|
|
232
|
+
ai-dossier export org/my-dossier
|
|
233
|
+
|
|
234
|
+
# Export to a specific file
|
|
235
|
+
ai-dossier export org/my-dossier -o ./local-copy.ds.md
|
|
236
|
+
|
|
237
|
+
# Print to stdout (for piping)
|
|
238
|
+
ai-dossier export org/my-dossier --stdout
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Multi-Registry Resolution
|
|
244
|
+
|
|
245
|
+
The CLI queries all configured registries in parallel when resolving dossiers (e.g., `dossier get`, `dossier run`, `dossier pull`). This uses `Promise.allSettled()` so a single registry failure does not block results from other registries.
|
|
246
|
+
|
|
247
|
+
### Exit Codes
|
|
248
|
+
|
|
249
|
+
Multi-registry commands use the following exit codes:
|
|
250
|
+
|
|
251
|
+
| Command | `0` (Success) | `1` (Failure) | `2` (Config/Runtime Error) |
|
|
252
|
+
|---------|---------------|---------------|---------------------------|
|
|
253
|
+
| `get` | Dossier found | Not found in any registry, or all registries failed | — |
|
|
254
|
+
| `list --source registry` | Results returned, including when all registries fail (empty list + warnings) | Unexpected runtime error | — |
|
|
255
|
+
| `search` | Results returned, including when all registries fail (no matches + warnings) | Unexpected runtime error | — |
|
|
256
|
+
| `pull` | At least one item pulled successfully (per-item errors are printed as warnings) | All requested items failed to pull | — |
|
|
257
|
+
| `run` | Dossier executed successfully | Not found, fetch failed, or verification failed | No LLM detected, unknown LLM, or execution failed |
|
|
258
|
+
|
|
259
|
+
**Partial failures**: When some registries fail but at least one succeeds, `list` returns exit `0` with a warning showing which registries failed:
|
|
260
|
+
```
|
|
261
|
+
⚠️ Registry 'internal': connection timeout
|
|
262
|
+
⚠️ Showing partial results (1/2 registries responded)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
When **all** registries fail, `list` and `search` still exit `0` but display per-registry error warnings and report no results found.
|
|
266
|
+
|
|
267
|
+
### No Registries Configured
|
|
268
|
+
|
|
269
|
+
If no registries are configured (no user config, no project `.dossierrc.json`, no `DOSSIER_REGISTRY_URL` env var), the CLI falls back to the hardcoded public registry (`https://dossier-registry.vercel.app`). Commands proceed normally — there is no error or special exit code for this scenario.
|
|
270
|
+
|
|
271
|
+
### Error Handling
|
|
272
|
+
|
|
273
|
+
All multi-registry operations return structured errors alongside results:
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
$ dossier get org/my-dossier
|
|
277
|
+
# If registry A is down but registry B has it → returns result silently from B
|
|
278
|
+
# If no registry has it → displays errors from each registry
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
When **all registries fail**, the CLI displays per-registry error details showing which registry failed and why. When at least one registry succeeds, the result is returned without surfacing errors from other registries.
|
|
282
|
+
|
|
283
|
+
This means you can configure multiple registries for redundancy — the CLI will succeed as long as at least one registry can serve the requested dossier. Registries are queried in parallel; for `get` and `run`, the first successful result (by configuration order) is used.
|
|
284
|
+
|
|
285
|
+
### Configuration
|
|
286
|
+
|
|
287
|
+
See `dossier config` for managing registry URLs. Multiple registries are queried in parallel, not sequentially.
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Config Command
|
|
292
|
+
|
|
293
|
+
Manage CLI settings and registry configuration.
|
|
294
|
+
|
|
295
|
+
### General Settings
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# List all configuration
|
|
299
|
+
dossier config --list
|
|
300
|
+
|
|
301
|
+
# Get a setting
|
|
302
|
+
dossier config defaultLlm
|
|
303
|
+
|
|
304
|
+
# Set a setting
|
|
305
|
+
dossier config defaultLlm claude-code
|
|
306
|
+
|
|
307
|
+
# Reset to defaults (preserves registry settings)
|
|
308
|
+
dossier config --reset
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Registry Management
|
|
312
|
+
|
|
313
|
+
All registry URLs **must use HTTPS** to protect credentials in transit.
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# List configured registries
|
|
317
|
+
dossier config --list-registries
|
|
318
|
+
dossier config --list-registries --json
|
|
319
|
+
|
|
320
|
+
# Add a registry
|
|
321
|
+
dossier config --add-registry internal --url https://dossier.company.com
|
|
322
|
+
|
|
323
|
+
# Add as default + read-only
|
|
324
|
+
dossier config --add-registry mirror --url https://mirror.example.com --default --readonly
|
|
325
|
+
|
|
326
|
+
# Remove a registry
|
|
327
|
+
dossier config --remove-registry mirror
|
|
328
|
+
|
|
329
|
+
# Change the default registry
|
|
330
|
+
dossier config --set-default-registry internal
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Project-Level Config (`.dossierrc.json`)
|
|
334
|
+
|
|
335
|
+
Place a `.dossierrc.json` in your project root for team-shared registry settings:
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"registries": {
|
|
340
|
+
"internal": { "url": "https://dossier.company.com" }
|
|
341
|
+
},
|
|
342
|
+
"defaultRegistry": "internal"
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Project registries are merged with user registries. User-configured registries take precedence on name conflicts to prevent credential exfiltration.
|
|
347
|
+
|
|
348
|
+
### Environment Variables
|
|
349
|
+
|
|
350
|
+
| Variable | Description |
|
|
351
|
+
|----------|-------------|
|
|
352
|
+
| `DOSSIER_REGISTRY_URL` | Override/add a registry URL (creates virtual "env" registry) |
|
|
353
|
+
| `DOSSIER_REGISTRY_TOKEN` | Auth token for the virtual "env" registry (ephemeral, never persisted to disk). Recommended for CI/CD and agent contexts. |
|
|
354
|
+
| `DOSSIER_REGISTRY_USER` | Username for registry authentication |
|
|
355
|
+
| `DOSSIER_REGISTRY_ORGS` | Comma-separated org scopes for registry queries |
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
151
359
|
## What It Checks
|
|
152
360
|
|
|
153
361
|
### 1. Integrity (Checksum)
|
|
@@ -286,6 +494,111 @@ claude-run-dossier https://example.com/dossier.ds.md
|
|
|
286
494
|
|
|
287
495
|
---
|
|
288
496
|
|
|
497
|
+
## Registry Configuration
|
|
498
|
+
|
|
499
|
+
The CLI supports multiple registries for discovering, pulling, and publishing dossiers. Use `dossier config` to manage registries — see [Config Command](#config-command) for CLI usage.
|
|
500
|
+
|
|
501
|
+
### Configuration File (`~/.dossier/config.json`)
|
|
502
|
+
|
|
503
|
+
The CLI **auto-creates** `~/.dossier/config.json` the first time you modify settings (e.g., via `dossier config --add-registry`). You do not need to create this file manually. If the file does not exist, the CLI uses built-in defaults (the public registry at `https://dossier-registry.vercel.app`).
|
|
504
|
+
|
|
505
|
+
```json
|
|
506
|
+
{
|
|
507
|
+
"registries": {
|
|
508
|
+
"public": {
|
|
509
|
+
"url": "https://dossier-registry.vercel.app",
|
|
510
|
+
"default": true
|
|
511
|
+
},
|
|
512
|
+
"internal": {
|
|
513
|
+
"url": "https://dossier.internal.example.com"
|
|
514
|
+
},
|
|
515
|
+
"readonly-mirror": {
|
|
516
|
+
"url": "https://mirror.example.com",
|
|
517
|
+
"readonly": true
|
|
518
|
+
}
|
|
519
|
+
},
|
|
520
|
+
"defaultRegistry": "public"
|
|
521
|
+
}
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
See [Read-Only Registries](#read-only-registries) for how the `"readonly"` flag affects operations.
|
|
525
|
+
|
|
526
|
+
To create the config manually:
|
|
527
|
+
|
|
528
|
+
```bash
|
|
529
|
+
mkdir -p -m 700 ~/.dossier
|
|
530
|
+
cat > ~/.dossier/config.json << 'EOF'
|
|
531
|
+
{
|
|
532
|
+
"registries": {
|
|
533
|
+
"public": {
|
|
534
|
+
"url": "https://dossier-registry.vercel.app",
|
|
535
|
+
"default": true
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
EOF
|
|
540
|
+
chmod 600 ~/.dossier/config.json
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### Resolution Priority
|
|
544
|
+
|
|
545
|
+
1. `--registry` flag on the command
|
|
546
|
+
2. `DOSSIER_REGISTRY_URL` environment variable
|
|
547
|
+
3. Project-level `.dossierrc.json`
|
|
548
|
+
4. User-level `~/.dossier/config.json`
|
|
549
|
+
5. Hardcoded default (public registry)
|
|
550
|
+
|
|
551
|
+
To verify which registries are active and their resolution order, run:
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
dossier config --list-registries
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
### Read-Only Registries
|
|
558
|
+
|
|
559
|
+
Registries marked `"readonly": true` can be used for read operations (`search`, `get`, `pull`) but **block write operations** (`publish`, `remove`). Attempting a write operation against a read-only registry produces:
|
|
560
|
+
|
|
561
|
+
```
|
|
562
|
+
❌ Registry 'readonly-mirror' is read-only
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
When resolving a write target (e.g., for `publish`), the CLI skips read-only registries and falls back to the first writable registry. If all configured registries are read-only, the CLI returns:
|
|
566
|
+
|
|
567
|
+
```
|
|
568
|
+
❌ No writable registry configured. All registries are read-only.
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
### Per-Command Registry Flag
|
|
572
|
+
|
|
573
|
+
Write commands accept `--registry <name>` to target a specific registry:
|
|
574
|
+
|
|
575
|
+
```bash
|
|
576
|
+
ai-dossier publish --registry team my-dossier.ds.md
|
|
577
|
+
ai-dossier login --registry internal
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
Read commands (`search`, `get`, `pull`) query all configured registries in parallel.
|
|
581
|
+
|
|
582
|
+
---
|
|
583
|
+
|
|
584
|
+
## Agent Discovery (`--agent`)
|
|
585
|
+
|
|
586
|
+
The `--agent` flag outputs a machine-readable JSON manifest describing the CLI's capabilities. This is designed for AI agents that need to discover what the CLI can do programmatically:
|
|
587
|
+
|
|
588
|
+
```bash
|
|
589
|
+
ai-dossier --agent
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
Output includes:
|
|
593
|
+
- CLI version and available commands
|
|
594
|
+
- Supported flags (`--json`, `-y`/`--yes`)
|
|
595
|
+
- Capabilities (multi-registry, non-TTY safe, machine-readable errors)
|
|
596
|
+
- Discovery command for full command listing
|
|
597
|
+
|
|
598
|
+
This enables agents to auto-configure their integration with the Dossier CLI without parsing help text.
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
289
602
|
## Architecture
|
|
290
603
|
|
|
291
604
|
### How It Works
|
|
@@ -415,6 +728,127 @@ ai-dossier verify ../examples/security/validate-project-config.ds.md
|
|
|
415
728
|
|
|
416
729
|
---
|
|
417
730
|
|
|
731
|
+
## Troubleshooting
|
|
732
|
+
|
|
733
|
+
### "insecure permissions" warning
|
|
734
|
+
|
|
735
|
+
```
|
|
736
|
+
⚠️ Warning: ~/.dossier/credentials.json has insecure permissions (644). Expected 0600. Credentials may have been compromised. Fixing permissions.
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
**What it means**: The credentials file is readable by other users on the system. The CLI expects `0600` (owner read/write only) to protect your authentication tokens.
|
|
740
|
+
|
|
741
|
+
**How to fix**:
|
|
742
|
+
|
|
743
|
+
```bash
|
|
744
|
+
chmod 600 ~/.dossier/credentials.json
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
The CLI will also attempt to fix permissions automatically when it detects this issue.
|
|
748
|
+
|
|
749
|
+
**Common causes**:
|
|
750
|
+
- Manually creating or editing the file with a text editor
|
|
751
|
+
- Copying the file from another system without preserving permissions
|
|
752
|
+
- Running the CLI as a different user than the file owner
|
|
753
|
+
|
|
754
|
+
### "Failed to save credentials"
|
|
755
|
+
|
|
756
|
+
```
|
|
757
|
+
Failed to save credentials to ~/.dossier/credentials.json: <reason>
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
**What it means**: The CLI could not write to the credentials file after `dossier login` or a token refresh.
|
|
761
|
+
|
|
762
|
+
**How to fix**:
|
|
763
|
+
|
|
764
|
+
1. **Check directory exists**: The config directory `~/.dossier/` must exist. The CLI creates it automatically, but if creation failed:
|
|
765
|
+
```bash
|
|
766
|
+
mkdir -p ~/.dossier
|
|
767
|
+
chmod 700 ~/.dossier
|
|
768
|
+
```
|
|
769
|
+
|
|
770
|
+
2. **Check write permissions**: Ensure your user owns the directory and file:
|
|
771
|
+
```bash
|
|
772
|
+
ls -la ~/.dossier/
|
|
773
|
+
# If ownership is wrong:
|
|
774
|
+
sudo chown -R $(whoami) ~/.dossier
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
3. **Check disk space**: Ensure the filesystem has available space.
|
|
778
|
+
|
|
779
|
+
4. **Check for read-only filesystem**: In some container or CI environments, the home directory may be read-only. Use the `DOSSIER_REGISTRY_TOKEN` environment variable instead:
|
|
780
|
+
```bash
|
|
781
|
+
export DOSSIER_REGISTRY_TOKEN=<your-token>
|
|
782
|
+
```
|
|
783
|
+
|
|
784
|
+
### "Registry not found"
|
|
785
|
+
|
|
786
|
+
```
|
|
787
|
+
Registry 'myregistry' not found. Available: public. Run 'dossier config --list-registries' to see configured registries.
|
|
788
|
+
```
|
|
789
|
+
|
|
790
|
+
**What it means**: The `--registry` flag references a registry name that isn't configured.
|
|
791
|
+
|
|
792
|
+
**How to fix**:
|
|
793
|
+
|
|
794
|
+
1. List configured registries to see what's available:
|
|
795
|
+
```bash
|
|
796
|
+
dossier config --list-registries
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
2. Add the missing registry:
|
|
800
|
+
```bash
|
|
801
|
+
dossier config --add-registry myregistry --url https://dossier.example.com
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
### "Unreachable registry URL"
|
|
805
|
+
|
|
806
|
+
When a registry is unreachable, the error appears as part of per-registry error output:
|
|
807
|
+
|
|
808
|
+
```
|
|
809
|
+
❌ Not found in any registry: org/my-dossier
|
|
810
|
+
internal: fetch failed
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
**What it means**: The registry URL is not reachable — the server may be down, the URL may be wrong, or there may be a network/firewall issue. When using multiple registries, the CLI succeeds as long as at least one registry responds (see [Multi-Registry Resolution](#multi-registry-resolution)).
|
|
814
|
+
|
|
815
|
+
**How to fix**:
|
|
816
|
+
|
|
817
|
+
1. Verify the URL is correct:
|
|
818
|
+
```bash
|
|
819
|
+
dossier config --list-registries
|
|
820
|
+
curl -s https://dossier.company.com/health
|
|
821
|
+
```
|
|
822
|
+
|
|
823
|
+
2. If the URL is wrong, remove and re-add:
|
|
824
|
+
```bash
|
|
825
|
+
dossier config --remove-registry internal
|
|
826
|
+
dossier config --add-registry internal --url https://correct-url.company.com
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
### "Malformed config file"
|
|
830
|
+
|
|
831
|
+
```
|
|
832
|
+
⚠️ Warning: Could not read config file (Unexpected token ...), using defaults
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
**What it means**: The config file contains invalid JSON. The CLI **does not fail** — it logs a warning and falls back to built-in defaults.
|
|
836
|
+
|
|
837
|
+
**How to fix**:
|
|
838
|
+
|
|
839
|
+
1. Validate the JSON:
|
|
840
|
+
```bash
|
|
841
|
+
python3 -m json.tool < ~/.dossier/config.json
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
2. Fix syntax errors, or delete and recreate:
|
|
845
|
+
```bash
|
|
846
|
+
rm ~/.dossier/config.json
|
|
847
|
+
dossier config --add-registry public --url https://dossier-registry.vercel.app --default
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
---
|
|
851
|
+
|
|
418
852
|
## FAQ
|
|
419
853
|
|
|
420
854
|
### Q: Why a separate CLI tool?
|
package/dist/cli.js
CHANGED
|
@@ -16,6 +16,7 @@ const export_1 = require("./commands/export");
|
|
|
16
16
|
const format_1 = require("./commands/format");
|
|
17
17
|
const from_file_1 = require("./commands/from-file");
|
|
18
18
|
const get_1 = require("./commands/get");
|
|
19
|
+
const history_1 = require("./commands/history");
|
|
19
20
|
const info_1 = require("./commands/info");
|
|
20
21
|
const init_1 = require("./commands/init");
|
|
21
22
|
const install_skill_1 = require("./commands/install-skill");
|
|
@@ -47,6 +48,9 @@ commander_1.program
|
|
|
47
48
|
.addHelpText('after', `Quick Start:
|
|
48
49
|
$ ai-dossier init Set up ~/.dossier/ directory
|
|
49
50
|
$ ai-dossier search <query> Find dossiers in the registry
|
|
51
|
+
$ ai-dossier list --source registry List all registry dossiers
|
|
52
|
+
$ ai-dossier pull <name> Download a dossier to local cache
|
|
53
|
+
$ ai-dossier export <name> Save a dossier to a local file
|
|
50
54
|
$ ai-dossier run <file-or-name> Verify and execute a dossier
|
|
51
55
|
$ ai-dossier create [file] Create a new dossier
|
|
52
56
|
|
|
@@ -84,6 +88,7 @@ Agent-friendly: Run \`ai-dossier --agent\` for machine-readable capabilities.`);
|
|
|
84
88
|
(0, whoami_1.registerWhoamiCommand)(commander_1.program);
|
|
85
89
|
(0, config_cmd_1.registerConfigCommand)(commander_1.program);
|
|
86
90
|
(0, cache_1.registerCacheCommand)(commander_1.program);
|
|
91
|
+
(0, history_1.registerHistoryCommand)(commander_1.program);
|
|
87
92
|
// Hidden
|
|
88
93
|
(0, prompt_hook_1.registerPromptHookCommand)(commander_1.program);
|
|
89
94
|
(0, reset_hooks_1.registerResetHooksCommand)(commander_1.program);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,yCAAoC;AAEpC,eAAe;AACf,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEvC,4CAAwD;AACxD,kDAA8D;AAC9D,kDAA8D;AAC9D,sDAA8D;AAC9D,8CAA0D;AAC1D,8CAA0D;AAC1D,8CAA0D;AAC1D,oDAA+D;AAC/D,w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D;YAC5D,wDAAwD;YACxD,wEAAwE;YACxE,0EAA0E;YAC1E,6FAA6F;SAC9F;KACF,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,oBAAoB;AACpB,mBAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,mCAAmC;AACnC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,mBAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../src/commands/checksum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checksum.d.ts","sourceRoot":"","sources":["../../src/commands/checksum.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2G9D"}
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.registerChecksumCommand = registerChecksumCommand;
|
|
7
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
8
7
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
10
9
|
const core_1 = require("@ai-dossier/core");
|
|
@@ -34,7 +33,7 @@ function registerChecksumCommand(program) {
|
|
|
34
33
|
console.log(`❌ ${err.message}`);
|
|
35
34
|
process.exit(1);
|
|
36
35
|
}
|
|
37
|
-
const calculatedHash =
|
|
36
|
+
const calculatedHash = (0, core_1.sha256Hex)(body);
|
|
38
37
|
const existingHash = frontmatter.checksum?.hash;
|
|
39
38
|
if (options.quiet && !options.verify && !options.update) {
|
|
40
39
|
console.log(calculatedHash);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../../src/commands/checksum.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"checksum.js","sourceRoot":"","sources":["../../src/commands/checksum.ts"],"names":[],"mappings":";;;;;AAKA,0DA2GC;AAhHD,sDAAyB;AACzB,0DAA6B;AAC7B,2CAA2F;AAG3F,SAAgB,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,+CAA+C,CAAC;SAC5D,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;SAClC,MAAM,CAAC,UAAU,EAAE,gCAAgC,CAAC;SACpD,MAAM,CAAC,UAAU,EAAE,0DAA0D,CAAC;SAC9E,MAAM,CAAC,SAAS,EAAE,sCAAsC,CAAC;SACzD,MAAM,CAAC,CAAC,IAAY,EAAE,OAAgE,EAAE,EAAE;QACzF,MAAM,WAAW,GAAG,mBAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEvC,IAAI,CAAC,iBAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,qBAAqB,WAAW,EAAE,CAAC,CAAC;YAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,OAAO,GAAG,iBAAE,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAErD,IAAI,WAA+B,CAAC;QACpC,IAAI,IAAY,CAAC;QACjB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;YAC5C,WAAW,GAAG,MAA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yB,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,YAAY,mBAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,cAAc,cAAc,EAAE,CAAC,CAAC;QAE5C,IAAI,YAAY,EAAE,CAAC;YACjB,IAAI,YAAY,KAAK,cAAc,EAAE,CAAC;gBACpC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;gBAC5D,OAAO,CAAC,GAAG,CAAC,mBAAmB,YAAY,EAAE,CAAC,CAAC;gBAC/C,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,mBAAmB,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;YACnD,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,mBAAmB,CAAC,CAAC;QACrE,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-cmd.d.ts","sourceRoot":"","sources":["../../src/commands/config-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"config-cmd.d.ts","sourceRoot":"","sources":["../../src/commands/config-cmd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsOzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgD5D"}
|