argsbarg 6.1.2 → 6.1.3

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 (229) hide show
  1. package/CHANGELOG.md +65 -1
  2. package/README.md +17 -19
  3. package/bin/argsbarg +10 -0
  4. package/docs/README.md +4 -3
  5. package/docs/ai-skills.md +4 -2
  6. package/docs/bundled-docs.md +50 -25
  7. package/docs/cli-program.md +52 -10
  8. package/docs/config-schema.md +10 -11
  9. package/docs/configure.md +2 -0
  10. package/docs/decisions.md +40 -0
  11. package/docs/developing.md +43 -5
  12. package/docs/http-server.md +171 -0
  13. package/docs/json-schema-subset.md +51 -0
  14. package/docs/mcp.md +4 -2
  15. package/docs/output-schema.md +55 -62
  16. package/examples/formats.ts +6 -6
  17. package/examples/full-example/Formula/full-example.rb +35 -0
  18. package/examples/full-example/README.md +20 -21
  19. package/examples/full-example/docs/README.md +1 -1
  20. package/examples/full-example/docs/cli-schema.json +1790 -98
  21. package/examples/full-example/docs/cli.md +1990 -0
  22. package/examples/full-example/docs/http.md +28 -29
  23. package/examples/full-example/docs/mcp.md +8 -22
  24. package/examples/full-example/docs/openapi.json +783 -50
  25. package/examples/full-example/docs/skill.md +10 -10
  26. package/examples/full-example/justfile +11 -1
  27. package/examples/full-example/src/commands/render-json/__generated__/RenderJsonInputSchema.json +15 -0
  28. package/examples/full-example/src/commands/render-json/__generated__/index.ts +5 -0
  29. package/examples/full-example/src/commands/render-json/command.test.ts +46 -0
  30. package/examples/full-example/src/commands/render-json/command.ts +30 -0
  31. package/examples/full-example/src/commands/render-json/types.ts +9 -0
  32. package/examples/full-example/src/commands/status/__generated__/StatusJsonOutputSchema.json +15 -0
  33. package/examples/full-example/src/commands/status/__generated__/index.ts +2 -2
  34. package/examples/full-example/src/commands/status/command.ts +5 -13
  35. package/examples/full-example/src/commands/status/types.ts +1 -14
  36. package/examples/full-example/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +15 -0
  37. package/examples/full-example/src/commands/workspaces/__generated__/index.ts +5 -0
  38. package/examples/full-example/src/commands/workspaces/command.test.ts +58 -0
  39. package/examples/full-example/src/commands/workspaces/command.ts +94 -0
  40. package/examples/full-example/src/commands/workspaces/types.ts +6 -0
  41. package/examples/full-example/src/db/index.test.ts +86 -0
  42. package/examples/full-example/src/db/index.ts +101 -0
  43. package/examples/full-example/src/db/migrate.test.ts +35 -0
  44. package/examples/full-example/src/db/migrate.ts +69 -0
  45. package/examples/full-example/src/db/migrations/001_workspaces.sql +6 -0
  46. package/examples/full-example/src/db/tables/workspaces.ts +66 -0
  47. package/examples/full-example/src/program.ts +11 -36
  48. package/examples/full-example/src/types/argsbarg.d.ts +11 -0
  49. package/examples/full-example/src/types/md.d.ts +4 -0
  50. package/examples/full-example/tsconfig.json +5 -2
  51. package/examples/mcp-test.ts +1 -2
  52. package/examples/minimal.ts +1 -7
  53. package/examples/nested.ts +1 -2
  54. package/examples/option-required.ts +1 -1
  55. package/examples/servers.ts +4 -5
  56. package/index.d.ts +431 -136
  57. package/package.json +19 -2
  58. package/src/builtins/builtins.test.ts +7 -7
  59. package/src/builtins/completion-bash.ts +1 -1
  60. package/src/builtins/completion-fish.ts +1 -1
  61. package/src/builtins/completion-group.ts +4 -4
  62. package/src/builtins/completion-simulate-shared.ts +9 -0
  63. package/src/builtins/completion-zsh.ts +1 -1
  64. package/src/builtins/config.test.ts +3 -3
  65. package/src/builtins/config.ts +9 -9
  66. package/src/builtins/configure-copy.ts +2 -2
  67. package/src/builtins/configure.ts +4 -4
  68. package/src/builtins/dispatch.ts +19 -18
  69. package/src/builtins/export.ts +7 -5
  70. package/src/builtins/http.ts +68 -0
  71. package/src/builtins/mcp.ts +28 -4
  72. package/src/builtins/presentation.ts +6 -6
  73. package/src/builtins/registry.ts +6 -6
  74. package/src/builtins/scopes.ts +2 -2
  75. package/src/builtins/version.ts +1 -1
  76. package/src/cli-tool/full-example-capabilities.test.ts +10 -15
  77. package/src/cli-tool/main.ts +1 -1
  78. package/src/cli-tool/program.ts +3 -2
  79. package/src/cli-tool/prompt.ts +1 -1
  80. package/src/cli-tool/run-schemagen.ts +1 -3
  81. package/src/cli-tool/schemagen/cleanup.ts +6 -7
  82. package/src/cli-tool/schemagen/discover-schema-roots.ts +66 -120
  83. package/src/cli-tool/schemagen/index.ts +2 -2
  84. package/src/cli-tool/schemagen/names.ts +8 -13
  85. package/src/cli-tool/schemagen/run.ts +21 -28
  86. package/src/cli-tool/schemagen/schemagen.test.ts +136 -46
  87. package/src/config/bindings.test.ts +1 -1
  88. package/src/config/bindings.ts +1 -1
  89. package/src/config/bootstrap.test.ts +1 -1
  90. package/src/config/bootstrap.ts +36 -4
  91. package/src/config/context.test.ts +1 -1
  92. package/src/config/context.ts +1 -1
  93. package/src/config/entry.ts +1 -1
  94. package/src/config/file.test.ts +1 -1
  95. package/src/config/file.ts +3 -3
  96. package/src/config/manifest.ts +1 -1
  97. package/src/config/resolve.test.ts +1 -1
  98. package/src/config/resolve.ts +1 -1
  99. package/src/config/schema.ts +1 -1
  100. package/src/config/validate.ts +1 -1
  101. package/src/{install → configure/artifacts}/binary-placement.test.ts +1 -1
  102. package/src/{install → configure/artifacts}/binary-placement.ts +1 -1
  103. package/src/{install → configure/artifacts}/gh-release-update.ts +1 -1
  104. package/src/{install → configure/artifacts}/install-validate.test.ts +3 -3
  105. package/src/{install → configure/artifacts}/mcp-config.ts +1 -1
  106. package/src/{install → configure/artifacts}/mcp-opencode.test.ts +1 -1
  107. package/src/{install → configure/artifacts}/mcp-opencode.ts +1 -1
  108. package/src/{install → configure/artifacts}/paths.ts +5 -5
  109. package/src/configure/artifacts/plan.ts +24 -0
  110. package/src/{install → configure/artifacts}/status.test.ts +1 -1
  111. package/src/{install → configure/artifacts}/status.ts +2 -2
  112. package/src/{install → configure/artifacts}/target-base.ts +1 -1
  113. package/src/{install → configure/artifacts}/target-detect.ts +1 -1
  114. package/src/{install → configure/artifacts}/target-effective.ts +3 -9
  115. package/src/{install → configure/artifacts}/target-mcp-cli.ts +1 -1
  116. package/src/{install → configure/artifacts}/target-mcp-json.ts +1 -1
  117. package/src/{install → configure/artifacts}/target-plan-build.ts +2 -2
  118. package/src/{install → configure/artifacts}/target-registry.ts +2 -2
  119. package/src/{install → configure/artifacts}/target-scope.ts +3 -3
  120. package/src/{install → configure/artifacts}/target-skill.ts +1 -1
  121. package/src/{install → configure/artifacts}/target-types.ts +2 -2
  122. package/src/{install → configure/artifacts}/targets/app.ts +5 -5
  123. package/src/{install → configure/artifacts}/targets/chatgpt-mcp.ts +2 -2
  124. package/src/{install → configure/artifacts}/targets/claude-code-mcp.ts +2 -2
  125. package/src/{install → configure/artifacts}/targets/claude-desktop-mcp.ts +2 -2
  126. package/src/{install → configure/artifacts}/targets/claude-skill.ts +2 -2
  127. package/src/{install → configure/artifacts}/targets/codex-mcp.ts +2 -2
  128. package/src/{install → configure/artifacts}/targets/codex-skill.ts +2 -2
  129. package/src/{install → configure/artifacts}/targets/configure.ts +5 -5
  130. package/src/{install → configure/artifacts}/targets/cursor-mcp.ts +2 -2
  131. package/src/{install → configure/artifacts}/targets/cursor-skill.ts +2 -2
  132. package/src/{install → configure/artifacts}/targets/index.ts +1 -1
  133. package/src/{install → configure/artifacts}/targets/openclaw-mcp.ts +2 -2
  134. package/src/{install → configure/artifacts}/targets/openclaw-skill.ts +3 -3
  135. package/src/{install → configure/artifacts}/targets/opencode-mcp.ts +5 -5
  136. package/src/{install → configure/artifacts}/targets/opencode-skill.ts +3 -3
  137. package/src/{install → configure/artifacts}/targets.test.ts +1 -1
  138. package/src/{install → configure/artifacts}/uninstall.ts +1 -1
  139. package/src/configure/configure.test.ts +11 -11
  140. package/src/configure/index.ts +14 -14
  141. package/src/configure/prompt.ts +2 -2
  142. package/src/{context.ts → core/context.ts} +26 -20
  143. package/src/{json-leaf.test.ts → core/json-leaf.test.ts} +4 -4
  144. package/src/{leaf-inputs.test.ts → core/leaf-inputs.test.ts} +7 -7
  145. package/src/{leaf-inputs.ts → core/leaf-inputs.ts} +16 -12
  146. package/src/{parse.test.ts → core/parse.test.ts} +97 -109
  147. package/src/{parse.ts → core/parse.ts} +129 -31
  148. package/src/{schema.ts → core/schema.ts} +25 -13
  149. package/src/{types.ts → core/types.ts} +225 -35
  150. package/src/{validate.ts → core/validate.ts} +39 -29
  151. package/src/docs/builtin.ts +8 -19
  152. package/src/docs/{api-guide.test.ts → cli-guide.test.ts} +21 -21
  153. package/src/docs/{api-guide.ts → cli-guide.ts} +45 -16
  154. package/src/docs/docs.test.ts +76 -41
  155. package/src/docs/http-guide.ts +37 -34
  156. package/src/docs/mcp-guide.ts +12 -14
  157. package/src/docs/mcp-resources.test.ts +2 -3
  158. package/src/docs/mcp-resources.ts +6 -11
  159. package/src/docs/resolve.ts +22 -30
  160. package/src/docs/save.ts +3 -3
  161. package/src/exports/cli.ts +47 -0
  162. package/src/exports/headless.ts +13 -0
  163. package/src/exports/http.ts +6 -0
  164. package/src/exports/mcp.ts +6 -0
  165. package/src/{headless.test.ts → headless/routing.test.ts} +3 -3
  166. package/src/{headless.ts → headless/routing.ts} +3 -3
  167. package/src/headless/tool-call.ts +114 -46
  168. package/src/help.test.ts +152 -0
  169. package/src/help.ts +3 -3
  170. package/src/hooks/builtin.ts +20 -0
  171. package/src/hooks/run.ts +142 -0
  172. package/src/http/openapi.ts +182 -0
  173. package/src/http/readiness.ts +78 -0
  174. package/src/{api → http}/result.ts +16 -5
  175. package/src/http/routes.ts +329 -0
  176. package/src/http/server.ts +225 -0
  177. package/src/index.ts +36 -25
  178. package/src/log/ecs.test.ts +43 -0
  179. package/src/log/ecs.ts +59 -0
  180. package/src/log/emitter.ts +166 -0
  181. package/src/mcp/bundle.ts +2 -2
  182. package/src/mcp/claude.test.ts +1 -1
  183. package/src/mcp/claude.ts +4 -4
  184. package/src/{hidden-mcpb.test.ts → mcp/hidden-mcpb.test.ts} +10 -9
  185. package/src/mcp/result.ts +2 -2
  186. package/src/mcp/server.ts +54 -6
  187. package/src/mcp/tools.ts +9 -20
  188. package/src/{capabilities.ts → runtime/capabilities.ts} +11 -11
  189. package/src/{cli-errors.ts → runtime/cli-errors.ts} +4 -4
  190. package/src/{cli.ts → runtime/cli.ts} +159 -49
  191. package/src/runtime/exposure.ts +102 -0
  192. package/src/{invoke.test.ts → runtime/invoke.test.ts} +31 -7
  193. package/src/server/context.ts +25 -0
  194. package/src/server/overrides.ts +112 -0
  195. package/src/skill/generate.ts +8 -8
  196. package/src/skill/hint.ts +1 -1
  197. package/src/skill/install.ts +2 -2
  198. package/src/skill/naming.ts +1 -1
  199. package/src/{test-fixtures.ts → test/fixtures.ts} +3 -2
  200. package/src/{config.integration.test.ts → test/integration/config.test.ts} +8 -8
  201. package/src/{api.integration.test.ts → test/integration/http.test.ts} +170 -67
  202. package/src/{mcp.integration.test.ts → test/integration/mcp.test.ts} +11 -57
  203. package/docs/api-server.md +0 -141
  204. package/examples/full-example/docs/api.md +0 -511
  205. package/examples/full-example/src/commands/status/__generated__/outputSchema.json +0 -28
  206. package/examples/full-example/src/config/__generated__/configSchema.json +0 -40
  207. package/examples/full-example/src/config/__generated__/index.ts +0 -5
  208. package/examples/full-example/src/config/types.ts +0 -24
  209. package/src/api/openapi.ts +0 -117
  210. package/src/api/server.ts +0 -120
  211. package/src/builtins/api.ts +0 -38
  212. package/src/hidden.ts +0 -30
  213. package/src/install/plan.ts +0 -53
  214. /package/src/{install → configure/artifacts}/detect-installed.ts +0 -0
  215. /package/src/{install → configure/artifacts}/gh-release-update.test.ts +0 -0
  216. /package/src/{install → configure/artifacts}/mcp-codex.test.ts +0 -0
  217. /package/src/{install → configure/artifacts}/mcp-codex.ts +0 -0
  218. /package/src/{install → configure/artifacts}/mcp-openclaw.test.ts +0 -0
  219. /package/src/{install → configure/artifacts}/mcp-openclaw.ts +0 -0
  220. /package/src/{install → configure/artifacts}/normalize-uninstall.ts +0 -0
  221. /package/src/{install → configure/artifacts}/normalize.ts +0 -0
  222. /package/src/{install → configure/artifacts}/opts.ts +0 -0
  223. /package/src/{install → configure/artifacts}/shell.ts +0 -0
  224. /package/src/{formats.test.ts → core/formats.test.ts} +0 -0
  225. /package/src/{formats.ts → core/formats.ts} +0 -0
  226. /package/src/{respond.ts → core/respond.ts} +0 -0
  227. /package/src/{types.test.ts → core/types.test.ts} +0 -0
  228. /package/src/{api → http}/schema-deref.test.ts +0 -0
  229. /package/src/{api → http}/schema-deref.ts +0 -0
