@formlm/cli 0.1.3 → 0.2.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.
- package/README.md +261 -77
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/app.js +24 -0
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/connect.d.ts +3 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +560 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/expert.d.ts +3 -0
- package/dist/commands/expert.d.ts.map +1 -0
- package/dist/commands/expert.js +123 -0
- package/dist/commands/expert.js.map +1 -0
- package/dist/commands/field.d.ts.map +1 -1
- package/dist/commands/field.js +11 -3
- package/dist/commands/field.js.map +1 -1
- package/dist/commands/report.d.ts +3 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +507 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/scale.d.ts +3 -0
- package/dist/commands/scale.d.ts.map +1 -0
- package/dist/commands/scale.js +289 -0
- package/dist/commands/scale.js.map +1 -0
- package/dist/commands/share.d.ts.map +1 -1
- package/dist/commands/share.js +22 -3
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/skill.d.ts +15 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +31 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/smart.d.ts +3 -0
- package/dist/commands/smart.d.ts.map +1 -0
- package/dist/commands/smart.js +85 -0
- package/dist/commands/smart.js.map +1 -0
- package/dist/commands/snapshot.d.ts +14 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +64 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/exec.d.ts +8 -2
- package/dist/exec.d.ts.map +1 -1
- package/dist/exec.js +28 -2
- package/dist/exec.js.map +1 -1
- package/dist/index.js +48 -8
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +442 -272
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,13 +20,52 @@ With `formlm-cli`, you can control FormLM directly from your terminal or plug it
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## What's New in v0.2.1
|
|
24
24
|
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
|
|
25
|
+
- **Field ID validation**: `field add --id` now enforces snake_case regex (`^[a-zA-Z0-9_]+$`)
|
|
26
|
+
- **Snapshot `--md` flag**: Unified JSON output by default, with optional `--md` for markdown format
|
|
27
|
+
- **Error handler**: Missing required options now print usage hints instead of bare error messages
|
|
28
|
+
- **Server-side fixes**: SessionContext appId sync, ScaleCommand B5 reversal removal, CLI --app extraction
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## What's New in v0.2.0
|
|
33
|
+
|
|
34
|
+
The MCP architecture has been completely redesigned from the ground up:
|
|
35
|
+
|
|
36
|
+
- **34 flat tools → 9 layered tools + 6 knowledge resources**
|
|
37
|
+
- **Intelligence Layer**: `formlm_create` / `formlm_modify` wrap the server-side AssessAgent/BuilderAgent pipeline
|
|
38
|
+
- **Chat-only Risk Confirmation**: `formlm_confirm` executes medium/high-risk `formlm_modify` plans after user approval — no web UI needed
|
|
39
|
+
- **Domain Knowledge**: 6 MCP resources expose SKILL.md files directly to AI agents
|
|
40
|
+
- **State Awareness**: `formlm_snapshot` aggregates all module states in one call
|
|
41
|
+
- **P0 Constraints**: Embedded directly in command descriptions — AI sees them every time
|
|
42
|
+
|
|
43
|
+
### Architecture
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
┌─────────────────────────────────────────────────────────┐
|
|
47
|
+
│ AI Agent (any MCP Client: Claude / Cursor / │
|
|
48
|
+
│ Codex CLI / Windsurf / Cline / ...) │
|
|
49
|
+
├─────────────────────────────────────────────────────────┤
|
|
50
|
+
│ Tier 0: auth_login, auth_status │
|
|
51
|
+
│ Tier 1: formlm_plan, formlm_create, │
|
|
52
|
+
│ formlm_modify, formlm_confirm ← Smart Pipeline │
|
|
53
|
+
│ Tier 2: formlm_snapshot, formlm_skill ← State + Knowledge│
|
|
54
|
+
│ Tier 3: formlm_exec ← Direct Commands │
|
|
55
|
+
├─────────────────────────────────────────────────────────┤
|
|
56
|
+
│ Resources: formlm://skills/{form,scale,connect, │
|
|
57
|
+
│ report,expert,share} │
|
|
58
|
+
├─────────────────────────────────────────────────────────┤
|
|
59
|
+
│ formlm-cli MCP Server │
|
|
60
|
+
├─────────────────────────────────────────────────────────┤
|
|
61
|
+
│ FormLM Server (McpV1Api) │
|
|
62
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
63
|
+
│ │AssessAgent│ │BuilderAgent│ │CliService│ │SKILL.md │ │
|
|
64
|
+
│ │ (Plan+ │ │ (Think+ │ │ (picocli │ │ (domain │ │
|
|
65
|
+
│ │ Execute) │ │ Reflect)│ │ dispatch)│ │ rules) │ │
|
|
66
|
+
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
|
67
|
+
└─────────────────────────────────────────────────────────┘
|
|
68
|
+
```
|
|
30
69
|
|
|
31
70
|
---
|
|
32
71
|
|
|
@@ -38,7 +77,7 @@ npm install -g @formlm/cli
|
|
|
38
77
|
|
|
39
78
|
Requires Node.js ≥ 18.
|
|
40
79
|
|
|
41
|
-
For a detailed step-by-step guide (including MCP setup for Claude / Cursor), see **[INSTALL.md](INSTALL.md)**.
|
|
80
|
+
For a detailed step-by-step guide (including MCP setup for Claude Desktop / Cursor / Codex CLI / Windsurf / Cline), see **[INSTALL.md](INSTALL.md)**.
|
|
42
81
|
|
|
43
82
|
---
|
|
44
83
|
|
|
@@ -52,42 +91,115 @@ formlm-cli auth login
|
|
|
52
91
|
formlm-cli auth login --token <your-token>
|
|
53
92
|
```
|
|
54
93
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### 2. Use the CLI
|
|
94
|
+
### 2. Smart Pipeline (AI-recommended)
|
|
58
95
|
|
|
59
96
|
```bash
|
|
60
|
-
#
|
|
61
|
-
formlm-cli
|
|
97
|
+
# Preview the plan before executing (optional, for user review)
|
|
98
|
+
formlm-cli smart plan --input "Create a workplace stress assessment with 10 questions, 3 dimensions"
|
|
99
|
+
|
|
100
|
+
# Generate a complete assessment app from natural language
|
|
101
|
+
# This includes form design, scale config, report pages, AND visual styling — all in one step.
|
|
102
|
+
# Expected time: 60-120s for assessment, 180-300s for consultation. Do NOT cancel.
|
|
103
|
+
formlm-cli smart create --input "Create a workplace stress assessment with 10 questions, 3 dimensions, and detailed score interpretations"
|
|
104
|
+
|
|
105
|
+
# Modify an existing app
|
|
106
|
+
formlm-cli smart modify --app <appId> --input "Add a new dimension for workplace social support"
|
|
107
|
+
|
|
108
|
+
# If the change is medium/high risk, smart modify returns a plan preview instead of executing.
|
|
109
|
+
# Show the plan to the user, then confirm and execute it (no web UI needed):
|
|
110
|
+
formlm-cli smart confirm --app <appId> --plan-json '<the exact "plan" JSON returned above>'
|
|
111
|
+
```
|
|
62
112
|
|
|
63
|
-
|
|
64
|
-
formlm-cli app create --name "Customer Survey" --description "2024 annual survey"
|
|
113
|
+
> **⚠️ Smart create already includes visual styling.** If you skip smart create and use Direct Commands (below) instead, you MUST run `connect style apply-all` to beautify your form — otherwise it will use the default unstyled appearance.
|
|
65
114
|
|
|
66
|
-
|
|
67
|
-
formlm-cli field add --app <appId> --id q1 --name "Your Name" --type input --required
|
|
115
|
+
### 3. Get All App URLs (after creating)
|
|
68
116
|
|
|
69
|
-
|
|
70
|
-
|
|
117
|
+
```bash
|
|
118
|
+
# Get fill-in, editor, and data management URLs in one call
|
|
119
|
+
formlm-cli app urls --app <appId>
|
|
120
|
+
# Returns: shareUrl (fill-in), builderUrl (editor), dataUrl (data management)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 4. Beautify Your Form (if using Direct Commands)
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Apply AI-generated visual style to all pages (takes 30-120s)
|
|
127
|
+
formlm-cli connect style apply-all --app <appId> --look "职场压力评估,深蓝专业风格" --theme minimalist
|
|
128
|
+
```
|
|
71
129
|
|
|
72
|
-
|
|
73
|
-
formlm-cli share publish --app <appId>
|
|
130
|
+
### 5. Direct Commands (for fine-grained control)
|
|
74
131
|
|
|
75
|
-
|
|
76
|
-
|
|
132
|
+
```bash
|
|
133
|
+
# Get a snapshot of all module states
|
|
134
|
+
formlm-cli snapshot --app <appId>
|
|
135
|
+
formlm-cli snapshot --app <appId> --md # Markdown format (token-efficient for AI)
|
|
136
|
+
|
|
137
|
+
# Read a skill document before constructing commands
|
|
138
|
+
formlm-cli skill form
|
|
139
|
+
formlm-cli skill scale
|
|
140
|
+
|
|
141
|
+
# Scale commands
|
|
142
|
+
formlm-cli scale query --app <appId>
|
|
143
|
+
formlm-cli scale add --app <appId> --id stress --name "Stress Level" --format sum --kbText "..."
|
|
144
|
+
formlm-cli scale keys add --app <appId> --scale stress --fields q1,q2,q3
|
|
145
|
+
formlm-cli scale data add --app <appId> --scale stress --ranges "0-10:Low,11-20:Moderate,21-30:High"
|
|
146
|
+
|
|
147
|
+
# Report commands
|
|
148
|
+
formlm-cli report query --app <appId>
|
|
149
|
+
formlm-cli report page add --app <appId> --name "Summary" --layout grid
|
|
150
|
+
formlm-cli report widget add --app <appId> --page <pageId> --type chart --chartType bar --name "Score Chart"
|
|
151
|
+
|
|
152
|
+
# Expert commands
|
|
153
|
+
formlm-cli expert query --app <appId>
|
|
154
|
+
formlm-cli expert config --app <appId> --enableChat true
|
|
77
155
|
```
|
|
78
156
|
|
|
79
|
-
###
|
|
157
|
+
### 6. Use as MCP Server
|
|
80
158
|
|
|
81
159
|
```bash
|
|
82
160
|
formlm-cli mcp
|
|
83
161
|
```
|
|
84
162
|
|
|
85
|
-
This starts the MCP Server (stdio transport), ready for AI Agents to connect.
|
|
163
|
+
This starts the MCP Server (stdio transport) with 9 tools + 6 resources, ready for AI Agents to connect.
|
|
86
164
|
|
|
87
165
|
---
|
|
88
166
|
|
|
89
167
|
## Command Reference
|
|
90
168
|
|
|
169
|
+
### Smart Pipeline (AI-recommended)
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Generate a complete app from natural language
|
|
173
|
+
formlm-cli smart create --input "..." [--plan-type assessment] [--style "温暖亲切"] [--question-count 10-15]
|
|
174
|
+
|
|
175
|
+
# Modify an existing app
|
|
176
|
+
formlm-cli smart modify --app <appId> --input "..."
|
|
177
|
+
|
|
178
|
+
# Confirm and execute a medium/high risk plan returned by smart modify (skips Think/Plan, no web UI needed)
|
|
179
|
+
formlm-cli smart confirm --app <appId> --plan-json '<exact plan JSON from smart modify>'
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Snapshot
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Get all module states in one call (JSON by default)
|
|
186
|
+
formlm-cli snapshot --app <appId>
|
|
187
|
+
formlm-cli snapshot --app <appId> --module scale # Only scale module
|
|
188
|
+
formlm-cli snapshot --app <appId> --md # Markdown format (token-efficient for AI)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Skill Documents
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Get SKILL.md domain knowledge (P0/P1/P2 constraints, command templates)
|
|
195
|
+
formlm-cli skill form # Form field rules
|
|
196
|
+
formlm-cli skill scale # Scale dimension rules
|
|
197
|
+
formlm-cli skill connect # Page styling rules
|
|
198
|
+
formlm-cli skill report # Report layout rules
|
|
199
|
+
formlm-cli skill expert # Expert interpretation rules
|
|
200
|
+
formlm-cli skill share # Share/publish rules
|
|
201
|
+
```
|
|
202
|
+
|
|
91
203
|
### Auth
|
|
92
204
|
|
|
93
205
|
```bash
|
|
@@ -111,9 +223,9 @@ formlm-cli --profile work app list # Use a profile for one command
|
|
|
111
223
|
```bash
|
|
112
224
|
formlm-cli app list
|
|
113
225
|
formlm-cli app create --name "My Form" --description "..."
|
|
114
|
-
formlm-cli app get --app <appId>
|
|
115
226
|
formlm-cli app update --app <appId> --name "New Name" --theme blue
|
|
116
|
-
formlm-cli app
|
|
227
|
+
formlm-cli app remove --app <appId> # Delete an app (irreversible)
|
|
228
|
+
formlm-cli app urls --app <appId> # Get fill-in / editor / data URLs
|
|
117
229
|
```
|
|
118
230
|
|
|
119
231
|
### Field
|
|
@@ -123,83 +235,155 @@ formlm-cli field schema # All supported
|
|
|
123
235
|
formlm-cli field config --type radio # Configurable props for a type
|
|
124
236
|
formlm-cli field list --app <appId>
|
|
125
237
|
formlm-cli field find --app <appId> --id q1 # Get a single field
|
|
126
|
-
formlm-cli field find --app <appId> --filter "name" # Search fields by keyword
|
|
127
238
|
formlm-cli field add --app <appId> --id q1 --name "Name" --type input --required
|
|
128
|
-
formlm-cli field add --app <appId> --id n1 --type scale --min 1 --max 10
|
|
129
239
|
formlm-cli field update --app <appId> --id q1 --title "Your Full Name"
|
|
130
240
|
formlm-cli field remove --app <appId> --id q1
|
|
131
241
|
formlm-cli field set-property --app <appId> --id q1 --property options.0.score --value 5
|
|
132
242
|
```
|
|
133
243
|
|
|
134
|
-
###
|
|
244
|
+
### Scale (Dimensions & Scoring)
|
|
135
245
|
|
|
136
246
|
```bash
|
|
137
|
-
formlm-cli
|
|
138
|
-
formlm-cli
|
|
139
|
-
formlm-cli
|
|
140
|
-
formlm-cli
|
|
247
|
+
formlm-cli scale query --app <appId> # List all dimensions
|
|
248
|
+
formlm-cli scale find --app <appId> --id <scaleId> # Find a dimension
|
|
249
|
+
formlm-cli scale add --app <appId> --id stress --name "Stress" --format sum --kbText "..."
|
|
250
|
+
formlm-cli scale update --app <appId> --id stress --name "Stress Level"
|
|
251
|
+
formlm-cli scale set --app <appId> --id stress --direction negative
|
|
252
|
+
formlm-cli scale remove --app <appId> --id stress
|
|
253
|
+
formlm-cli scale clear --app <appId>
|
|
254
|
+
formlm-cli scale config --app <appId> --enable-single true
|
|
255
|
+
|
|
256
|
+
# Associate fields with a dimension
|
|
257
|
+
formlm-cli scale keys add --app <appId> --scale stress --fields q1,q2,q3 [--polarities "q3:negative"]
|
|
258
|
+
formlm-cli scale keys remove --app <appId> --scale stress --fields q1
|
|
259
|
+
formlm-cli scale keys list --app <appId> --scale stress
|
|
260
|
+
formlm-cli scale keys set --app <appId> --scale stress --fields q3 --negScore true
|
|
261
|
+
|
|
262
|
+
# Configure score ranges
|
|
263
|
+
formlm-cli scale data add --app <appId> --scale stress --ranges "0-10:Low,11-20:High"
|
|
264
|
+
formlm-cli scale data update --app <appId> --scale stress --id <dataId> --value "Moderate"
|
|
265
|
+
formlm-cli scale data remove --app <appId> --scale stress --id <dataId>
|
|
266
|
+
formlm-cli scale data list --app <appId> --scale stress
|
|
267
|
+
formlm-cli scale data clear --app <appId> --scale stress
|
|
141
268
|
```
|
|
142
269
|
|
|
143
|
-
|
|
270
|
+
### Connect (Page Styling & Visual Design)
|
|
144
271
|
|
|
145
|
-
|
|
272
|
+
```bash
|
|
273
|
+
formlm-cli connect query --app <appId> [--type cover|main|final] [--filter <keyword>] --md
|
|
274
|
+
formlm-cli connect find --app <appId> --filter <keyword>
|
|
275
|
+
formlm-cli connect types [--category cover|main|final] --verbose
|
|
276
|
+
formlm-cli connect config --category cover --format rich-text
|
|
277
|
+
|
|
278
|
+
# Cover page management
|
|
279
|
+
formlm-cli connect cover-page add --app <appId> --id cover_main --name "Welcome" --format text --value "<h1>Hello</h1>"
|
|
280
|
+
formlm-cli connect cover-page update --app <appId> --id cover_main --name "New Title"
|
|
281
|
+
formlm-cli connect cover-page find --app <appId> [--id cover_main]
|
|
282
|
+
formlm-cli connect cover-page remove --app <appId> [--id cover_main]
|
|
283
|
+
|
|
284
|
+
# Final page management
|
|
285
|
+
formlm-cli connect final-page add --app <appId> --id final_report --name "Thank You" --enable-report true
|
|
286
|
+
formlm-cli connect final-page update --app <appId> --id final_report --name "Done"
|
|
287
|
+
formlm-cli connect final-page find --app <appId> [--id final_report]
|
|
288
|
+
formlm-cli connect final-page remove --app <appId> [--id final_report]
|
|
289
|
+
|
|
290
|
+
# Main page management
|
|
291
|
+
formlm-cli connect main-page set --app <appId> --format card
|
|
292
|
+
formlm-cli connect main-page set --app <appId> --field X1 --description "<p>Context</p>"
|
|
293
|
+
|
|
294
|
+
# Visual style
|
|
295
|
+
formlm-cli connect style set --app <appId> --type cover --bg "#f3f3fe" --fg "#ffffff" --font "#01105c"
|
|
296
|
+
formlm-cli connect style query --app <appId> --type cover
|
|
297
|
+
formlm-cli connect style apply --app <appId> --look "deep blue tech, frosted glass cards" [--theme Minimal] [--layout flat]
|
|
298
|
+
formlm-cli connect style apply-all --app <appId> --look "light warm Japanese style" [--theme Minimal] [--layout flat]
|
|
299
|
+
formlm-cli connect style move --app <appId> --id <pageId> --direction up
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Report (Pages & Widgets)
|
|
146
303
|
|
|
147
|
-
|
|
304
|
+
```bash
|
|
305
|
+
formlm-cli report query --app <appId> # List all report pages
|
|
306
|
+
formlm-cli report find --app <appId> --filter <keyword> # Find report widget
|
|
307
|
+
formlm-cli report update --app <appId> --page <pageId> --name "New Name"
|
|
308
|
+
|
|
309
|
+
# Page management
|
|
310
|
+
formlm-cli report page add --app <appId> --name "Summary" --layout grid
|
|
311
|
+
formlm-cli report page update --app <appId> --id <pageId> --name "Overview"
|
|
312
|
+
formlm-cli report page remove --app <appId> --id <pageId>
|
|
313
|
+
|
|
314
|
+
# Widget management
|
|
315
|
+
formlm-cli report widget list --app <appId> --page <pageId>
|
|
316
|
+
formlm-cli report widget find --app <appId> --filter <keyword>
|
|
317
|
+
formlm-cli report widget set --app <appId> --id <widgetId> --value "{{TotalScore}}"
|
|
318
|
+
formlm-cli report widget add --app <appId> --page <pageId> --type chart --chartType bar --name "Score Chart"
|
|
319
|
+
formlm-cli report widget update --app <appId> --id <widgetId> --name "Updated Chart"
|
|
320
|
+
formlm-cli report widget remove --app <appId> --id <widgetId>
|
|
321
|
+
formlm-cli report widget types --category chart
|
|
322
|
+
formlm-cli report widget config --type chart --prop chartType
|
|
323
|
+
|
|
324
|
+
# Logic rules
|
|
325
|
+
formlm-cli report logic add --app <appId> --page <pageId> --condition "score>20" --action show
|
|
326
|
+
formlm-cli report logic list --app <appId> --page <pageId>
|
|
327
|
+
formlm-cli report logic remove --app <appId> --id <logicId>
|
|
328
|
+
```
|
|
148
329
|
|
|
149
|
-
|
|
330
|
+
### Expert (AI Interpretation)
|
|
150
331
|
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
332
|
+
```bash
|
|
333
|
+
formlm-cli expert query --app <appId> # Query expert config
|
|
334
|
+
formlm-cli expert find --app <appId> # Find expert details
|
|
335
|
+
formlm-cli expert config --app <appId> --enableChat true # Full configuration
|
|
336
|
+
formlm-cli expert set --app <appId> --key model --value gpt-4
|
|
337
|
+
formlm-cli expert avatar --app <appId> --name "Dr. AI" --avatar <url>
|
|
338
|
+
formlm-cli expert remove --app <appId>
|
|
339
|
+
formlm-cli expert chat --app <appId> --message "Explain my score"
|
|
160
340
|
```
|
|
161
341
|
|
|
162
|
-
|
|
342
|
+
### Share
|
|
163
343
|
|
|
164
|
-
|
|
344
|
+
```bash
|
|
345
|
+
formlm-cli share publish --app <appId> # Publish (each respondent can submit once; unlimited respondents)
|
|
346
|
+
formlm-cli share unpublish --app <appId> # Unpublish
|
|
347
|
+
formlm-cli share query --app <appId> # Check publish status
|
|
348
|
+
formlm-cli share url --app <appId> # Get the shareable URL
|
|
349
|
+
```
|
|
165
350
|
|
|
166
|
-
|
|
351
|
+
---
|
|
167
352
|
|
|
168
|
-
|
|
353
|
+
## MCP Integration
|
|
169
354
|
|
|
170
|
-
|
|
355
|
+
FormLM CLI works as a standard MCP Server over stdio and plugs into **any MCP-compatible AI platform** — Claude Desktop, Cursor, Codex CLI, Windsurf, Cline, etc.
|
|
171
356
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
```
|
|
357
|
+
> **⚠️ macOS/Linux users:** desktop AI clients often launch the MCP server without your full terminal PATH, which can cause `command not found` errors. See **[INSTALL.md → Step 4](INSTALL.md#step-4--connect-to-an-ai-agent-mcp-mode)** for the `env.PATH` fix, per-platform config file locations (including Codex CLI's TOML format), and the full setup guide.
|
|
358
|
+
|
|
359
|
+
> **No token? No problem.** If you omit `FORMLM_TOKEN`, the AI will prompt you to authenticate via the `auth_login` tool — just provide your email + password (or token) directly in the chat.
|
|
176
360
|
|
|
177
361
|
---
|
|
178
362
|
|
|
179
|
-
## Available MCP Tools (
|
|
363
|
+
## Available MCP Tools (9)
|
|
180
364
|
|
|
181
|
-
|
|
|
365
|
+
| Tier | Tool | Description |
|
|
182
366
|
|---|---|---|
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
|
196
|
-
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
367
|
+
| 0 | `auth_login` | Login with token or email + password |
|
|
368
|
+
| 0 | `auth_status` | Check current login status |
|
|
369
|
+
| 1 | `formlm_plan` | Preview execution plan without executing (for user review before create) |
|
|
370
|
+
| 1 | `formlm_create` | Generate a complete app from natural language (AssessAgent pipeline) |
|
|
371
|
+
| 1 | `formlm_modify` | Modify an existing app via natural language (BuilderAgent pipeline) |
|
|
372
|
+
| 1 | `formlm_confirm` | Confirm and execute a medium/high risk plan returned by `formlm_modify` — no web UI needed |
|
|
373
|
+
| 2 | `formlm_snapshot` | Get aggregated state of all modules (form/scale/connect/report/expert/share) |
|
|
374
|
+
| 2 | `formlm_skill` | Fetch SKILL.md domain knowledge for a skill module |
|
|
375
|
+
| 3 | `formlm_exec` | Execute any whitelisted CLI command directly |
|
|
376
|
+
|
|
377
|
+
## Available MCP Resources (6)
|
|
378
|
+
|
|
379
|
+
| Resource URI | Description |
|
|
380
|
+
|---|---|
|
|
381
|
+
| `formlm://skills/form` | Form field SKILL.md — P0 constraints, field types, scoring rules |
|
|
382
|
+
| `formlm://skills/scale` | Scale dimension SKILL.md — range rules, polarity, direction |
|
|
383
|
+
| `formlm://skills/connect` | Connect page SKILL.md — theme modes, layout formats |
|
|
384
|
+
| `formlm://skills/report` | Report layout SKILL.md — widget types, variables, logic |
|
|
385
|
+
| `formlm://skills/expert` | Expert interpretation SKILL.md — AI config, chat rules |
|
|
386
|
+
| `formlm://skills/share` | Share/publish SKILL.md — access types, idempotency |
|
|
203
387
|
|
|
204
388
|
---
|
|
205
389
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/commands/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/commands/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA8ExD"}
|
package/dist/commands/app.js
CHANGED
|
@@ -18,6 +18,21 @@ export function registerAppCommand(parent) {
|
|
|
18
18
|
const cmd = `assess app create --name "${opts.name}"${opts.description ? ` --description "${opts.description}"` : ''} --json`;
|
|
19
19
|
const result = await execCommand(cmd);
|
|
20
20
|
output(result);
|
|
21
|
+
if (result.code === 0) {
|
|
22
|
+
// Extract appId from result for tips
|
|
23
|
+
let appId = '';
|
|
24
|
+
try {
|
|
25
|
+
appId = JSON.parse(result.data).id || '';
|
|
26
|
+
}
|
|
27
|
+
catch { }
|
|
28
|
+
if (appId) {
|
|
29
|
+
console.log('');
|
|
30
|
+
console.log('💡 Next steps:');
|
|
31
|
+
console.log(` Get URLs: formlm-cli app urls --app ${appId}`);
|
|
32
|
+
console.log(` Beautify: formlm-cli connect style apply-all --app ${appId} --look "描述你的场景和视觉风格"`);
|
|
33
|
+
console.log(` Add fields: formlm-cli field add --app ${appId} --id q1 --name "Question 1" --type radio`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
21
36
|
});
|
|
22
37
|
app
|
|
23
38
|
.command('get')
|
|
@@ -46,6 +61,15 @@ export function registerAppCommand(parent) {
|
|
|
46
61
|
const result = await execCommand(cmd);
|
|
47
62
|
output(result);
|
|
48
63
|
});
|
|
64
|
+
app
|
|
65
|
+
.command('urls')
|
|
66
|
+
.description('Get all app URLs (fill-in, editor, data management)')
|
|
67
|
+
.requiredOption('--app <appId>', 'App ID')
|
|
68
|
+
.action(async (opts) => {
|
|
69
|
+
const cmd = `assess app urls --app ${opts.app} --json`;
|
|
70
|
+
const result = await execCommand(cmd);
|
|
71
|
+
output(result);
|
|
72
|
+
});
|
|
49
73
|
app
|
|
50
74
|
.command('delete')
|
|
51
75
|
.description('Delete an app')
|
package/dist/commands/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/commands/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,UAAU,kBAAkB,CAAC,MAAe;IAChD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAEhE,GAAG;SACA,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,eAAe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