asdm-cli 0.1.2 → 0.3.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 CHANGED
@@ -15,11 +15,13 @@
15
15
  # 1. Install globally (or use npx for zero-install)
16
16
  npm install -g asdm-cli
17
17
 
18
- # 2. Initialize your project
19
- asdm init --registry github://your-org/asdm-registry --profile fullstack-engineer
18
+ # Project Setup (per repository)
19
+ asdm init # creates .asdm.json
20
+ asdm sync # installs to project-local provider dirs
20
21
 
21
- # 3. Sync agents, skills, and commands from the registry
22
- asdm sync
22
+ # Machine Setup (no project needed)
23
+ asdm init --global # creates ~/.config/asdm/config.json
24
+ asdm sync --global # installs to global provider config dirs
23
25
  ```
24
26
 
25
27
  That's it. ASDM will download your team's canonical AI assistant configurations and emit them into the correct locations for every provider your project uses — OpenCode, Claude Code, and GitHub Copilot — all from a single command.
@@ -97,13 +99,15 @@ asdm init fullstack-engineer # specify profile pos
97
99
  asdm init --profile data-analytics --registry github://acme/asdm-registry
98
100
  asdm init --force # overwrite existing config
99
101
  asdm init --gitignore # also update .gitignore
102
+ asdm init --global # write to ~/.config/asdm/config.json
100
103
  ```
101
104
 
102
105
  | Option | Description |
103
106
  |--------|-------------|
104
107
  | `--registry <url>` | Registry URL in `github://org/repo` format |
105
- | `--force` | Overwrite existing `.asdm.json` |
106
- | `--gitignore` | Add ASDM output dirs to `.gitignore` automatically |
108
+ | `--force` | Overwrite existing config |
109
+ | `--gitignore` | Add ASDM output dirs to `.gitignore` automatically (local only) |
110
+ | `--global` | Write to `~/.config/asdm/config.json` instead of `.asdm.json` |
107
111
 
108
112
  ---
109
113
 
@@ -113,6 +117,7 @@ Download agents, skills, and commands from the registry and emit them for all co
113
117
 
114
118
  ```bash
115
119
  asdm sync # full sync for all providers
120
+ asdm sync --global # install to global provider config directories
116
121
  asdm sync --provider opencode # sync only OpenCode files
117
122
  asdm sync --force # re-download everything (ignore cache)
118
123
  asdm sync --dry-run # preview changes without writing files
@@ -121,6 +126,7 @@ asdm sync --verbose # detailed output
121
126
 
122
127
  | Option | Description |
123
128
  |--------|-------------|
129
+ | `--global` | Install to global provider config dirs (`~/.config/opencode/`, `~/.claude/`, etc.) instead of project-local folders |
124
130
  | `--provider <name>` | Sync only for `opencode`, `claude-code`, or `copilot` |
125
131
  | `--force` | Re-download all assets, bypassing the local cache |
126
132
  | `--dry-run` | Show what would change without writing anything |
@@ -259,6 +265,8 @@ asdm clean # remove all managed files + lockfile
259
265
  asdm clean --target opencode # only clean OpenCode files
260
266
  asdm clean --target claude-code # only clean Claude Code files
261
267
  asdm clean --dry-run # preview what would be removed
268
+ asdm clean --global # remove all globally managed files
269
+ asdm clean --global --target opencode # only clean OpenCode global files
262
270
  ```
263
271
 
264
272
  When run interactively (TTY), you will be prompted to confirm before any files are deleted. After cleaning, a summary shows how many files were removed and how much disk space was freed.
@@ -267,6 +275,7 @@ When run interactively (TTY), you will be prompted to confirm before any files a
267
275
  |--------|-------------|
268
276
  | `--dry-run` | Preview what would be removed without deleting |
269
277
  | `--target <provider>` | Only clean files for a specific provider |
278
+ | `--global` | Clean globally managed files (reads `~/.config/asdm/global-lock.json`) |
270
279
 
271
280
  ---
272
281
 
@@ -353,6 +362,21 @@ Created automatically by `asdm use <profile>`. Never edit this manually.
353
362
  }
