argsbarg 6.3.2 → 7.0.2

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +28 -3
  2. package/README.md +2 -2
  3. package/docs/README.md +2 -2
  4. package/docs/ai-skills.md +7 -7
  5. package/docs/bundled-docs.md +2 -2
  6. package/docs/cli-program.md +4 -4
  7. package/docs/configure.md +57 -85
  8. package/docs/developing.md +3 -3
  9. package/docs/distribution-homebrew.md +22 -23
  10. package/docs/mcp.md +3 -3
  11. package/examples/full-example/Formula/full-example.rb +7 -9
  12. package/examples/full-example/docs/cli-schema.json +48 -60
  13. package/examples/full-example/docs/cli.md +66 -36
  14. package/examples/full-example/docs/mcp.md +2 -2
  15. package/examples/full-example/docs/skill.md +1 -1
  16. package/examples/full-example/justfile +12 -12
  17. package/examples/full-example/scripts/formula-shared.ts +7 -13
  18. package/examples/full-example-json/Formula/full-example-json.rb +7 -9
  19. package/examples/full-example-json/docs/cli-schema.json +216 -270
  20. package/examples/full-example-json/docs/cli.md +297 -162
  21. package/examples/full-example-json/docs/mcp.md +2 -2
  22. package/examples/full-example-json/docs/skill.md +1 -1
  23. package/examples/full-example-json/justfile +12 -13
  24. package/examples/full-example-json/scripts/formula-shared.ts +7 -13
  25. package/index.d.ts +7 -8
  26. package/package.json +1 -1
  27. package/src/builtins/builtins.test.ts +21 -28
  28. package/src/builtins/configure-copy.ts +17 -20
  29. package/src/builtins/configure.ts +45 -74
  30. package/src/builtins/dispatch.ts +1 -8
  31. package/src/builtins/index.ts +1 -1
  32. package/src/cli-tool/create.ts +3 -1
  33. package/src/cli-tool/post-create.ts +5 -1
  34. package/src/config/file.ts +1 -0
  35. package/src/config/resolve.ts +1 -1
  36. package/src/configure/artifacts/mcp-config.ts +18 -12
  37. package/src/configure/artifacts/target-mcp-json.ts +19 -18
  38. package/src/configure/artifacts/target-skill.ts +8 -3
  39. package/src/configure/artifacts/targets/agents-mcp.ts +1 -1
  40. package/src/configure/artifacts/targets/configure.ts +2 -3
  41. package/src/configure/artifacts/uninstall.ts +5 -1
  42. package/src/configure/configure.test.ts +45 -113
  43. package/src/configure/index.ts +64 -354
  44. package/src/core/types.ts +7 -8
  45. package/src/docs/docs.test.ts +5 -2
  46. package/src/docs/mcp-guide.ts +2 -2
  47. package/src/runtime/capabilities.ts +3 -3
  48. package/src/skill/generate.ts +1 -1
  49. package/src/skill/install.ts +2 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.0.2] - 2026-08-13
11
+
12
+
13
+ ## [7.0.1] - 2026-08-13
14
+
15
+ ### Fixed
16
+
17
+ - **`configure install` / `uninstall` / `status`** — skip the global required-`appConfig` gate so these subcommands reach their handlers (e.g. `configure uninstall` when config is incomplete).
18
+
19
+ ## [7.0.0] - 2026-08-13
20
+
21
+ ### Changed
22
+
23
+ - **Breaking: `configure` subcommands** — replace flag modes with `configure install`, `configure uninstall`, and `configure status`. Bare `configure` shows help. Removed `--refresh`, `--remove-all`, `--remove-config`, and `--dry`. `--json` is only on `status` and `get`/`set`. `--yes` only on `uninstall` (skip TTY confirm).
24
+ - **Breaking: configure hooks** — rename `afterRefresh` → `afterInstall`, `beforeRemoveAll` → `beforeUninstall` (no aliases).
25
+ - **Breaking: Homebrew agent-artifact lifecycle** — drop formula `post_install` and `def uninstall` hooks (sandboxed / unsupported). Generated formulae use `caveats` with `configure install` and `configure uninstall`. `just install-local` runs install after brew; `just uninstall` runs uninstall first. New `just refresh` recipe in copy templates.
26
+ - **MCP install idempotency** — `configure install` skips when an existing MCP entry matches; warns and skips on conflict (no overwrite).
27
+ - **Configure output** — leaf install/uninstall functions print one line each; removed mutation summaries and progress noise.
28
+ - **Capability-aware configure copy** — help text and caveats gate on `skill.enabled`, `mcpServer.enabled`, and non-empty `appConfig.entries`.
29
+ - **Copy-template `argsbarg` bin shim** — `just setup` and `just consumers-dev` run `ln -sf` to fix Bun’s broken `node_modules/.bin/argsbarg` link for `file:` deps so `argsbarg schemagen` works.
30
+ - **`argsbarg create` (json)** — post-create schemagen prepends the new project’s `node_modules/.bin` to `PATH` so it does not pick up a broken global `argsbarg`.
31
+
10
32
  ## [6.3.2] - 2026-08-07
11
33
 
12
34
 
@@ -22,12 +44,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
22
44
 
23
45
  ### Fixed
24
46
 
25
- - **`userHome()`** — resolves home from `TEST_USER_HOME` (tests) or platform defaults (`/Users/$USER`, `/home/$USER`, `USERPROFILE`). Never reads `$HOME`, fixing skills installing under Homebrew's `post_install` sandbox.
47
+ - **`userHome()`** — resolve home from `TEST_USER_HOME` (tests) or platform defaults (`/Users/$USER`, `/home/$USER`, `USERPROFILE`). Never reads `$HOME`, fixing skills/MCP installing or failing to remove under Homebrew's `post_install` / `uninstall` sandbox.
26
48
 