@@ -0,0 +1,69 @@
1
+ /*
2
+ Ordered SQL migrations for the full-example SQLite database.
3
+ */
4
+
5
+ import type { Database } from "bun:sqlite";
6
+ import { readdirSync, readFileSync } from "node:fs";
7
+ import { join } from "node:path";
8
+
9
+ const MIGRATIONS_DIR = join(import.meta.dir, "migrations");
10
+
11
+ const SCHEMA_MIGRATIONS_DDL = `CREATE TABLE IF NOT EXISTS schema_migrations (
12
+ version INTEGER PRIMARY KEY,
13
+ name TEXT NOT NULL,
14
+ applied_at TEXT NOT NULL DEFAULT (datetime('now'))
15
+ )`;
16
+
17
+ interface MigrationFile {
18
+ version: number;
19
+ name: string;
20
+ path: string;
21
+ }
22
+
23
+ /** Sorted migration files under src/db/migrations (e.g. 001_workspaces.sql). */
24
+ export function listMigrationFiles(dir = MIGRATIONS_DIR): MigrationFile[] {
25
+ return readdirSync(dir)
26
+ .filter((name) => name.endsWith(".sql"))
27
+ .map((name) => {
28
+ const match = /^(\d+)_(.+)\.sql$/.exec(name);
29
+ if (!match) {
30
+ throw new Error(`Invalid migration filename (expected NNN_name.sql): ${name}`);
31
+ }
32
+ return {
33
+ version: Number(match[1]),
34
+ name,
35
+ path: join(dir, name),
36
+ };
37
+ })
38
+ .sort((a, b) => a.version - b.version);
39
+ }
40
+
41
+ /** Highest applied migration version, or 0 when schema_migrations is empty. */
42
+ export function appliedMigrationVersion(db: Database): number {
43
+ db.run(SCHEMA_MIGRATIONS_DDL);
44
+ const row = db.query("SELECT COALESCE(MAX(version), 0) AS version FROM schema_migrations").get() as {
45
+ version: number;
46
+ };
47
+ return row.version;
48
+ }
49
+
50
+ /** Apply pending migrations; returns how many files were applied. */
51
+ export function migrate(db: Database, dir = MIGRATIONS_DIR): number {
52
+ db.run(SCHEMA_MIGRATIONS_DDL);
53
+ let applied = 0;
54
+ for (const migration of listMigrationFiles(dir)) {
55
+ const seen = db.query("SELECT 1 AS ok FROM schema_migrations WHERE version = ?").get(migration.version) as {
56
+ ok: number;
57
+ } | null;
58
+ if (seen) {
59
+ continue;
60
+ }
61
+ const sql = readFileSync(migration.path, "utf8");
62
+ db.transaction(() => {
63
+ db.run(sql);
64
+ db.run("INSERT INTO schema_migrations (version, name) VALUES (?, ?)", [migration.version, migration.name]);
65
+ })();
66
+ applied++;
67
+ }
68
+ return applied;
69
+ }
@@ -0,0 +1,6 @@
1
+ -- Workspaces table for the full-example CRUD demo.
2
+ CREATE TABLE IF NOT EXISTS workspaces (
3
+ id TEXT PRIMARY KEY NOT NULL,
4
+ name TEXT NOT NULL,
5
+ created_at TEXT NOT NULL DEFAULT (datetime('now'))
6
+ );
@@ -0,0 +1,66 @@
1
+ import type { Database } from "bun:sqlite";
2
+
3
+ /** One workspace row from the `workspaces` table. */
4
+ export interface Workspace {
5
+ id: string;
6
+ name: string;
7
+ }
8
+
9
+ /** Workspace rows and CRUD queries. */
10
+ export class WorkspacesTable {
11
+ private readonly listStmt;
12
+ private readonly getStmt;
13
+ private readonly insertStmt;
14
+ private readonly updateStmt;
15
+ private readonly deleteStmt;
16
+
17
+ constructor(readonly sqlite: Database) {
18
+ this.listStmt = sqlite.query("SELECT id, name FROM workspaces ORDER BY rowid");
19
+ this.getStmt = sqlite.query("SELECT id, name FROM workspaces WHERE id = ?");
20
+ this.insertStmt = sqlite.query("INSERT INTO workspaces (id, name) VALUES (?, ?)");
21
+ this.updateStmt = sqlite.query("UPDATE workspaces SET name = ? WHERE id = ?");
22
+ this.deleteStmt = sqlite.query("DELETE FROM workspaces WHERE id = ?");
23
+ }
24
+
25
+ /** All workspaces in insertion order. */
26
+ list(): Workspace[] {
27
+ return this.listStmt.all() as Workspace[];
28
+ }
29
+
30
+ /** Lookup workspace by id, or undefined when missing. */
31
+ get(id: string): Workspace | undefined {
32
+ const row = this.getStmt.get(id) as Workspace | null;
33
+ return row ?? undefined;
34
+ }
35
+
36
+ /** Create a workspace with a new id. */
37
+ create(name: string): Workspace {
38
+ const id = crypto.randomUUID();
39
+ this.insertStmt.run(id, name);
40
+ return { id, name };
41
+ }
42
+
43
+ /** Replace workspace name when id exists; otherwise undefined. */
44
+ replace(id: string, name: string): Workspace | undefined {
45
+ const result = this.updateStmt.run(name, id);
46
+ if (result.changes === 0) {
47
+ return undefined;
48
+ }
49
+ return { id, name };
50
+ }
51
+
52
+ /** Patch workspace name when id exists; otherwise undefined. */
53
+ patch(id: string, name: string): Workspace | undefined {
54
+ const existing = this.get(id);
55
+ if (!existing) {
56
+ return undefined;
57
+ }
58
+ this.updateStmt.run(name, id);
59
+ return { ...existing, name };
60
+ }
61
+
62
+ /** Remove workspace by id; true when a row was deleted. */
63
+ delete(id: string): boolean {
64
+ return this.deleteStmt.run(id).changes > 0;
65
+ }
66
+ }
@@ -1,57 +1,32 @@
1
1
  /*
2
- Kitchen-sink CliProgram — every argsbarg builtin enabled; command registration only.
2
+ Reference CliProgram — builtins on; command registration only.
3
3
  */
