@adhd/apigen-plugin-cli-output 0.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.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @adhd/apigen-plugin-cli-output
2
+
3
+ apigen target plugin (`--type cli`) — emits a runnable **Commander CLI** (`cli.ts`) with one
4
+ subcommand per export. This is a **generate-only** plugin (no `run` mode); the emitted
5
+ `cli.ts` calls `dispatch` from [`@adhd/apigen-runtime`](../../runtime).
6
+
7
+ Part of [apigen](../../README.md). Driven via [`@adhd/apigen-cli`](../../cli).
8
+
9
+ ```bash
10
+ alias apigen='npx tsx packages/apigen/cli/src/index.ts'
11
+
12
+ apigen generate --source ./api.ts --type cli --out-dir ./out # → out/cli.ts
13
+ node ./out/cli.ts getUser --user-id abc # or: npx tsx ./out/cli.ts …
14
+ ```
15
+
16
+ Each export becomes a `.command('<fn>')`; required params → `.requiredOption`, optional →
17
+ `.option`, booleans → flag form. Middleware-contributed envelope fields (e.g. `session`)
18
+ surface as flags (`--session <key>`). Subcommand stdout is the JSON result of the call.
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export { cliPlugin } from './lib/plugin';
2
+ export { default } from './lib/plugin';
3
+ export { generate } from './lib/generate';