27
49
  ### Changed
28
50
 
29
51
  - **Breaking: `configure --sync` → `configure --refresh`** — renames the non-interactive agent-artifact refresh flag (skills, MCP, config bootstrap). No `--sync` alias. Copy-template justfiles no longer ship a `refresh-artifacts` recipe; run `configure --refresh --yes` directly.
30
- - **Copy-template justfiles** — `install-local` depends on `uninstall` then `build` (`brew reinstall || brew install --force`). Dropped `uninstall-artifacts`, `uninstall-formula`, `uninstall-release`, and `uninstall-release-tap` (use `uninstall` + `uninstall-config`). Brew recipes prefix `HOMEBREW_NO_ASK=1`.
52
+ - **Copy-template justfiles** — `install-local` depends on `uninstall` then `build`. Brew recipes prefix `HOMEBREW_NO_ASK=1`.
31
53
 
32
54
  ## [6.2.2] - 2026-08-07
33
55
 
@@ -925,7 +947,10 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
925
947
  - Migrate schemas: rename every `children` property to **`commands`**; move positional definitions to **`CliPositional`** objects on `positionals` and strip `positional` / `argMin` / `argMax` from flag definitions under `options` (flags only carry `name`, `description`, `kind`, and optional `shortName`).
926
948
  - Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
927
949
 