4
4
 
5
- import type { CliAppConfig, CliAppConfigEntry, CliProgram } from "argsbarg";
5
+ import type { CliProgram } from "argsbarg";
6
6
  import readmeText from "../README.md" with { type: "text" };
7
7
  import { createIdentity } from "../scripts/create-identity.ts";
8
8
  import { echoCommand } from "./commands/echo/command.ts";
9
+ import { renderJsonCommand } from "./commands/render-json/command.ts";
9
10
  import { statusCommand } from "./commands/status/command.ts";
10
- import { configSchema } from "./config/__generated__/index.ts";
11
-
12
- const configEntries = {
13
- apiToken: {
14
- description: "Create at https://example.com/settings/tokens",
15
- env: `${createIdentity.envPrefix}_API_TOKEN`,
16
- sensitive: true,
17
- },
18
- defaultRegion: {
19
- description: "AWS region for API calls.",
20
- required: false,
21
- },
22
- maxRetries: {
23
- description: "HTTP retry count (0–10).",
24
- required: false,
25
- },
26
- prefs: {
27
- description: "Local cache preferences (not exported to env).",
28
- required: false,
29
- },
30
- } as const satisfies Record<string, CliAppConfigEntry>;
11
+ import { workspacesCommand } from "./commands/workspaces/command.ts";
12
+ import { AppDb } from "./db";
31
13
 
