argsbarg 3.3.9 → 3.3.10

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/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.3.10] - 2026-06-21
11
+
12
+ ### Changed
13
+
14
+ - **`install` help copy** — `--update` and `--quiet` option descriptions match behavior; `install --update` error message clarified.
15
+ - **`docs/install.md`** — quick-start and `--yes` flag docs aligned with install notes.
16
+
10
17
  ## [3.3.9] - 2026-06-21
11
18
 
12
19
  ### Changed
@@ -304,7 +311,8 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
304
311
  - 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`).
305
312
  - Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
306
313
 
307
- [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v3.3.9...HEAD
314
+ [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v3.3.10...HEAD
315
+ [3.3.10]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.10
308
316
  [3.3.9]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.9
309
317
  [3.3.8]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.8
310
318
  [3.3.7]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.7
package/docs/install.md CHANGED
@@ -11,7 +11,7 @@ myapp install --all --yes
11
11
  # Refresh after upgrading (re-copy running binary + refresh installed artifacts)
12
12
  myapp install --reinstall
13
13
 
14
- # Download latest release (when install.updateGetLatest is configured)
14
+ # Upgrade to latest release (when install.updateGetLatest is configured)
15
15
  myapp install --update
16
16
 
17
17
  # See what is installed
@@ -99,7 +99,7 @@ Environment:
99
99
 
100
100
  | Flag | Description |
101
101
  | --- | --- |
102
- | `--yes` | Skip confirmation (required for non-TTY unless `--json` / `--reinstall`) |
102
+ | `--yes` | Skip confirmation (required for non-TTY unless `--json`, `--reinstall`, or `--update`) |
103
103
  | `--dry` | Preview changes; per-step messages on stderr with `[dry run]` |
104
104
  | `--json` | Machine-readable output on stdout (implies `--yes`) |
105
105
  | `--quiet` | Suppress summaries and per-step messages (requires `--yes`) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argsbarg",
3
- "version": "3.3.9",
3
+ "version": "3.3.10",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "bun": ">=1.3"
package/plan.md CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  ## Current Status
4
4
 
5
- **Overall**: Core CLI, MCP, install, docs, and update built-ins are complete. Public API is stable at **3.x**.
5
+ **Overall**: Core CLI, MCP, install, docs, and `install --update` are complete. Public API is stable at **3.x**.
6
6
 
7
7
  ### Shipped
8
8
 
9
9
  - Schema-driven parsing, help, completions, subcommand routing, fallback commands
10
10
  - MCP server (`mcpServer: { enabled: true }`), `ctx.invocation`, `cliInvoke`
11
- - `install` / `update` built-ins, agent skills, bundled `docs` (topics, schema, api, skill, mcp)
11
+ - `install` built-in (`install --update` when `updateGetLatest` is set), agent skills, bundled `docs` (topics, schema, api, skill, mcp)
12
12
  - Headless helpers and `ghReleaseUpdateGetLatest` for GitHub release consumers
13
13
 
14
14
  ### Consumers
@@ -37,6 +37,25 @@ describe("builtins help copy", () => {
37
37
  expect(names).not.toContain("mcp");
38
38
  });
39
39
 
40
+ test("install omits --update when updateGetLatest unset", () => {
41
+ const install = cliBuiltinInstallCommand(fixture);
42
+ expect(installBuiltinOptions(fixture).map((o) => o.name)).not.toContain("update");
43
+ expect(install.notes).not.toContain("Upgrade to latest release");
44
+ expect(install.notes).toContain("Refresh after upgrading");
45
+ });
46
+
47
+ test("install notes include upgrade section when updateGetLatest is set", () => {
48
+ const withUpdate: CliProgram = {
49
+ ...fixture,
50
+ install: { updateGetLatest: async () => ({ path: process.execPath }) },
51
+ };
52
+ const install = cliBuiltinInstallCommand(withUpdate);
53
+ const notes = install.notes ?? "";
54
+ expect(installBuiltinOptions(withUpdate).map((o) => o.name)).toContain("update");
55
+ expect(notes).toContain("Upgrade to latest release");
56
+ expect(notes.indexOf("install --reinstall")).toBeLessThan(notes.indexOf("install --update"));
57
+ });
58
+
40
59
  test("mcp builtin description is user-facing", () => {
41
60
  const mcp = cliBuiltinMcpCommand();
42
61
  expect(mcp.description).toContain("MCP server");
@@ -67,7 +67,7 @@ export function installBuiltinOptions(root: CliProgram): CliOption[] {
67
67
  },
68
68
  {
69
69
  name: "quiet",
70
- description: "Suppress informational output (requires --yes).",
70
+ description: "Suppress informational output (requires --yes, --json, --reinstall, or --update).",
71
71
  kind: CliOptionKind.Presence,
72
72
  },
73
73
  ];
@@ -84,7 +84,7 @@ export function installBuiltinOptions(root: CliProgram): CliOption[] {
84
84
  const statusIdx = opts.findIndex((o) => o.name === "status");
85
85
  opts.splice(statusIdx, 0, {
86
86
  name: "update",
87
- description: "Download and install the latest release.",
87
+ description: "Download the latest release and reinstall installed artifacts.",
88
88
  kind: CliOptionKind.Presence,
89
89
  });
90
90
  }
@@ -64,6 +64,20 @@ test("generateApiGuide resolves program key in install notes", () => {
64
64
  const md = generateApiGuide(fixture);
65
65
  expect(md).not.toContain("{argsbarg:program}");
66
66
  expect(md).toContain("myapp install --all --yes");
67
+ expect(md).not.toContain("Upgrade to latest release");
68
+ });
69
+
70
+ test("generateApiGuide includes upgrade section when updateGetLatest is set", () => {
71
+ const fixture: CliProgram = {
72
+ key: "myapp",
73
+ version: "1.0.0",
74
+ description: "Demo app.",
75
+ install: { updateGetLatest: async () => ({ path: process.execPath }) },
76
+ commands: [{ key: "run", description: "Run.", handler: () => {} }],
77
+ };
78
+ const md = generateApiGuide(fixture);
79
+ expect(md).toContain("Upgrade to latest release");
80
+ expect(md).toContain("myapp install --update");
67
81
  });
68
82
 
69
83
  test("generateApiGuide resolves {argsbarg:program} in consumer notes", () => {
@@ -7,7 +7,7 @@ import { installErr } from "./status.ts";
7
7
  export async function cliUpdate(root: CliProgram): Promise<never> {
8
8
  const hook = root.install?.updateGetLatest;
9
9
  if (!hook) {
10
- installErr("update is not configured. Set install.updateGetLatest on the program root.");
10
+ installErr("install --update is not configured. Set install.updateGetLatest on the program root.");
11
11
  process.exit(1);
12
12
  }
13
13