argsbarg 7.0.11 → 7.1.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.
Files changed (89) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/README.md +3 -2
  3. package/docs/ai-skills.md +2 -2
  4. package/docs/cli-program.md +3 -5
  5. package/docs/developing.md +3 -3
  6. package/docs/mcp.md +20 -7
  7. package/docs/output-schema.md +1 -1
  8. package/examples/full-example/AGENTS.md +20 -12
  9. package/examples/full-example/README.md +57 -12
  10. package/examples/full-example/biome.json +5 -4
  11. package/examples/full-example/bunfig.toml +3 -0
  12. package/examples/full-example/justfile +22 -27
  13. package/examples/full-example-json/AGENTS.md +14 -12
  14. package/examples/full-example-json/README.md +63 -15
  15. package/examples/full-example-json/biome.json +1 -3
  16. package/examples/full-example-json/bunfig.toml +3 -0
  17. package/examples/full-example-json/justfile +22 -27
  18. package/examples/mcp-plugin/.claude-plugin/plugin.json +11 -0
  19. package/examples/mcp-plugin/.cursor/hooks/run-tests-on-stop.ts +56 -0
  20. package/examples/mcp-plugin/.cursor/hooks.json +12 -0
  21. package/examples/mcp-plugin/.cursor-plugin/plugin.json +12 -0
  22. package/examples/mcp-plugin/.mcp.json +6 -0
  23. package/examples/mcp-plugin/AGENTS.md +90 -0
  24. package/examples/mcp-plugin/CLAUDE.md +1 -0
  25. package/examples/mcp-plugin/README.md +70 -0
  26. package/examples/mcp-plugin/biome.json +20 -0
  27. package/examples/mcp-plugin/bun.lock +48 -0
  28. package/examples/mcp-plugin/bunfig.toml +3 -0
  29. package/examples/mcp-plugin/docs/README.md +27 -0
  30. package/examples/mcp-plugin/docs/cli-schema.json +2085 -0
  31. package/examples/mcp-plugin/docs/cli.md +2026 -0
  32. package/examples/mcp-plugin/docs/http.md +92 -0
  33. package/examples/mcp-plugin/docs/mcp.md +116 -0
  34. package/examples/mcp-plugin/docs/openapi.json +1243 -0
  35. package/examples/mcp-plugin/justfile +89 -0
  36. package/examples/mcp-plugin/mcp.json +8 -0
  37. package/examples/mcp-plugin/package.json +23 -0
  38. package/examples/mcp-plugin/scripts/create-identity.ts +12 -0
  39. package/examples/mcp-plugin/scripts/mcp.mjs +11106 -0
  40. package/examples/mcp-plugin/scripts/release.ts +225 -0
  41. package/examples/mcp-plugin/skills/mcp-plugin/SKILL.md +59 -0
  42. package/examples/mcp-plugin/src/commands/echo/command.ts +26 -0
  43. package/examples/mcp-plugin/src/commands/render-json/__generated__/RenderJsonInputSchema.json +15 -0
  44. package/examples/mcp-plugin/src/commands/render-json/__generated__/index.ts +5 -0
  45. package/examples/mcp-plugin/src/commands/render-json/command.test.ts +46 -0
  46. package/examples/mcp-plugin/src/commands/render-json/command.ts +30 -0
  47. package/examples/mcp-plugin/src/commands/render-json/types.ts +9 -0
  48. package/examples/mcp-plugin/src/commands/status/__generated__/StatusJsonOutputSchema.json +15 -0
  49. package/examples/mcp-plugin/src/commands/status/__generated__/index.ts +5 -0
  50. package/examples/mcp-plugin/src/commands/status/command.test.ts +10 -0
  51. package/examples/mcp-plugin/src/commands/status/command.ts +28 -0
  52. package/examples/mcp-plugin/src/commands/status/types.ts +6 -0
  53. package/examples/mcp-plugin/src/commands/workspaces/__generated__/WorkspaceNameInputSchema.json +15 -0
  54. package/examples/mcp-plugin/src/commands/workspaces/__generated__/index.ts +5 -0
  55. package/examples/mcp-plugin/src/commands/workspaces/command.test.ts +58 -0
  56. package/examples/mcp-plugin/src/commands/workspaces/command.ts +94 -0
  57. package/examples/mcp-plugin/src/commands/workspaces/types.ts +6 -0
  58. package/examples/mcp-plugin/src/db/index.test.ts +86 -0
  59. package/examples/mcp-plugin/src/db/index.ts +77 -0
  60. package/examples/mcp-plugin/src/db/tables/workspaces.ts +58 -0
  61. package/examples/mcp-plugin/src/index.ts +10 -0
  62. package/examples/mcp-plugin/src/program.ts +32 -0
  63. package/examples/mcp-plugin/src/types/argsbarg.d.ts +11 -0
  64. package/examples/mcp-plugin/src/types/md.d.ts +4 -0
  65. package/examples/mcp-plugin/tsconfig.json +17 -0
  66. package/index.d.ts +12 -0
  67. package/package.json +1 -1
  68. package/src/builtins/mcp.ts +1 -1
  69. package/src/cli-tool/create.test.ts +5 -0
  70. package/src/cli-tool/create.ts +9 -1
  71. package/src/config/manifest.ts +56 -0
  72. package/src/config/resolve.test.ts +12 -12
  73. package/src/configure/configure.test.ts +5 -3
  74. package/src/core/parse.test.ts +6 -5
  75. package/src/core/types.ts +12 -0
  76. package/src/exports/mcp.ts +12 -0
  77. package/src/mcp/bundle.ts +12 -3
  78. package/src/mcp/claude.test.ts +2 -7
  79. package/src/mcp/claude.ts +49 -67
  80. package/src/mcp/cursor.test.ts +151 -0
  81. package/src/mcp/cursor.ts +155 -0
  82. package/src/mcp/hidden-mcpb.test.ts +34 -1
  83. package/src/mcp/plugin-shared.ts +107 -0
  84. package/src/mcp/result.ts +5 -1
  85. package/src/mcp/server.ts +3 -2
  86. package/src/test/fixtures.ts +13 -0
  87. package/src/test/integration/mcp.test.ts +8 -7
  88. package/examples/full-example/scripts/print-identity.ts +0 -28
  89. package/examples/full-example-json/scripts/print-identity.ts +0 -28