354
363
  ```
355
364
 
365
+ ### `~/.config/asdm/config.json` — Global config
366
+
367
+ Created by `asdm init --global`. Stores registry, profile, and provider settings for machine-wide installation. Uses the same schema as `.asdm.json`.
368
+
369
+ ```json
370
+ {
371
+ "$schema": "https://asdm.dev/schemas/config.schema.json",
372
+ "registry": "github://lennonalvesdias/asdm",
373
+ "profile": "base",
374
+ "providers": ["opencode"]
375
+ }
376
+ ```
377
+
378
+ > **Note:** This file is the fallback config source when running `asdm sync --global` or `asdm verify --global` outside of a project directory.
379
+
356
380
  ### `.asdm-lock.json` — Lockfile (committed to git)
357
381
 
358
382
  Generated by `asdm sync`. Records the exact SHA-256 of every emitted file and the manifest version. Enables:
@@ -361,6 +385,8 @@ Generated by `asdm sync`. Records the exact SHA-256 of every emitted file and th
361
385
  - **Incremental sync** — only re-download changed assets
362
386
  - **Audit trail** — full history via git blame
363
387
 
388
+ > In global mode (`asdm sync --global`), the lockfile is stored at `~/.config/asdm/global-lock.json`.
389
+
364
390
  ### Configuration Layers
365
391
 
366
392
  Config is resolved in three layers (highest precedence wins for non-locked fields):
@@ -556,6 +582,51 @@ ASDM emits files in each provider's native format. You never write provider-spec
556
582
 
557
583
  ---
558
584
 
585
+ ## Global Installation
586
+
587
+ Use `asdm sync --global` to install agents, skills, and commands into the global config directories of each provider. This makes your AI assistant configuration available in **every project** without per-project setup.
588
+
589
+ ```bash
590
+ # First-time machine setup (no project needed):
591
+ asdm init --global # creates ~/.config/asdm/config.json
592
+ asdm sync --global # installs to global provider dirs
593
+ asdm verify --global # verify global installation
594
+ asdm clean --global # remove global installation (when needed)
595
+ ```
596
+
597
+ ### Global config directories
598
+
599
+ | Provider | macOS / Linux | Windows |
600
+ |----------|--------------|---------|
601
+ | OpenCode | `~/.config/opencode/` | `%APPDATA%\opencode\` |
602
+ | Claude Code | `~/.claude/` | `%APPDATA%\Claude\` |
603
+ | GitHub Copilot | `~/.config/github-copilot/` | `%APPDATA%\GitHub Copilot\` |
604
+
605
+ ### How it works
606
+
607
+ In global mode, ASDM strips the provider-specific prefix from each file path and writes directly to the provider's global config directory:
608
+
609
+ ```
610
+ .opencode/agents/code-reviewer.md → ~/.config/opencode/agents/code-reviewer.md
611
+ .claude/agents/code-reviewer.md → ~/.claude/agents/code-reviewer.md
612
+ ```
613
+
614
+ Project-root files (`AGENTS.md`, `CLAUDE.md`) are skipped in global mode — they have no meaningful global equivalent.
615
+
616
+ The global lockfile is stored at `~/.config/asdm/global-lock.json`, separate from any project's `.asdm-lock.json`.
617
+
618
+ ### Config resolution
619
+
620
+ The `--global` flag controls **where files are written** (global provider dirs vs project-local). The config source for `sync` and `verify` with `--global` is resolved in this order:
621
+
622
+ 1. Local `.asdm.json` in the current directory (if present)
623
+ 2. `~/.config/asdm/config.json` (fallback — created by `asdm init --global`)
624
+ 3. Error: *"No config found. Run `asdm init` (project) or `asdm init --global` (machine-wide setup)."*
625
+
626
+ This means you can run `asdm sync --global` from any directory — it will use the project config if you're inside a project, or fall back to your global config automatically.
627
+
628
+ ---
629
+
559
630
  ## Integrity & Governance
560
631
 
561
632
  ### How Integrity Works