928
- [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v6.3.2...HEAD
950
+ [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v7.0.2...HEAD
951
+ [7.0.2]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.2
952
+ [7.0.1]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.1
953
+ [7.0.0]: https://github.com/bdombro/bun-argsbarg/releases/tag/v7.0.0
929
954
  [6.3.2]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.3.2
930
955
  [6.3.1]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.3.1
931
956
  [6.3.0]: https://github.com/bdombro/bun-argsbarg/releases/tag/v6.3.0
package/README.md CHANGED
@@ -158,7 +158,7 @@ ArgsBarg automatically integrates several core features into your application. T
158
158
  ### Experimental Integrations (Opt-in)
159
159
 
160
160
  - `mcp` — Run as a Model Context Protocol stdio-based agent server (injected when `mcpServer.enabled` is `true`). See [docs/mcp.md](docs/mcp.md).
161
- - `configure` (`--refresh` / `--status` / `--remove-all`) — Interactive environment setup and developer agent credentials sync (enabled by default; opt out with `configure: { enabled: false }`). See [docs/configure.md](docs/configure.md).
161
+ - `configure` (`install` / `uninstall` / `status`) — Agent artifact setup (enabled by default; opt out with `configure: { enabled: false }`). See [docs/configure.md](docs/configure.md).
162
162
 
163
163
  Do not declare top-level commands named `completion`, `version`, or `docs` as they are reserved by default. If their respective features are enabled, `http`, `mcp`, and `configure` are also reserved.
164
164
 
@@ -385,7 +385,7 @@ This refreshes the argsbarg-managed section in `AGENTS.md` while preserving your
385
385
 
386
386
  ### 3. Generated Skills & Workspace Configuration
387
387
 
388
- Running `myapp configure --refresh` installs a compact `SKILL.md` index and full-reference `reference.md` to `~/.agents/skills/<key>/` when `program.skill: { enabled: true }`.
388
+ Running `myapp configure install` installs a compact `SKILL.md` index and full-reference `reference.md` to `~/.agents/skills/<key>/` when `program.skill: { enabled: true }`.
389
389
 
390
390
  See **[docs/configure.md](docs/configure.md)** and **[docs/ai-skills.md](docs/ai-skills.md)** for developer setup and automated Homebrew pipeline integration.
391
391
 
package/docs/README.md CHANGED
@@ -9,10 +9,10 @@ Start here to pick the right guide.
9
9
  | **JSON stdout / `outputSchema`** | [output-schema.md](output-schema.md) — codegen pipeline, JSDoc, narrowing |
10
10
  | **App config / `program.appConfig`** | [config-schema.md](config-schema.md) — flat JSON file, `ctx.appConfig`, codegen |
11
11
  | **JSON Schema validation** | [json-schema-subset.md](json-schema-subset.md) — Draft-07 / 2019-09 / 2020-12 (`$schema` on each schema; default Draft-07) |
12
- | **Exposing MCP tools** | [mcp.md](mcp.md) — stdio server, `inputSchema`, varargs, `configure --refresh` |
12
+ | **Exposing MCP tools** | [mcp.md](mcp.md) — stdio server, `inputSchema`, varargs, `configure install` |
13
13
  | **HTTP tool server** | [http-server.md](http-server.md) — `myapp http`, endpoints, curl examples |
14
14
  | **Server logging** (`program.log`, `enrich`, `serialize`) | [logging.md](logging.md) — ECS JSON lines, trace headers, custom formats |
15
- | **Shipping configure / agent artifacts** | [configure.md](configure.md) — Homebrew + `myapp configure --refresh` |
15
+ | **Shipping configure / agent artifacts** | [configure.md](configure.md) — Homebrew + `myapp configure install` |
16
16
  | **Homebrew tap-from-repo distribution** | [distribution-homebrew.md](distribution-homebrew.md) — formula pattern, `argsbarg create` |
17
17
  | **Bundling `myapp docs` topics** | [bundled-docs.md](bundled-docs.md) — consumer docgen vs framework docs |
18
18
  | **Agent skills** | [ai-skills.md](ai-skills.md) — `configure`, `docs skill` |
package/docs/ai-skills.md CHANGED
@@ -14,17 +14,17 @@ export const program = {
14
14
  } satisfies CliProgram;
15
15
  ```
16
16
 
17
- When `skill.enabled` is `true`, Homebrew `post_install` (`configure --refresh --yes`) installs and refreshes the skill. When omitted or `enabled` is not `true`, no skill is installed.
17
+ When `skill.enabled` is `true`, run `configure install` after `brew install` or `brew upgrade` to install and refresh the skill. When omitted or `enabled` is not `true`, no skill is installed.
18
18
 
19
19
  The skill directory name is the program `key` with `/`, `\`, and spaces replaced by `_` (e.g. `sqsp-qa`, `full-example`).
20
20
 
21
- ## Install via `configure --refresh`
21
+ ## Install via `configure install`
22
22
 
23
23
  ```bash
24
- myapp configure --refresh --yes
24
+ myapp configure install
25
25
  ```
26
26
 
27
- Skills are not prompted during interactive `configure` — install and uninstall are automatic when `skill.enabled` is set (brew install/uninstall and `--refresh` / `--remove-all`).
27
+ Skills are installed via `configure install` and removed via `configure uninstall` (run `just install-local` / `just uninstall` in dev).
28
28
 
29
29
  ## Programmatic install
30
30
 
@@ -46,7 +46,7 @@ Installed files include an HTML comment hint (`Generated by myapp configure; do
46
46
 
47
47
  | Client | Skill path |
48
48
  | --- | --- |
49
- | Cursor, Codex, Copilot, most agents | `~/.agents/skills/<key>/` (auto via `configure --refresh`) |
49
+ | Cursor, Codex, Copilot, most agents | `~/.agents/skills/<key>/` (auto via `configure install`) |
50
50
  | Claude Code | Manual symlink to `~/.claude/skills/<key>/` |
51
51
 
52
52
  ```bash
@@ -61,10 +61,10 @@ Skills describe **shell invocation only** — no MCP setup or `tools/call` guida
61
61
  | Mechanism | Role |
62
62
  | --- | --- |
63
63
  | **`myapp mcp`** (requires `mcpServer`) | Runtime tool execution over MCP |
64
- | **`program.skill.enabled`** + **`configure --refresh`** | Persists optimized skill bundle at `~/.agents/skills/<key>/` |
64
+ | **`program.skill.enabled`** + **`configure install`** | Persists optimized skill bundle at `~/.agents/skills/<key>/` |
65
65
  | **`myapp docs`** (requires `docs`) | Bundled markdown on stdout (`docs mcp` when MCP enabled) |
66
66
 
67
- `skill.md` is the routing index; `reference.md` matches `docs cli`. Prefer `configure --refresh` over `docs skill` for installed agents. See [cli-program.md](cli-program.md).
67
+ `skill.md` is the routing index; `reference.md` matches `docs cli`. Prefer `configure install` over `docs skill` for installed agents. See [cli-program.md](cli-program.md).
68
68
 
69
69
  **Claude Code plugin** (`mcpServer.claudePlugin: true` → `mcp bundle` writes `dist/claude-plugin/<name>.zip`) ships a separate MCP pointer skill (`SKILL.md` only) that routes agents to the bundled MCP server. This is a **dist artifact**, not installed via `configure`.
70
70
 
@@ -97,11 +97,11 @@ By default (unless `docs.enabled: false`):
97
97
 
98
98
  - **`docs cli-schema`** — same JSON as the former root `--schema` flag (handlers omitted; built-in subtrees included for leaf roots).
99
99
  - **`docs cli`** — markdown rendering of the same command tree (options, positionals, subcommands, fallback routing).
100
- - **`docs skill`** — prints the compact `SKILL.md` index. Prefer `configure --refresh --yes` for agents (persists index + full API in `reference.md`).
100
+ - **`docs skill`** — prints the compact `SKILL.md` index. Prefer `configure install` for agents (persists index + full API in `reference.md`).
101
101
 
102
102
  ## MCP guide (`docs mcp`)
103
103
 
104
- When both docs (default) and `mcpServer.enabled` are `true`, ArgsBarg injects a **`docs mcp`** topic with an auto-generated guide: tool list, `program.appConfig`, schema resource URI, `configure --refresh`, and protocol notes.
104
+ When both docs (default) and `mcpServer.enabled` are `true`, ArgsBarg injects a **`docs mcp`** topic with an auto-generated guide: tool list, `program.appConfig`, schema resource URI, `configure install`, and protocol notes.
105
105
 
106
106
  There is no override API in v1 — customize behavior via `mcpTool.description` on leaf commands.
107
107
 
@@ -541,9 +541,9 @@ await cli.run();
541
541
  - **Strict:** unknown keys rejected on load.
542
542
  - **CLI:** missing required config exits 1 before the leaf handler (TTY prompt when interactive). Built-in `docs` and `configure get`/`set` skip this exit.
543
543
  - **MCP:** server stays up; missing config returns `isError: true` at `tools/call`.
544
- - **Configure:** interactive `configure` runs the app config wizard; **`configure --refresh`** refreshes agent artifacts to `~/.agents/` (see https://dotagentsprotocol.com). Optional `configure.afterRefresh` / `configure.beforeRemoveAll` for app-specific agent setup; see [configure.md](configure.md).
545
- - **Agent skill:** `program.skill: { enabled: true }` installs to `~/.agents/skills/<key>/` on `configure --refresh`; see [configure.md](configure.md) and [ai-skills.md](ai-skills.md).
546
- - **MCP install:** `mcpServer: { enabled: true }` merges into `~/.agents/mcp.json` on `configure --refresh`; manual Cursor/Claude setup in [mcp.md](mcp.md).
544
+ - **Configure:** interactive `configure` runs the app config wizard; **`configure install`** refreshes agent artifacts to `~/.agents/` (see https://dotagentsprotocol.com). Optional `configure.afterInstall` / `configure.beforeUninstall` for app-specific agent setup; see [configure.md](configure.md).
545
+ - **Agent skill:** `program.skill: { enabled: true }` installs to `~/.agents/skills/<key>/` on `configure install`; see [configure.md](configure.md) and [ai-skills.md](ai-skills.md).
546
+ - **MCP install:** `mcpServer: { enabled: true }` merges into `~/.agents/mcp.json` on `configure install`; manual Cursor/Claude setup in [mcp.md](mcp.md).
547
547
 
548
548
  See [config-schema.md](config-schema.md) for codegen, [configure.md](configure.md) (`configure.targets`), and [mcp.md](mcp.md).
549
549
 
@@ -582,7 +582,7 @@ If you maintain argsbarg from a sibling checkout, `just consumers-dev` / `just c
582
582
 
583
583
  3. **Optional:** add consumer-specific sections above the `<!-- argsbarg:managed -->` marker in `AGENTS.md` (project context, Ink patterns, domain notes).
584
584
 
585
- - **Not this file:** `myapp configure --refresh` writes the **app** skill (`SKILL.md` under `~/.agents/skills/<key>/`) from your command schema — how to *invoke* the CLI. `AGENTS.md` is for *authoring* argsbarg schema.
585
+ - **Not this file:** `myapp configure install` writes the **app** skill (`SKILL.md` under `~/.agents/skills/<key>/`) from your command schema — how to *invoke* the CLI. `AGENTS.md` is for *authoring* argsbarg schema.
586
586
 
587
587
  ## See also
588
588
 
package/docs/configure.md CHANGED
@@ -13,92 +13,86 @@ Private GitHub release downloads require [GitHub CLI](https://cli.github.com/) a
13
13
  ```bash
14
14
  brew tap <org>/<repo> git@github.com:<org>/<repo>.git
15
15
  brew install <tap>/<key>
16
- <key> configure # interactive: per-target prompts; run when app config is required
16
+ <key> configure install # skills, MCP, config bootstrap; required-config wizard on TTY
17
17
  ```
18
18
 
19
- Upgrade with `brew upgrade <key>`. Shell completions are installed by Homebrew during `brew install`. Users must configure their shell per [Homebrew Shell Completion](https://docs.brew.sh/Shell-Completion).
19
+ Upgrade with `brew upgrade <key>`, then run `<key> configure install` again. Shell completions are installed by Homebrew during `brew install`. Users must configure their shell per [Homebrew Shell Completion](https://docs.brew.sh/Shell-Completion).
20
20
 
21
- **Uninstall the binary:**
21
+ **Uninstall:**
22
22
 
23
23
  ```bash
24
+ <key> configure uninstall
24
25
  brew uninstall <tap>/<key>
25
26
  ```
26
27
 
27
- `brew uninstall` runs the formula `uninstall` hook (`configure --remove-all --yes`), which removes detected skills, MCP entries, and app config while the binary is still on PATH.
28
-
29
- To remove app config only (keep skills/MCP), run `configure --remove-config --yes` before uninstall.
28
+ Run `configure uninstall` **before** `brew uninstall` while the binary is still on PATH. Homebrew does not run cleanup hooks for agent artifacts in `~/.agents`.
30
29
 
31
30
  ## Developer install
32
31
 
33
32
  ```bash
34
33
  just build
35
- just install-local # uninstall, then build + brew install (`just install` is an alias)
34
+ just install-local # uninstall, build, brew install, configure install (`just install` is an alias)
36
35
  ```
37
36
 
38
- Dev flow matches release: `install-local` runs `uninstall` first (keg + untap; formula hook runs `configure --remove-all`), then stages the dev formula and installs. `post_install` runs `<key> configure --refresh --yes` for skills/MCP. Use `just reinstall-local` to swap the binary into Cellar during tight edit cycles (skips completions and `post_install`). Run `<key> configure --refresh --yes` (or `just run configure --refresh --yes`) to refresh agent artifacts without touching the binary.
37
+ `just install-local` runs `configure uninstall` (via `just uninstall`), installs via Homebrew, then `configure install`. Use `just reinstall-local` to swap the binary into Cellar during tight edit cycles; run `just refresh` afterward for skills/MCP.
39
38
 
40
39
  ## Quick reference
41
40
 
42
41
  ```bash
43
- # Refresh skills/MCP after upgrade (Homebrew post_install runs this automatically)
44
- <key> configure --refresh --yes
42
+ # Install skills/MCP after install or upgrade (required — not run by Homebrew)
43
+ <key> configure install
45
44
 
46
45
  # See what is installed
47
- <key> configure --status
48
-
49
- # Interactive per-target setup (default when run with a TTY)
50
- <key> configure
46
+ <key> configure status [--json]
51
47
 
52
- # Remove all agent artifacts
53
- <key> configure --remove-all --yes
48
+ # Remove all agent artifacts and app config (run before brew uninstall)
49
+ <key> configure uninstall [--yes]
54
50
 
55
- # Remove app config only (not skills/MCP)
56
- <key> configure --remove-config --yes
57
-
58
- # Read or write app config (non-interactive; when program.appConfig is set)
51
+ # Read or write app config (when program.appConfig is set)
59
52
  <key> configure get [key] [--json] [--pretty]
60
53
  <key> configure set <key> <value> [--json] [--from-env]
61
54
  ```
62
55
 
63
- Non-interactive / CI: pass **`--yes`** (or **`--json`**, **`--refresh`**, **`--remove-all`**, **`--remove-config`**) — see [Confirmation](#confirmation).
56
+ Bare `<key> configure` (no subcommand) shows help. Use subcommands above.
64
57
 
65
58
  ## What gets configured
66
59
 
67
- | Target | Interactive | Mechanism |
60
+ | Target | `configure install` | Mechanism |
68
61
  | --- | --- | --- |
69
62
  | Binary | skipped (read-only) | Homebrew formula `bin.install` |
70
63
  | Shell completions | skipped | Homebrew `generate_completions_from_executable` |
71
- | Agent skill | skipped (automatic) | `~/.agents/skills/<key>/` when `program.skill.enabled` |
72
- | MCP config | skipped (automatic) | `~/.agents/mcp.json` when `mcpServer.enabled` (see https://dotagentsprotocol.com) |
73
- | App config | auto-runs wizard | Interactive wizard may update `~/.local/lib/<key>/config.json` when values change; `--refresh` bootstraps an empty file on install |
64
+ | Agent skill | automatic | `~/.agents/skills/<key>/` when `program.skill.enabled` |
65
+ | MCP config | automatic | `~/.agents/mcp.json` when `mcpServer.enabled` (see https://dotagentsprotocol.com) |
66
+ | App config | bootstrap + wizard | Creates `~/.local/lib/<key>/config.json` as `{}` when missing; TTY wizard when required keys are missing |
74
67
 
75
68
  ### Externally managed binary (Homebrew)
76
69
 
77
70
  When **`PATH`** resolves the program key to the **running executable** (e.g. after `brew install`):
78
71
 
79
- - **`configure --status`** shows `app: system (PATH)`
80
- - **`configure --refresh`** refreshes the agent skill (when `program.skill.enabled`) and merges MCP into `~/.agents/mcp.json` (when `mcpServer.enabled`); also creates `~/.local/lib/<key>/config.json` as `{}` when missing (all apps)
72
+ - **`configure status`** shows `app: system (PATH)`
73
+ - **`configure install`** refreshes the agent skill (when `program.skill.enabled`) and registers MCP in `~/.agents/mcp.json` (when `mcpServer.enabled`); bootstraps `config.json` when missing
81
74
 
82
75
  MCP config uses the command name on **`PATH`**, not a Cellar path. For Cursor, Claude Code, and Claude Desktop, copy the `mcpServers` entry manually — see [mcp.md](mcp.md) and `docs mcp`.
83
76
 
84
- ### Interactive default
77
+ ### Required-config wizard
85
78
 
86
- Bare **`configure`** (TTY required) runs the app config wizard when `program.appConfig` has entries. Agent skills and MCP are **not** prompted — they install automatically via brew `post_install` / `--refresh` when `program.skill.enabled` or `mcpServer.enabled` respectively.
79
+ On **`configure install`**, when `program.appConfig` has entries and required keys are still missing after env resolution:
87
80
 
88
- Remove the config file with **`configure --remove-config --yes`**.
81
+ - **TTY:** runs the config wizard (required keys only; Enter keeps current values)
82
+ - **Non-TTY:** exits with an error listing missing keys
89
83
 
90
- The **`app`** and **`skill`** / **`agentsMcp`** targets are shown in `--status` only — never mutated by interactive `configure` (use `--refresh` / brew hooks).
84
+ Optional keys are set via `configure set` or environment variables.
91
85
 
92
86
  ### `configure.targets`
93
87
 
94
- Optional gates for app binary status and app-config wizard participation in `--refresh`:
88
+ Optional gates for app binary status:
95
89
 
96
90
  ```typescript
97
91
  skill: { enabled: true },
98
92
  mcpServer: { enabled: true },
99
93
  configure: {
100
94
  targets: {
101
- configure: { includedInAll: true }, // optional: app config wizard on --refresh
95
+ configure: { includedInAll: true },
102
96
  },
103
97
  },
104
98
  ```
@@ -109,16 +103,14 @@ Artifact keys: `app`, `configure`. Legacy `configure.targets.*Mcp` keys are reje
109
103
 
110
104
  ### Lifecycle hooks
111
105
 
112
- Optional callbacks on `program.configure` for app-specific agent setup beyond the `.agents` protocol (e.g. Cursor or Claude Desktop config). Framework artifacts are installed/refreshed first; hooks extend or retract custom files.
106
+ Optional callbacks on `program.configure` for app-specific agent setup beyond the `.agents` protocol (e.g. Cursor or Claude Desktop config).
113
107
 
114
108
  ```typescript
115
109
  configure: {
116
- afterRefresh: async (ctx) => {
117
- if (ctx.dry) return;
110
+ afterInstall: async (ctx) => {
118
111
  // e.g. symlink skill, merge Cursor mcp.json — ctx.paths has agentsSkillDir, agentsMcpPath, mcpName
119
112
  },
120
- beforeRemoveAll: async (ctx) => {
121
- if (ctx.dry) return;
113
+ beforeUninstall: async (ctx) => {
122
114
  // undo custom installs before framework removes ~/.agents/ artifacts
123
115
  },
124
116
  },
@@ -126,83 +118,63 @@ configure: {
126
118
 
127
119
  | Hook | When |
128
120
  | --- | --- |
129
- | `afterRefresh` | After `configure --refresh` installs framework artifacts |
130
- | `beforeRemoveAll` | Before `configure --remove-all` removes framework artifacts (not `--remove-config`) |
121
+ | `afterInstall` | After `configure install` installs framework artifacts |
122
+ | `beforeUninstall` | Before `configure uninstall` removes framework artifacts |
131
123
 
132
124
  ## App config (`program.appConfig`)
133
125
 
134
- Every app gets `~/.local/lib/<sanitized-key>/config.json` on first **`configure --refresh`** (Homebrew `post_install`), even without `program.appConfig`.
126
+ Every app gets `~/.local/lib/<sanitized-key>/config.json` on first **`configure install`**, even without `program.appConfig`.
135
127
 
136
128
  When `program.appConfig` is set, ArgsBarg manages schema-driven values in that file.
137
129
 
138
130
  | Mode | Description |
139
131
  | --- | --- |
140
- | `configure --refresh` | Bootstraps `config.json` as `{}` when missing |
141
- | Interactive `configure` | Config wizard when `entries` is non-empty; re-prompts every entry (Enter keeps current); writes only when values or `_bindings` change |
142
- | `--status` | Shows config path, required keys (`set` / `missing`), and binding hints (`env`, `file`, `skip`) |
143
- | `--remove-config --yes` | Removes the config directory |
132
+ | `configure install` | Bootstraps `config.json` as `{}` when missing; wizard for missing required keys on TTY |
133
+ | `configure status` | Shows config path, required keys (`set` / `missing`), and binding hints (`env`, `file`, `skip`) |
134
+ | `configure uninstall` | Removes the config directory |
144
135
  | `configure set --from-env` | Bind a key to its mapped env var (stores `_bindings`, no literal secret) |
145
136
 
146
- Per-key intent is stored under the reserved `_bindings` object (e.g. `"apiToken": "env"`). Env still wins at resolve time when set; bindings record user choice. CLI startup only prompts for missing required keys; interactive `configure` re-prompts all entries.
137
+ Per-key intent is stored under the reserved `_bindings` object (e.g. `"apiToken": "env"`). Env still wins at resolve time when set; bindings record user choice.
147
138
 
148
139
  Export helpers from `argsbarg`: `resolveAppConfigPath`, `displayAppConfigPath`.
149
140
 
150
- ## Flags
151
-
152
- ### Operation flags
141
+ ## Subcommands
153
142
 
154
- | Flag | Description |
143
+ | Subcommand | Description |
155
144
  | --- | --- |
156
- | `--status` | Read-only inventory |
157
- | `--refresh` | Refresh installed agent artifacts; bootstrap `config.json` when missing (Homebrew `post_install`; greenfield → full install plan) |
158
- | `--remove-all` | Remove all detected agent artifacts |
159
- | `--remove-config` | Remove app config directory only |
160
-
161
- ### Behavior flags
162
-
163
- | Flag | Description |
164
- | --- | --- |
165
- | `--yes`, `-y` | Skip confirmation (required for non-interactive modes) |
166
- | `--dry` | Preview changes |
167
- | `--json` | Machine-readable output (implies `--yes`) |
168
-
169
- ## Confirmation
170
-
171
- Interactive `configure` prints a **`{app} Setup`** banner and per-target prompts. Non-interactive modes (`--refresh`, `--remove-all`, `--remove-config`) require **`--yes`** unless `--dry`.
145
+ | `install` | Install agent artifacts; bootstrap config; required-config wizard on TTY |
146
+ | `uninstall` | Remove skill, MCP entry, and app config (`--yes` skips TTY confirm) |
147
+ | `status` | Read-only inventory (`--json` for machine output) |
148
+ | `get` / `set` | Read or write `program.appConfig` keys (when configured) |
172
149
 
173
150
  ## MCP merge behavior
174
151
 
175
- When MCP targets are installed, entries are merged into host config with:
152
+ When MCP is enabled, `configure install` writes:
176
153
 
177
154
  ```json
178
155
  { "command": "<root.key>", "args": ["mcp"] }
179
156
  ```
180
157
 
181
- If an existing entry differs, the command exits with an error unless `--yes` is passed.
182
-
183
- ## Formula `post_install`
184
-
185
- Release formulae should run:
186
-
187
- ```ruby
188
- def post_install
189
- system bin/"myapp", "configure", "--refresh", "--yes"
190
- end
191
- ```
192
-
193
- This refreshes skills/MCP without running the configure wizard (app config is opt-in via interactive `configure`).
158
+ If an existing entry matches, install is a no-op. If an existing entry differs, install skips and prints a warning (existing entry is left unchanged).
194
159
 
195
- ## Formula `uninstall`
160
+ ## Formula `caveats`
196
161
 
197
- Release formulae should run:
162
+ Generated formulae document the two-step install when the app has skills, MCP, or `appConfig` entries. Homebrew prints `caveats` after `brew install` and in `brew info`:
198
163
 
199
164
  ```ruby
200
- def uninstall
201
- system bin/"myapp", "configure", "--remove-all", "--yes"
165
+ def caveats
166
+ <<~EOS
167
+ After install or upgrade:
168
+ myapp configure install
169
+
170
+ Before uninstall:
171
+ myapp configure uninstall
172
+ brew uninstall <tap>/myapp
173
+ EOS
202
174
  end
203
175
  ```
204
176
 
205
- Removes detected skills, MCP entries, and app config while the binary is still on PATH. Safe no-op when nothing was installed.
177
+ Do **not** use `post_install` or `def uninstall` for agent artifacts — Homebrew sandboxes `post_install` and does not invoke formula `uninstall` hooks.
206
178
 
207
179
  ## Bootstrapping a new CLI
208
180
 
@@ -36,7 +36,7 @@ Sibling consumer repos (machine-specific paths in the root `justfile` `consumer_
36
36
 
37
37
  | Recipe | When | Effect |
38
38
  | --- | --- | --- |
39
- | `just consumers-dev` | Before publish; hacking on argsbarg locally | `bun add argsbarg@file:<relative>`; refresh `AGENTS.md` from template (keeps app-specific prefix and conventions footer) |
39
+ | `just consumers-dev` | Before publish; hacking on argsbarg locally | `bun add argsbarg@file:<relative>`; fix `.bin/argsbarg` symlink; refresh `AGENTS.md` from template (keeps app-specific prefix and conventions footer) |
40
40
  | `just consumers-sync` | After release | Sets `"argsbarg": "^<this package.json version>"`, `bun install`, merge `AGENTS.md`, `just build`, `just docgen`, `just install-local` (Homebrew dev formula + agent artifacts; `just install` is an alias) |
41
41
  | `just consumers-schemagen` | After `@sg` type changes in consumers | Runs `argsbarg schemagen` in each `consumer_apps` path (fails if missing) |
42
42
 
@@ -59,7 +59,7 @@ Breaking changes (no backward compat). See [CHANGELOG.md](../CHANGELOG.md) `[Unr
59
59
  7. **Agent instructions:** `just consumers-dev` merges `AGENTS.md` + `CLAUDE.md` (includes **Abstractions** needless-extraction rule).
60
60
  8. **Verify:** `just test` and `just docgen` in each consumer repo.
61
61
 
62
- **Consumer app skill** — `just install-local` in each consumer (part of `consumers-sync`) runs Homebrew dev install then `myapp configure --refresh --yes`, which updates `~/.agents/skills/<app>/` when `program.skill.enabled` — not the argsbarg framework rule.
62
+ **Consumer app skill** — `just install-local` in each consumer (part of `consumers-sync`) runs Homebrew dev install then `myapp configure install`, which updates `~/.agents/skills/<app>/` when `program.skill.enabled` — not the argsbarg framework rule.
63
63
 
64
64
  ## npm package contents
65
65
 
@@ -71,7 +71,7 @@ Exclude `examples/full-example/node_modules/` and `examples/full-example-json/no
71
71
 
72
72
  ## Copy templates
73
73
 
74
- Both [`examples/full-example/`](../examples/full-example/) (CLI) and [`examples/full-example-json/`](../examples/full-example-json/) (schema-first) must enable every builtin (`capabilities.test.ts`). After builtin or schemagen doc changes:
74
+ Both [`examples/full-example/`](../examples/full-example/) (CLI) and [`examples/full-example-json/`](../examples/full-example-json/) (schema-first) use `argsbarg: file:../..` in-repo; `just setup` fixes the Bun `.bin/argsbarg` symlink so `argsbarg schemagen` works. They must enable every builtin (`capabilities.test.ts`). After builtin or schemagen doc changes:
75
75
 
76
76
  ```bash
77
77
  just example-full-check
@@ -6,16 +6,16 @@ ArgsBarg provides native, first-class support for packaging, releasing, and dist
6
6
 
7
7
  ## 1. Enterprise Distribution Model
8
8
 
9
- ArgsBarg maps the lifecycle of your application directly to standard Homebrew hooks, separating binary installation from user-interactive environment setup.
9
+ Homebrew installs the **binary and shell completions** into the prefix. **Agent artifacts** (skills, MCP, app config) live under the user's home directory and are installed by the app's `configure` command — Homebrew's sandbox does not allow formula hooks to write there.
10
10
 
11
11
  | Layer | Mechanism | Role in Lifecycle |
12
12
  | --- | --- | --- |
13
13
  | **Binary & Autocompletions** | Formula `install` block | Installs compiled binary and registers native shell autocompletions. |
14
- | **Agent artifacts** | Formula `post_install` | Automatically runs `{key} configure --refresh --yes` to bootstrap configuration files and refresh agent artifacts. |
15
- | **Application Configuration** | User-facing `{key} configure` | Runs an interactive TTY setup wizard (only when `program.appConfig` defines required parameters). |
16
- | **Clean Uninstall** | Formula `uninstall` | Automatically runs `{key} configure --remove-all --yes` to clean up local configurations and symlinks. |
14
+ | **Agent artifacts** | `{key} configure install` | User- or script-run after `brew install` / `brew upgrade`; installs skills/MCP and bootstraps `config.json`. |
15
+ | **Application Configuration** | `{key} configure install` | Required-config wizard on TTY when `program.appConfig` defines required parameters. |
16
+ | **Clean Uninstall** | `{key} configure uninstall` then `brew uninstall` | Removes `~/.agents` artifacts and app config; must run **before** uninstall while the binary is still on PATH. |
17
17
 
18
- *Note: This architecture explicitly separates non-interactive installation (safe for automation/CI) from interactive configuration (which requires a TTY).*
18
+ *Note: `just install-local` runs both steps for developers. End users see the commands in formula `caveats` and `brew info`.*
19
19
 
20
20
  ---
21
21
 
@@ -33,6 +33,9 @@ brew tap <org>/<repo>
33
33
 
34
34
  # Install the application
35
35
  brew install <tap>/{key}
36
+
37
+ # Install agent artifacts (skills, MCP, config bootstrap)
38
+ {key} configure install
36
39
  ```
37
40
 
38
41
  The generated Homebrew formula points directly to your public GitHub release asset URL, allowing anyone to install and receive automatic updates securely.
@@ -53,8 +56,8 @@ gh auth login
53
56
  brew tap <org>/<repo> git@github.com:<org>/<repo>.git
54
57
  brew install <tap>/{key}
55
58
 
56
- # 3. Perform interactive configuration (such as API tokens) if required
57
- {key} configure
59
+ # 3. Install agent artifacts (and required-config wizard on TTY when needed)
60
+ {key} configure install
58
61
  ```
59
62
 
60
63
  #### 2. The Private Release Strategy:
@@ -85,20 +88,14 @@ class Myapp < Formula
85
88
  generate_completions_from_executable(bin/"myapp", "completion", base_name: "myapp")
86
89
  end
87
90
 
88
- def post_install
89
- # Non-interactive bootstrap of config files and developer links
90
- system bin/"myapp", "configure", "--refresh", "--yes"
91
- end
92
-
93
- def uninstall
94
- # Graceful clean up of local files on uninstall
95
- system bin/"myapp", "configure", "--remove-all", "--yes"
96
- end
97
-
98
91
  def caveats
99
92
  <<~EOS
100
- Interactive configuration is required. Please run:
101
- myapp configure
93
+ After install or upgrade:
94
+ myapp configure install
95
+
96
+ Before uninstall:
97
+ myapp configure uninstall
98
+ brew uninstall <tap>/myapp
102
99
  EOS
103
100
  end
104
101
  end
@@ -116,13 +113,13 @@ ArgsBarg provides an optimized workflow for developers to build, package, and te
116
113
  # 1. Build the local release binary
117
114
  just build
118
115
 
119
- # 2. Uninstall any existing formula/tap, stage and install locally (bypasses GitHub, uses file://)
116
+ # 2. Uninstall any existing formula/tap, stage and install locally, refresh agent artifacts
120
117
  just install-local
121
118
 
122
- # 3. Swap updated binaries quickly during tight edit cycles
119
+ # 3. Swap updated binaries quickly during tight edit cycles (run `just refresh` for skills/MCP)
123
120
  just reinstall-local
124
121
 
125
- # 4. Uninstall the binary and gracefully clean up all configurations
122
+ # 4. Remove agent artifacts, uninstall the binary, and untap
126
123
  just uninstall
127
124
  ```
128
125
 
@@ -130,10 +127,11 @@ just uninstall
130
127
 
131
128
  To ensure you test the exact formula that will be shipped to production, `just install-local` runs:
132
129
 
133
- 1. `just uninstall` — Remove any existing keg and untap (formula `uninstall` hook runs `configure --remove-all`).
130
+ 1. `just uninstall` — `configure uninstall` (when possible), then remove keg and untap.
134
131
  2. `bun scripts/dev-formula.ts install` — Safely backs up your production formula and writes a temporary local dev formula using a `file://` URL pointing to your build directory.
135
132
  3. `brew reinstall || brew install --force` — Installs the package locally using Homebrew.
136
133
  4. `bun scripts/dev-formula.ts reset` — Automatically restores your production formula on disk.
134
+ 5. `{key} configure install` — Installs skills/MCP into `~/.agents` (outside Homebrew's sandbox).
137
135
 
138
136
  ---
139
137
 
@@ -170,4 +168,5 @@ just release --purge --dry-run # Preview list of tag deletions
170
168
 
171
169
  Applications packaged via ArgsBarg adhere to standard system directories:
172
170
  * **Resolved Configuration Path**: `~/.local/lib/<sanitized-key>/config.json`
171
+ * **Agent skill path**: `~/.agents/skills/<key>/`
173
172
  * **Auto-Exports**: Developers can import `resolveAppConfigPath` or `displayAppConfigPath` directly from `argsbarg` to display helpful directories in help screens.
package/docs/mcp.md CHANGED
@@ -46,10 +46,10 @@ bun run examples/nested.ts mcp
46
46
 
47
47
  ### `.agents` auto-install
48
48
 
49
- When `mcpServer.enabled` is set, `configure --refresh` merges a `mcpServers` entry into `~/.agents/mcp.json` per the https://dotagentsprotocol.com:
49
+ When `mcpServer.enabled` is set, `configure install` merges a `mcpServers` entry into `~/.agents/mcp.json` per the https://dotagentsprotocol.com:
50
50
 
51
51
  ```bash
52
- myapp configure --refresh --yes
52
+ myapp configure install
53
53
  ```
54
54
 
55
55
  ### Manual client setup
@@ -381,7 +381,7 @@ The bundled `SKILL.md` is an **MCP routing stub** — it tells Claude to use the
381
381
 
382
382
  Load locally with `claude --plugin-dir ./dist/claude-plugin/myapp.zip`.
383
383
 
384
- Bare **`myapp mcp`** still runs the stdio MCP server (unchanged for `configure` MCP targets and MCP hosts). Use **`configure --refresh --yes`** for Cursor, Claude Code, Claude Desktop, and OpenCode JSON config.
384
+ Bare **`myapp mcp`** still runs the stdio MCP server (unchanged for `configure` MCP targets and MCP hosts). Use **`configure install`** for Cursor, Claude Code, Claude Desktop, and OpenCode JSON config.
385
385
 
386
386
  ## Hidden commands and options
387
387
 
@@ -10,17 +10,15 @@ class FullExample < Formula
10
10
  generate_completions_from_executable(bin/"full-example", "completion", base_name: "full-example")
11
11
  end
12
12
 
13
- def post_install
14
- system bin/"full-example", "configure", "--refresh", "--yes"
15
- end
16
-
17
- def uninstall
18
- system bin/"full-example", "configure", "--remove-all", "--yes"
19
- end
20
-
21
13
  def caveats
22
14
  <<~EOS
23
- Run `full-example configure` to set up agent artifacts and app config (interactive).
15
+ After install or upgrade:
16
+ full-example configure install
17
+
18
+ Before uninstall:
19
+ full-example configure uninstall
20
+ brew uninstall <tap>/full-example
21
+
24
22
  Restart MCP chat apps (Cursor, Claude Desktop, etc.) after install or upgrade so they load the updated server.
25
23
  EOS
26
24
  end