argsbarg 3.3.8 → 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,19 @@ 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
+
17
+ ## [3.3.9] - 2026-06-21
18
+
19
+ ### Changed
20
+
21
+ - **`install` notes** — `install --update` is under "Upgrade to latest release" (not "Refresh after upgrading"); shown only when `install.updateGetLatest` is set.
22
+
10
23
  ## [3.3.8] - 2026-06-21
11
24
 
12
25
  ### Changed
@@ -298,7 +311,9 @@ const cli = { ... } satisfies CliProgram; // or : CliProgram
298
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`).
299
312
  - Imports: use `CliPositional` where needed; replace `CliOptionDef` with `CliOption` or `CliPositional` as appropriate.
300
313
 
301
- [Unreleased]: https://github.com/bdombro/bun-argsbarg/compare/v3.3.8...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
316
+ [3.3.9]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.9
302
317
  [3.3.8]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.8
303
318
  [3.3.7]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.7
304
319
  [3.3.6]: https://github.com/bdombro/bun-argsbarg/releases/tag/v3.3.6
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.8",
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
  }
@@ -95,20 +95,34 @@ export function installBuiltinOptions(root: CliProgram): CliOption[] {
95
95
  /** Builds the `install` built-in command. */
96
96
  export function cliBuiltinInstallCommand(root: CliProgram): CliLeaf {
97
97
  const app = root.key;
98
+ const notesLines = [
99
+ "First-time setup:",
100
+ ` ${app} install --all --yes`,
101
+ "",
102
+ "Refresh after upgrading:",
103
+ ` ${app} install --reinstall`,
104
+ ];
105
+ if (resolveCapabilities(root).update) {
106
+ notesLines.push(
107
+ "",
108
+ "Upgrade to latest release:",
109
+ ` ${app} install --update`,
110
+ );
111
+ }
112
+ notesLines.push(
113
+ "",
114
+ "See what is installed:",
115
+ ` ${app} install --status`,
116
+ "",
117
+ "Remove everything installed with --all:",
118
+ ` ${app} install --uninstall --all --yes`,
119
+ "",
120
+ "Use --dry to preview changes, --json for machine-readable output.",
121
+ );
98
122
  return {
99
123
  key: "install",
100
124
  description: "Install the binary, shell completions, agent skills, and MCP config to your user environment.",
101
- notes:
102
- "First-time setup:\n" +
103
- ` ${app} install --all --yes\n\n` +
104
- "Refresh after upgrading:\n" +
105
- ` ${app} install --reinstall\n` +
106
- ` ${app} install --update\n\n` +
107
- "See what is installed:\n" +
108
- ` ${app} install --status\n\n` +
109
- "Remove everything installed with --all:\n" +
110
- ` ${app} install --uninstall --all --yes\n\n` +
111
- "Use --dry to preview changes, --json for machine-readable output.",
125
+ notes: notesLines.join("\n"),
112
126
  options: installBuiltinOptions(root),
113
127
  handler: () => {},
114
128
  };
@@ -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