@mdocui/cli 0.3.0 → 0.4.1

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 (2) hide show
  1. package/README.md +79 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # @mdocui/cli
2
+
3
+ CLI for [mdocUI](https://github.com/mdocui/mdocui) — scaffold projects, generate system prompts, and preview output.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npx @mdocui/cli init
9
+ ```
10
+
11
+ Or install globally:
12
+
13
+ ```bash
14
+ pnpm add -g @mdocui/cli
15
+ ```
16
+
17
+ ## Commands
18
+
19
+ ### `init`
20
+
21
+ Scaffold a new mdocUI config file with starter components.
22
+
23
+ ```bash
24
+ npx @mdocui/cli init
25
+ ```
26
+
27
+ Creates:
28
+ - `mdocui.config.ts` — component definitions and config
29
+ - `generated/` — output directory for system prompts
30
+
31
+ ### `generate`
32
+
33
+ Generate a system prompt from your component registry and write it to a file.
34
+
35
+ ```bash
36
+ npx @mdocui/cli generate
37
+ ```
38
+
39
+ Reads `mdocui.config.ts` and writes the prompt to the configured `output` path (default: `system-prompt.txt`).
40
+
41
+ ### `preview`
42
+
43
+ Print the generated system prompt to stdout for review.
44
+
45
+ ```bash
46
+ npx @mdocui/cli preview
47
+ ```
48
+
49
+ ## Config File
50
+
51
+ ```typescript
52
+ // mdocui.config.ts
53
+ import { defineComponent } from '@mdocui/core'
54
+ import { z } from 'zod'
55
+
56
+ const button = defineComponent({
57
+ name: 'button',
58
+ description: 'Clickable action button',
59
+ props: z.object({
60
+ action: z.string().describe('Action to perform'),
61
+ label: z.string().describe('Button text'),
62
+ }),
63
+ children: 'none',
64
+ })
65
+
66
+ export default {
67
+ components: [button],
68
+ output: './generated/system-prompt.txt',
69
+ preamble: 'You are a helpful assistant.',
70
+ additionalRules: ['End responses with follow-up buttons'],
71
+ groups: [{ name: 'Interactive', components: ['button'] }],
72
+ }
73
+ ```
74
+
75
+ ## Links
76
+
77
+ - [GitHub Repository](https://github.com/mdocui/mdocui)
78
+ - [@mdocui/core](https://github.com/mdocui/mdocui/tree/main/packages/core)
79
+ - [@mdocui/react](https://github.com/mdocui/mdocui/tree/main/packages/react)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdocui/cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "CLI for mdocUI — scaffold, generate system prompts, preview",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "dependencies": {
15
15
  "zod": "^4.3.0",
16
- "@mdocui/core": "0.3.0"
16
+ "@mdocui/core": "0.4.1"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "^25.5.0",