@@ -1,24 +1,19 @@
1
+ # bash (not sh); -e bail on errors, -u error on unset vars, pipefail fails pipelines when any stage fails
1
2
  set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
2
3
 
3
4
  export PATH := justfile_directory() + "/node_modules/.bin:" + env_var("PATH")
4
5
 
5
- cli_key := `bun scripts/print-identity.ts key`
6
- tap_org := `bun scripts/print-identity.ts tapOrg`
7
- tap_repo := `bun scripts/print-identity.ts tapRepo`
8
- tap := `bun scripts/print-identity.ts tap`
9
- release_repo := `bun scripts/print-identity.ts releaseRepo`
10
- tap_git_url := "git@github.com:" + release_repo + ".git"
11
6
  brew_prefix := `brew --prefix`
12
- tap_parent := brew_prefix + "/Library/Taps/" + tap_org
13
- tap_path := tap_parent + "/homebrew-" + tap_repo
7
+ tap_parent := brew_prefix + "/Library/Taps/{tapOrg}"
8
+ tap_path := tap_parent + "/homebrew-{tapRepo}"
14
9
 
15
10
  # List available recipes (default)
16
11
  _:
17
12
  @just --list
18
13
 
19
- # Compile the CLI binary to dist/full-example
14
+ # Compile the CLI binary to dist/full-example-json
20
15
  build:
21
- bun build ./src/index.ts --compile --outfile=dist/{{cli_key}}
16
+ bun build ./src/index.ts --compile --outfile=dist/full-example-json
22
17
  @rm -f .*.bun-build
23
18
 
24
19
  # Apply SQL migrations in src/db/migrations/ to a SQLite database file
@@ -44,11 +39,11 @@ demo-http:
44
39
 
45
40
  # demo a CLI command
46
41
  demo-cli:
47
- @just run {{cli_key}} status
42
+ @just run full-example-json status
48
43
 
49
44
  # demo a CLI command
50
45
  demo-help:
51
- @just run {{cli_key}} --help
46
+ @just run full-example-json --help
52
47
 
53
48
  # Run the CLI from source with optional args; restarts on file changes
54
49
  dev *ARGS:
@@ -80,26 +75,26 @@ install-local: uninstall build
80
75
  mkdir -p {{tap_parent}}
81
76
  ln -sfn '{{justfile_directory()}}' {{tap_path}}
82
77
  bun scripts/dev-formula.ts install
83
- HOMEBREW_NO_ASK=1 brew reinstall --formula {{tap}}/{{cli_key}} || HOMEBREW_NO_ASK=1 brew install --force --formula {{tap}}/{{cli_key}}
78
+ HOMEBREW_NO_ASK=1 brew reinstall --formula bdombro/bun-argsbarg/full-example-json || HOMEBREW_NO_ASK=1 brew install --force --formula bdombro/bun-argsbarg/full-example-json
84
79
  bun scripts/dev-formula.ts reset
85
- {{cli_key}} configure install
80
+ full-example-json configure install
86
81
 
87
82
  # Remove local dev install, then install from GitHub tap (requires gh auth login)
88
83
  install-production: uninstall
89
- brew tap {{release_repo}} {{tap_git_url}}
90
- brew install --formula {{release_repo}}/{{cli_key}}
91
- {{cli_key}} configure install
84
+ brew tap bdombro/bun-argsbarg git@github.com:bdombro/bun-argsbarg.git
85
+ brew install full-example-json
86
+ full-example-json configure install
92
87
 
93
88
  # Alias for backward compatibility
94
89
  reinstall: reinstall-local
95
90
 
96
91
  # Rebuild binary and swap into Cellar (run install-local first; run `just refresh` for skills/MCP)
97
92
  reinstall-local: build
98
- install -m 755 dist/{{cli_key}} "$(brew --prefix {{cli_key}})/bin/{{cli_key}}"
93
+ install -m 755 dist/full-example-json "$(brew --prefix full-example-json)/bin/full-example-json"
99
94
 
100
95
  # Refresh agent skills/MCP without reinstalling the binary
101
96
  refresh:
102
- {{cli_key}} configure install
97
+ full-example-json configure install
103
98
 
104
99
  # Lint sources without writing
105
100
  lint:
@@ -129,12 +124,12 @@ release *ARGS:
129
124
 
130
125
  # Install release formula from tap and run formula test
131
126
  test-release:
132
- HOMEBREW_NO_ASK=1 brew untap {{tap}} 2>/dev/null || true
127
+ HOMEBREW_NO_ASK=1 brew untap bdombro/bun-argsbarg 2>/dev/null || true
133
128
  mkdir -p {{tap_parent}}
134
129
  ln -sfn '{{justfile_directory()}}' {{tap_path}}
135
- HOMEBREW_NO_ASK=1 brew uninstall --formula {{tap}}/{{cli_key}} 2>/dev/null || true
136
- brew install --formula {{tap}}/{{cli_key}}
137
- brew test {{cli_key}}
130
+ HOMEBREW_NO_ASK=1 brew uninstall --formula bdombro/bun-argsbarg/full-example-json 2>/dev/null || true
131
+ brew install --formula bdombro/bun-argsbarg/full-example-json
132
+ brew test full-example-json
138
133
 
139
134
  # Typecheck without emitting build artifacts
140
135
  typecheck:
@@ -142,7 +137,7 @@ typecheck:
142
137
 
143
138
  # Undo dev/Homebrew install (remove agent artifacts, then keg + untap)
144
139
  uninstall:
145
- @{{cli_key}} configure uninstall --yes 2>/dev/null || just run configure uninstall --yes
146
- @HOMEBREW_NO_ASK=1 brew uninstall --formula {{tap}}/{{cli_key}} 2>/dev/null || true
147
- @HOMEBREW_NO_ASK=1 brew uninstall --formula {{tap}}/{{cli_key}}-local 2>/dev/null || true
148
- @HOMEBREW_NO_ASK=1 brew untap {{tap}} 2>/dev/null || true
140
+ @full-example-json configure uninstall --yes 2>/dev/null || just run configure uninstall --yes
141
+ @HOMEBREW_NO_ASK=1 brew uninstall --formula bdombro/bun-argsbarg/full-example-json 2>/dev/null || true
142
+ @HOMEBREW_NO_ASK=1 brew uninstall --formula bdombro/bun-argsbarg/full-example-json-local 2>/dev/null || true
143
+ @HOMEBREW_NO_ASK=1 brew untap bdombro/bun-argsbarg 2>/dev/null || true
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "mcp-plugin",
3
+ "version": "1.0.0",
4
+ "description": "Argsbarg MCP plugin template for Cursor and Claude Code marketplaces",
5
+ "author": {
6
+ "name": "Brian Dombrowski"
7
+ },
8
+ "homepage": "https://github.com/bdombro/bun-argsbarg",
9
+ "repository": "https://github.com/bdombro/bun-argsbarg",
10
+ "skills": ["skills/mcp-plugin"]
11
+ }
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env bun
2
+ /* Cursor stop hook: run `just test` on agent completion; follow up if it fails. */
3
+
4
+ try {
5
+ const empty = () => {
6
+ console.log("{}");
7
+ process.exit(0);
8
+ };
9
+
10
+ const input = JSON.parse(await Bun.stdin.text()) as {
11
+ status?: string;
12
+ loop_count?: number;
13
+ workspace_roots?: string[];
14
+ };
15
+
16
+ if (input.status !== "completed") empty();
17
+
18
+ const cwd = input.workspace_roots?.[0] ?? process.cwd();
19
+ if (!(await Bun.file(`${cwd}/justfile`).exists())) empty();
20
+
21
+ const diff = Bun.spawnSync(["git", "diff", "--name-only", "HEAD"], { cwd, stdout: "pipe" });
22
+ const CODE_FILE = /\.(t|j)sx?$/i;
23
+ const SKIP_PREFIX = /^(node_modules|dist|\.cursor)\//;
24
+ const changed = new TextDecoder()
25
+ .decode(diff.stdout)
26
+ .split("\n")
27
+ .some(
28
+ (path) =>
29
+ path &&
30
+ (path === "justfile" || (CODE_FILE.test(path) && !SKIP_PREFIX.test(path))),
31
+ );
32
+ if (!changed) empty();
33
+
34
+ const proc = Bun.spawnSync(["just", "test"], {
35
+ cwd,
36
+ env: { ...process.env, FORCE_COLOR: "0" },
37
+ stderr: "pipe",
38
+ stdout: "pipe",
39
+ });
40
+ const output =
41
+ new TextDecoder().decode(proc.stdout) + new TextDecoder().decode(proc.stderr);
42
+
43
+ if (proc.exitCode === 0) empty();
44
+
45
+ const lines = output.trimEnd().split("\n");
46
+ const tail = lines.length > 80 ? lines.slice(-80).join("\n") : output.trimEnd();
47
+ const n = (input.loop_count ?? 0) + 1;
48
+
49
+ console.log(
50
+ JSON.stringify({
51
+ followup_message: `Tests failed (auto-retry ${n}/20). Fix and ensure \`just test\` passes.\n\n\`\`\`\n${tail}\n\`\`\``,
52
+ }),
53
+ );
54
+ } catch {
55
+ console.log("{}");
56
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "stop": [
5
+ {
6
+ "command": "bun .cursor/hooks/run-tests-on-stop.ts",
7
+ "loop_limit": 20,
8
+ "timeout": 180
9
+ }
10
+ ]
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "mcp-plugin",
3
+ "displayName": "McpPlugin",
4
+ "description": "Argsbarg MCP plugin template for Cursor and Claude Code marketplaces",
5
+ "version": "1.0.0",
6
+ "author": {
7
+ "name": "Brian Dombrowski"
8
+ },
9
+ "homepage": "https://github.com/bdombro/bun-argsbarg",
10
+ "repository": "https://github.com/bdombro/bun-argsbarg",
11
+ "skills": ["skills/mcp-plugin"]
12
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "mcp-plugin": {
3
+ "command": "node",
4
+ "args": ["${CLAUDE_PLUGIN_ROOT}/scripts/mcp.mjs", "mcp"]
5
+ }
6
+ }
@@ -0,0 +1,90 @@
1
+ # mcp-plugin
2
+
3
+ <!-- argsbarg:managed — overwritten on merge; framework baseline; app-specific sections below take precedence -->
4
+
5
+ > **Baseline framework rules:** The conventions below are defaults for argsbarg projects. Project-specific sections below this managed block override these defaults.
6
+
7
+ ## Argsbarg schema
8
+
9
+ When adding or changing argsbarg schema, leaf handlers, or MCP exposure:
10
+
11
+ 1. **Read** `node_modules/argsbarg/docs/cli-program.md` (required — authoritative guide).
12
+ 2. MCP tools, varargs, `inputSchema` → also `node_modules/argsbarg/docs/mcp.md`.
13
+ 3. JSON stdout / `outputSchema` guide and codegen → `node_modules/argsbarg/docs/output-schema.md`.
14
+ 4. App config / `program.appConfig` guide and codegen → `node_modules/argsbarg/docs/config-schema.md`.
15
+ 5. `configure`, `configure.targets`, Homebrew distribution → `node_modules/argsbarg/docs/configure.md` and `distribution-homebrew.md`.
16
+ 6. Bundled `docs` built-in → `node_modules/argsbarg/docs/bundled-docs.md`.
17
+ 7. **Examples** (shipped under `node_modules/argsbarg/examples/`):
18
+ - **Copy template** (all builtins, `@sg` schemagen, Homebrew justfile, `outputSchema`) → `examples/full-example/`
19
+
20
+ **Hard rules** (details and examples are in the docs above — do not contradict them):
21
+
22
+ - Reserved root commands: `completion`, `configure`, `mcp`, `version`, `docs`.
23
+ - `satisfies CliProgram` / `CliLeaf`; action-oriented `description` on root, commands, options, and positionals.
24
+ - Omit `mcpTool` unless genuinely CLI-only (`enabled: false`) or an irreducible wire limit — fix schema and headless handlers first.
25
+ - Interactive leaves: one headless path for MCP, non-TTY CLI, and `--yes` / `--dry-run` / `--json` (`shouldRunHeadless*`, `requireYesInNonTty`); not raw `isTTY`.
26
+ - String options: `format` / `default` / `pattern` per `cli-program.md`; `readLeafInputs()` for multi-flag leaves.
27
+ - Varargs (`argMax: 0`): CLI space-separated; MCP JSON array only — no comma-splitting positionals.
28
+ - Multi-surface leaves (Ink + headless + MCP): one **`read*Flags(ctx)`** per command (or shared family helper + extensions); one **`resolve*Input(flags)`** for cross-field rules — handler reads ctx once, all paths share the struct.
29
+ - JSON stdout: `import { StatusJsonOutputSchema } from "./__generated__"` — declare `/** @sg */` on the type in `types.ts`; handlers import types from the same module.
30
+ - App config (optional): `import { AppConfigSchema } from "./config/__generated__"` — `/** @sg */` on `AppConfig` in `src/config/types.ts`.
31
+
32
+ ## Code conventions
33
+
34
+ ### JSDoc
35
+
36
+ Add doc comments for exported surfaces that are not obvious from the name alone: JSON output schemas, public types, and non-trivial algorithms. Skip comments on short test callbacks and pure re-export files.
37
+
38
+ ### Names
39
+
40
+ Use names that describe the domain role, not generic placeholders like `data` or `handler`, except in very small scopes.
41
+
42
+ ### Structure
43
+
44
+ After imports, put **exported** symbols first (alphabetical within each kind), then **module-private** helpers at the bottom. Use `~/…` only where you would otherwise use `../` (or deeper) to reach another module under `src/`. Same-directory (`./`) and child (`./foo/…`) imports stay relative. Use `.ts` extensions.
45
+
46
+ ### Module boundaries
47
+
48
+ | Path | Owns | Must not |
49
+ | --- | --- | --- |
50
+ | `src/index.ts` | Thin entry: `new Cli(program).run()` | Inline leaf handlers, business logic |
51
+ | `src/types/` | Global type declarations and module augmentations (e.g. `argsbarg.d.ts`, `md.d.ts`) | Runtime logic, imports from outside `types/` |
52
+ | `src/program.ts` | `CliProgram` assembly: `docs`, `commands: […]` | Inline leaf handlers, business logic |
53
+ | `src/db/` | `AppDb` (SQLite connect, migrate, domain access), `migrate.ts`, `migrations/*.sql` | Command handlers |
54
+ | `src/commands/<name>/` | One user-facing command: `command.ts`, optional `types.ts` with `/** @sg */` | Shared helpers (lift to `src/db/`) |
55
+ | `src/**/__generated__/` | Generated JSON Schema + `index.ts` re-exports | Hand-edited generated files |
56
+ | `scripts/` | Dev tooling (formula helpers) | Production command paths |
57
+
58
+ When adding commands: `src/commands/<name>/command.ts` + `types.ts` when schemas are needed; register in `program.ts` **alphabetically by command key**.
59
+
60
+ **Argsbarg schema:** see Argsbarg schema section above.
61
+
62
+ ### Execution
63
+
64
+ - **Runtime:** Bun (`just test`, `just dev`).
65
+ - **Tests:** colocate `*.test.ts` next to the module.
66
+ - **Schemagen:** after changing `/** @sg */` types in `src/`, run `just schemagen` (`__generated__/` is gitignored).
67
+ - **Repository skill:** When adding, renaming, or removing commands, update `skills/<key>/SKILL.md` so the intent-based router remains accurate for end-user agents. (`just docgen` updates `./docs/` only and never overwrites `skills/`).
68
+
69
+ ### Abstractions
70
+
71
+ Avoid needless extraction: keep single-use helpers in the calling file by default. Split only when reused elsewhere, the caller is large or hard to follow, or extraction clarifies a substantial unit. Do not create tiny one-off helpers.
72
+ - ❌ `utils/formatX.ts` — 60-line helper used by one command
73
+ - ✅ inline helper in that command file
74
+
75
+ <!-- /argsbarg:managed -->
76
+
77
+ ## Tooling
78
+
79
+ - Bun only (`bun`, `bunx`, `bun test`). No Node/npm/pnpm.
80
+
81
+ ## Documentation
82
+
83
+ - `README.md` — user-facing install/commands
84
+ - `docs/architecture.md` — maintainer internals (create if missing)
85
+ - Generated: `just docgen` → `docs/cli.md`, `docs/cli-schema.json`
86
+ - `skills/mcp-plugin/SKILL.md` — agent skill router (scaffolded from template; customize as needed)
87
+
88
+ ## App conventions
89
+
90
+ Replace with app-specific bullets.
@@ -0,0 +1 @@
1
+ @AGENTS.md
@@ -0,0 +1,70 @@
1
+ # mcp-plugin
2
+
3
+ Argsbarg MCP plugin template for Cursor and Claude Code marketplaces (@sg schemagen, JSON schemas, in-repo manifests).
4
+
5
+ ## Overview
6
+
7
+ `mcp-plugin` packages an MCP server and agent skills directly for Cursor and Claude Code marketplaces:
8
+
9
+ - **Cursor Plugin**: `.cursor-plugin/plugin.json` and `mcp.json` running `${CURSOR_PLUGIN_ROOT}/scripts/mcp.mjs` via `node`.
10
+ - **Claude Code Plugin**: `.claude-plugin/plugin.json` and `.mcp.json` running `${CLAUDE_PLUGIN_ROOT}/scripts/mcp.mjs` via `node`.
11
+ - **In-repo skills**: `skills/mcp-plugin/SKILL.md` discovered and loaded by agent platforms.
12
+ - **Standalone runner**: `bun build --target=node src/index.ts --outfile scripts/mcp.mjs` creates an inlined, zero-npm-install script.
13
+
14
+ ## Development
15
+
16
+ ```bash
17
+ # Install dependencies and generate schemas
18
+ just setup
19
+
20
+ # Build standalone MCP bundle
21
+ just build
22
+
23
+ # Test MCP server directly with node
24
+ node ./scripts/mcp.mjs mcp
25
+
26
+ # Link into local Cursor plugins for live testing
27
+ just install-plugin-cursor
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ - `mcp-plugin echo` — Echo text back to stdout or inspect flags.
33
+ - `mcp-plugin render-json` — Process structured JSON payloads with schema validation.
34
+ - `mcp-plugin status` — Show application version with schemagen output schema (`--json`).
35
+ - `mcp-plugin workspaces` — Manage workspace resources (REST CRUD with in-memory SQLite).
36
+
37
+ ### Built-in commands
38
+
39
+ - `mcp-plugin completion` — Install or inspect shell tab completions (bash, zsh, fish).
40
+ - `mcp-plugin configure` — Manage agent artifacts (skills, MCP, application configuration).
41
+ - `mcp-plugin docs` — Browse bundled documentation topics (`cli`, `mcp`, `http`, `readme`).
42
+ - `mcp-plugin mcp` — Start the Model Context Protocol (stdio) server for AI coding agents.
43
+ - `mcp-plugin version` — Display version information.
44
+
45
+ ## Distribution & Marketplaces
46
+
47
+ ### Cursor
48
+
49
+ - **Local Development / Testing**: Run `just install-plugin-cursor` to link the repo into `~/.cursor/plugins/local/mcp-plugin`. Reload the Cursor window to activate.
50
+ - **Team Marketplace**: In Cursor Dashboard → **Settings → Plugins → Team Marketplaces → Import**, enter your GitHub repository URL.
51
+ - **Official Cursor Marketplace**: Submit your repository URL at [cursor.com/marketplace/publish](https://cursor.com/marketplace/publish). Once approved, users can install directly via `/add-plugin mcp-plugin` or from the Customize sidebar.
52
+
53
+ ### Claude Code
54
+
55
+ - **Direct Git Install**: Users can add your repository without central registration:
56
+ ```bash
57
+ /plugin marketplace add <owner>/<repo>
58
+ /plugin install mcp-plugin
59
+ /reload-plugins
60
+ ```
61
+ - **Official Directory**: Submit a pull request to [anthropics/claude-plugins-official](https://github.com/anthropics/claude-plugins-official) under `external_plugins/`. Once merged, users can install directly via `/plugin install mcp-plugin@claude-plugins-official`.
62
+
63
+ ## Documentation
64
+
65
+ | Need | Resource |
66
+ | --- | --- |
67
+ | CLI reference | [docs/cli.md](docs/cli.md) or `mcp-plugin docs cli` |
68
+ | MCP tools | [docs/mcp.md](docs/mcp.md) or `mcp-plugin docs mcp` |
69
+ | HTTP API | [docs/http.md](docs/http.md) or `mcp-plugin docs http` |
70
+ | OpenAPI 3.1 | [docs/openapi.json](docs/openapi.json) |
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.5.0/schema.json",
3
+ "assist": { "actions": { "source": { "organizeImports": "on" } } },
4
+ "linter": {
5
+ "enabled": true,
6
+ "rules": {
7
+ "preset": "recommended"
8
+ }
9
+ },
10
+ "formatter": {
11
+ "enabled": true,
12
+ "indentStyle": "space",
13
+ "lineWidth": 120
14
+ },
15
+ "overrides": [
16
+ {
17
+ "includes": ["**/*.json"]
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "configVersion": 1,
4
+ "workspaces": {
5
+ "": {
6
+ "name": "consumer-app-example",
7
+ "dependencies": {
8
+ "argsbarg": "file:../..",
9
+ },
10
+ "devDependencies": {
11
+ "@biomejs/biome": "^2.5.0",
12
+ "@types/bun": "^1.3.12",
13
+ "typescript": "^5.9.3",
14
+ },
15
+ },
16
+ },
17
+ "packages": {
18
+ "@biomejs/biome": ["@biomejs/biome@2.5.1", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.5.1", "@biomejs/cli-darwin-x64": "2.5.1", "@biomejs/cli-linux-arm64": "2.5.1", "@biomejs/cli-linux-arm64-musl": "2.5.1", "@biomejs/cli-linux-x64": "2.5.1", "@biomejs/cli-linux-x64-musl": "2.5.1", "@biomejs/cli-win32-arm64": "2.5.1", "@biomejs/cli-win32-x64": "2.5.1" }, "bin": { "biome": "bin/biome" } }, "sha512-IXWLCxKmae+rI7LOHS1B3EbVisQ6GRAWbhN9msa6KjNCyFWrvKZWR4oUdinaNssrV852OrSHuSPa95h1GPJc7Q=="],
19
+
20
+ "@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.5.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-npqDzvqv7vFaWRiNN1Te71siRgPaqS9MpqgYCdP/CrUbkJ7ApezaeaKjueKHRN/JH/6lRjJQAHi8acQDCAz22w=="],
21
+
22
+ "@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.5.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-RgwTqPAM8g2tn1j+b5oRjF/DbSBX8a4gwojtuG9XuhfK7GgomvZ9+T+tqjXiVbjLEeGJOoL6VEk8mvRTVeSybw=="],
23
+
24
+ "@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.5.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-yhV35CzZh38VyMvTEXi3JTjxZBs++oCKK9KG8vB6VI5+uvQvZNR3BFWEKKzuOmx9DJJj7sQpZ4LQJcmbGTs3+Q=="],
25
+
26
+ "@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.5.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-WMcvMLgByyTqVxGlq918NBBYliq9FRR9GAQVETHb+VjGVqXCZFfHlZHC1FX4ibuYY/Hg6TJE3rHU0xVrdJXNRw=="],
27
+
28
+ "@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.5.1", "", { "os": "linux", "cpu": "x64" }, "sha512-J/7uHSX7NfoYDI7HijAkd8lnQIOrRb2W7j3X+tw4R+N5ExvXGsyXFiGdQcfcxfOmNQmZVSQOCDk757fwpzqQcg=="],
29
+
30
+ "@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.5.1", "", { "os": "linux", "cpu": "x64" }, "sha512-ANTowtlLmPYm5yeMckWY8Xzb9Ix+JJP3tgHR/n6xRj1VWyIzzWtfRfih9hv9VmClwadpBvZduISZIbBsIlYG3A=="],
31
+
32
+ "@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.5.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-zgXnKNgWPC4iPF7Y1lR3STUeCUuZRpD6IiOrC7TZTlh0Lx6FiVUT05myuMQHQ9D+1cc7uyMldi4forE6lp0ivQ=="],
33
+
34
+ "@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.5.1", "", { "os": "win32", "cpu": "x64" }, "sha512-6uxpR9hvaglANkZemeSiN/FhYgkGasrEGn267eXIWvjrjJ2LhDlk251IhjVJq6MXzkV2/bcXwLwSroLyPtqRZg=="],
35
+
36
+ "@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
37
+
38
+ "@types/node": ["@types/node@26.0.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-vf2YFi1iY9lHGwNJMs01biZFbKJkrZR1T6/MlzjhJLPdntOHLhTrDSnSVcdtvjihi4VQNlrFRIxLsDBlQpAipA=="],
39
+
40
+ "argsbarg": ["argsbarg@file:../..", { "devDependencies": { "@biomejs/biome": "^2.5.0", "@types/bun": "^1.3.12", "typescript": "^5.9.3" }, "bin": { "argsbarg": "src/index.ts" } }],
41
+
42
+ "bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
43
+
44
+ "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
45
+
46
+ "undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
47
+ }
48
+ }
@@ -0,0 +1,3 @@
1
+ [install]
2
+ # fetch package.json deps on first `bun src/index.ts` without manual `bun install`.
3
+ auto = "fallback"
@@ -0,0 +1,27 @@
1
+ # full-example documentation
2
+
3
+ Reference template for argsbarg consumer docgen. Every builtin is enabled in `src/program.ts`.
4
+
5
+ | If you are… | Read |
6
+ | --- | --- |
7
+ | **Using the CLI** | [../README.md](../README.md) |
8
+ | **Authoring argsbarg schema** | `node_modules/argsbarg/docs/cli-program.md` — see [`AGENTS.md`](../AGENTS.md) |
9
+ | **HTTP API / curl** | [http.md](http.md) — generated; or run `full-example docs http` |
10
+ | **MCP tools** | [mcp.md](mcp.md) — generated; or run `full-example docs mcp` |
11
+ | **Full command tree (markdown)** | [cli.md](cli.md) — generated |
12
+ | **Full command tree (JSON)** | [cli-schema.json](cli-schema.json) — generated |
13
+ | **OpenAPI 3.1** | [openapi.json](openapi.json) — generated |
14
+ | **Agent skill router** | [../skills/full-example-json/SKILL.md](../skills/full-example-json/SKILL.md) — scaffolded from template |
15
+
16
+ ## Framework docs vs this directory
17
+
18
+ | Layer | Contents |
19
+ | --- | --- |
20
+ | **Argsbarg framework** | How to author `CliProgram`, MCP, HTTP API | `node_modules/argsbarg/docs/` |
21
+ | **This `docs/` folder** | *full-example* command tree and guides | `just docgen` |
22
+
23
+ Do not hand-edit generated files. Refresh with:
24
+
25
+ ```bash
26
+ just docgen
27
+ ```