32
14
  export const program = {
33
15
  key: createIdentity.key,
34
16
  version: "1.0.0",
35
17
  description: createIdentity.desc,
36
- appConfig: {
37
- jsonSchema: configSchema,
38
- entries: configEntries,
39
- } satisfies CliAppConfig,
40
18
  docs: {
41
- enabled: true,
42
19
  topics: {
43
20
  readme: {
44
21
  text: readmeText,
45
22
  },
46
23
  },
47
24
  },
48
- mcpServer: {
49
- enabled: true,
50
- mcpd: true,
51
- claudePlugin: true,
52
- },
53
- apiServer: {
54
- enabled: true,
25
+ mcpServer: { enabled: true },
26
+ httpServer: { enabled: true },
27
+ readiness: AppDb.checkReadiness,
28
+ hooks: {
29
+ beforeInvoke: AppDb.attach,
55
30
  },
56
- commands: [echoCommand, statusCommand],
31
+ commands: [echoCommand, renderJsonCommand, statusCommand, workspacesCommand],
57
32
  } satisfies CliProgram;
@@ -0,0 +1,11 @@
1
+ import type { AppDb } from "../db/index.ts";
2
+
3
+ declare module "argsbarg" {
4
+ interface CliLocals {
5
+ db: AppDb;
6
+ }
7
+
8
+ interface ServerState {
9
+ db?: AppDb;
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ declare module "*.md" {
2
+ const text: string;
3
+ export default text;
4
+ }
@@ -8,7 +8,10 @@
8
8
  "noEmit": true,
9
9
  "strict": true,
10
10
  "skipLibCheck": true,
11
- "types": ["bun"]
11
+ "types": ["bun"],
12
+ "paths": {
13
+ "~/*": ["./src/*"]
14
+ }
12
15
  },
13
- "include": ["src/**/*.ts", "scripts/**/*.ts"]
16
+ "include": ["src/**/*.ts", "src/**/*.d.ts", "scripts/**/*.ts"]
14
17
  }
@@ -3,7 +3,7 @@
3
3
  MCP test fixture for subprocess integration tests only.
4
4
  */
5
5
 
6
- import { Cli, CliOptionKind, type CliProgram } from "../src/index.ts";
6
+ import { Cli, CliOptionKind, type CliProgram } from "../src/index";
7
7
 
8
8
  const program = {
9
9
  key: "mcp-test",
@@ -30,7 +30,6 @@ const program = {
30
30
  ],
31
31
  },
32
32
  docs: {
33
- enabled: true,
34
33
  topics: {
35
34
  readme: { text: "# MCP test readme\n" },
36
35
  },
@@ -8,18 +8,12 @@ It demonstrates the minimal Bun integration path.
8
8
  */
9
9
 
10
10
  import pkg from "../package.json" with { type: "json" };
11
- import { Cli, CliOptionKind, type CliProgram } from "../src/index.ts";
11
+ import { Cli, CliOptionKind, type CliProgram } from "../src/index";
12
12
 
13
13
  const program = {
14
14
  key: "minimal.ts",
15
15
  version: pkg.version,
16
16
  description: "Tiny demo.",
17
- docs: {
18
- enabled: true,
19
- topics: {
20
- readme: { text: "# minimal.ts\n\nTiny demo.\n" },
21
- },
22
- },
23
17
  positionals: [
24
18
  {
25
19
  name: "name",
@@ -8,7 +8,7 @@ It demonstrates how the schema scales beyond one command.
8
8
  */
9
9
 
10
10
  import pkg from "../package.json" with { type: "json" };
11
- import { Cli, CliFallbackMode, CliOptionKind, type CliProgram } from "../src/index.ts";
11
+ import { Cli, CliFallbackMode, CliOptionKind, type CliProgram } from "../src/index";
12
12
 
13
13
  const program = {
14
14
  key: "nested.ts",
@@ -16,7 +16,6 @@ const program = {
16
16
  description: "Nested groups demo.",
17
17
  mcpServer: { enabled: true },
18
18
  docs: {
19
- enabled: true,
20
19
  topics: {
21
20
  readme: { text: "# nested.ts\n\nNested groups demo.\n" },
22
21
  },
@@ -8,7 +8,7 @@ It demonstrates the minimal Bun integration path.
8
8
  */
9
9
 
10
10
  import pkg from "../package.json" with { type: "json" };
11
- import { Cli, CliOptionKind, type CliProgram, isInteractiveTty } from "../src/index.ts";
11
+ import { Cli, CliOptionKind, type CliProgram, isInteractiveTty } from "../src/index";
12
12
 
13
13
  const program = {
14
14
  key: "option-required.ts",
@@ -4,10 +4,10 @@ This example shows the smallest end-to-end CLI+MCP+API setup.
4
4
  It includes one command, a couple of options, and a direct call to the runtime so
5
5
  readers can copy the pattern into their own scripts quickly.
6
6
 
7
- Demonstrates: `servers.ts hello`, MCP tool `hello`, and `POST /tools/hello`.
7
+ Demonstrates: `servers.ts hello`, MCP tool `hello`, and `POST /api/hello`.
8
8
 
9
9
  Ex API Call:
10
- curl -s -X POST http://127.0.0.1:3000/tools/hello \
10
+ curl -s -X POST http://127.0.0.1:3000/api/hello \
11
11
  -H 'content-type: application/json' \
12
12
  -d '{"name":"alice"}'
13
13
  Ex API Response:
@@ -17,16 +17,15 @@ Ex API Response:
17
17
  */
18
18
 
19
19
  import pkg from "../package.json" with { type: "json" };
20
- import { Cli, CliOptionKind, type CliProgram } from "../src/index.ts";
20
+ import { Cli, CliOptionKind, type CliProgram } from "../src/index";
21
21
 
22
22
  const program = {
23
23
  key: "servers.ts",
24
24
  version: pkg.version,
25
25
  description: "Tiny demo.",
26
26
  mcpServer: { enabled: true },
27
- apiServer: { enabled: true },
27
+ httpServer: { enabled: true },
28
28
  docs: {
29
- enabled: true,
30
29
  topics: {
31
30
  readme: { text: "# servers.ts\n\nServers demo.\n" },
32
31
  },