@fui-org/fui-cli 0.2.0 → 0.4.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 +20 -2
- package/dist/fui.js +347 -44
- package/package.json +15 -3
- package/skills/fui/SKILL.md +149 -66
- package/skills/fui-skill/README.md +112 -0
- package/skills/fui-skill/SKILL.md +269 -0
- package/skills/fui-skill/assets/projectdefaultstyle.css +518 -0
- package/skills/fui-skill/design-md/airbnb/DESIGN.md +545 -0
- package/skills/fui-skill/design-md/airbnb/README.md +5 -0
- package/skills/fui-skill/design-md/airtable/DESIGN.md +554 -0
- package/skills/fui-skill/design-md/airtable/README.md +5 -0
- package/skills/fui-skill/design-md/apple/DESIGN.md +562 -0
- package/skills/fui-skill/design-md/apple/README.md +5 -0
- package/skills/fui-skill/design-md/asu/DESIGN.md +179 -0
- package/skills/fui-skill/design-md/asu/README.md +107 -0
- package/skills/fui-skill/design-md/binance/DESIGN.md +634 -0
- package/skills/fui-skill/design-md/binance/README.md +5 -0
- package/skills/fui-skill/design-md/bmw/DESIGN.md +544 -0
- package/skills/fui-skill/design-md/bmw/README.md +5 -0
- package/skills/fui-skill/design-md/bmw-m/DESIGN.md +503 -0
- package/skills/fui-skill/design-md/bmw-m/README.md +5 -0
- package/skills/fui-skill/design-md/bugatti/DESIGN.md +454 -0
- package/skills/fui-skill/design-md/bugatti/README.md +5 -0
- package/skills/fui-skill/design-md/cal/DESIGN.md +542 -0
- package/skills/fui-skill/design-md/cal/README.md +5 -0
- package/skills/fui-skill/design-md/claude/DESIGN.md +589 -0
- package/skills/fui-skill/design-md/claude/README.md +5 -0
- package/skills/fui-skill/design-md/clay/DESIGN.md +541 -0
- package/skills/fui-skill/design-md/clay/README.md +5 -0
- package/skills/fui-skill/design-md/clickhouse/DESIGN.md +544 -0
- package/skills/fui-skill/design-md/clickhouse/README.md +5 -0
- package/skills/fui-skill/design-md/cohere/DESIGN.md +451 -0
- package/skills/fui-skill/design-md/cohere/README.md +5 -0
- package/skills/fui-skill/design-md/coinbase/DESIGN.md +570 -0
- package/skills/fui-skill/design-md/coinbase/README.md +5 -0
- package/skills/fui-skill/design-md/composio/DESIGN.md +506 -0
- package/skills/fui-skill/design-md/composio/README.md +5 -0
- package/skills/fui-skill/design-md/cursor/DESIGN.md +537 -0
- package/skills/fui-skill/design-md/cursor/README.md +5 -0
- package/skills/fui-skill/design-md/elevenlabs/DESIGN.md +504 -0
- package/skills/fui-skill/design-md/elevenlabs/README.md +5 -0
- package/skills/fui-skill/design-md/expo/DESIGN.md +526 -0
- package/skills/fui-skill/design-md/expo/README.md +5 -0
- package/skills/fui-skill/design-md/ferrari/DESIGN.md +531 -0
- package/skills/fui-skill/design-md/ferrari/README.md +5 -0
- package/skills/fui-skill/design-md/figma/DESIGN.md +578 -0
- package/skills/fui-skill/design-md/figma/README.md +5 -0
- package/skills/fui-skill/design-md/framer/DESIGN.md +544 -0
- package/skills/fui-skill/design-md/framer/README.md +5 -0
- package/skills/fui-skill/design-md/fui/DESIGN.md +532 -0
- package/skills/fui-skill/design-md/hashicorp/DESIGN.md +575 -0
- package/skills/fui-skill/design-md/hashicorp/README.md +5 -0
- package/skills/fui-skill/design-md/ibm/DESIGN.md +550 -0
- package/skills/fui-skill/design-md/ibm/README.md +5 -0
- package/skills/fui-skill/design-md/intercom/DESIGN.md +546 -0
- package/skills/fui-skill/design-md/intercom/README.md +5 -0
- package/skills/fui-skill/design-md/kraken/DESIGN.md +125 -0
- package/skills/fui-skill/design-md/kraken/README.md +5 -0
- package/skills/fui-skill/design-md/lamborghini/DESIGN.md +288 -0
- package/skills/fui-skill/design-md/lamborghini/README.md +5 -0
- package/skills/fui-skill/design-md/linear.app/DESIGN.md +548 -0
- package/skills/fui-skill/design-md/linear.app/README.md +5 -0
- package/skills/fui-skill/design-md/lovable/DESIGN.md +298 -0
- package/skills/fui-skill/design-md/lovable/README.md +5 -0
- package/skills/fui-skill/design-md/mastercard/DESIGN.md +365 -0
- package/skills/fui-skill/design-md/mastercard/README.md +5 -0
- package/skills/fui-skill/design-md/meta/DESIGN.md +683 -0
- package/skills/fui-skill/design-md/meta/README.md +5 -0
- package/skills/fui-skill/design-md/minimax/DESIGN.md +746 -0
- package/skills/fui-skill/design-md/minimax/README.md +5 -0
- package/skills/fui-skill/design-md/mintlify/DESIGN.md +852 -0
- package/skills/fui-skill/design-md/mintlify/README.md +5 -0
- package/skills/fui-skill/design-md/miro/DESIGN.md +825 -0
- package/skills/fui-skill/design-md/miro/README.md +5 -0
- package/skills/fui-skill/design-md/mistral.ai/DESIGN.md +773 -0
- package/skills/fui-skill/design-md/mistral.ai/README.md +5 -0
- package/skills/fui-skill/design-md/mongodb/DESIGN.md +767 -0
- package/skills/fui-skill/design-md/mongodb/README.md +5 -0
- package/skills/fui-skill/design-md/nike/DESIGN.md +575 -0
- package/skills/fui-skill/design-md/nike/README.md +5 -0
- package/skills/fui-skill/design-md/notion/DESIGN.md +821 -0
- package/skills/fui-skill/design-md/notion/README.md +5 -0
- package/skills/fui-skill/design-md/nvidia/DESIGN.md +640 -0
- package/skills/fui-skill/design-md/nvidia/README.md +5 -0
- package/skills/fui-skill/design-md/ollama/DESIGN.md +539 -0
- package/skills/fui-skill/design-md/ollama/README.md +5 -0
- package/skills/fui-skill/design-md/opencode.ai/DESIGN.md +521 -0
- package/skills/fui-skill/design-md/opencode.ai/README.md +5 -0
- package/skills/fui-skill/design-md/pinterest/DESIGN.md +597 -0
- package/skills/fui-skill/design-md/pinterest/README.md +5 -0
- package/skills/fui-skill/design-md/playstation/DESIGN.md +661 -0
- package/skills/fui-skill/design-md/playstation/README.md +5 -0
- package/skills/fui-skill/design-md/posthog/DESIGN.md +690 -0
- package/skills/fui-skill/design-md/posthog/README.md +5 -0
- package/skills/fui-skill/design-md/raycast/DESIGN.md +669 -0
- package/skills/fui-skill/design-md/raycast/README.md +5 -0
- package/skills/fui-skill/design-md/renault/DESIGN.md +589 -0
- package/skills/fui-skill/design-md/renault/README.md +5 -0
- package/skills/fui-skill/design-md/replicate/DESIGN.md +616 -0
- package/skills/fui-skill/design-md/replicate/README.md +5 -0
- package/skills/fui-skill/design-md/resend/DESIGN.md +585 -0
- package/skills/fui-skill/design-md/resend/README.md +5 -0
- package/skills/fui-skill/design-md/revolut/DESIGN.md +636 -0
- package/skills/fui-skill/design-md/revolut/README.md +5 -0
- package/skills/fui-skill/design-md/runwayml/DESIGN.md +244 -0
- package/skills/fui-skill/design-md/runwayml/README.md +5 -0
- package/skills/fui-skill/design-md/sanity/DESIGN.md +357 -0
- package/skills/fui-skill/design-md/sanity/README.md +5 -0
- package/skills/fui-skill/design-md/sentry/DESIGN.md +551 -0
- package/skills/fui-skill/design-md/sentry/README.md +5 -0
- package/skills/fui-skill/design-md/shopify/DESIGN.md +516 -0
- package/skills/fui-skill/design-md/shopify/README.md +5 -0
- package/skills/fui-skill/design-md/slack/DESIGN.md +482 -0
- package/skills/fui-skill/design-md/spacex/DESIGN.md +363 -0
- package/skills/fui-skill/design-md/spacex/README.md +5 -0
- package/skills/fui-skill/design-md/spotify/DESIGN.md +246 -0
- package/skills/fui-skill/design-md/spotify/README.md +5 -0
- package/skills/fui-skill/design-md/starbucks/DESIGN.md +580 -0
- package/skills/fui-skill/design-md/starbucks/README.md +5 -0
- package/skills/fui-skill/design-md/stripe/DESIGN.md +487 -0
- package/skills/fui-skill/design-md/stripe/README.md +5 -0
- package/skills/fui-skill/design-md/supabase/DESIGN.md +462 -0
- package/skills/fui-skill/design-md/supabase/README.md +5 -0
- package/skills/fui-skill/design-md/superhuman/DESIGN.md +448 -0
- package/skills/fui-skill/design-md/superhuman/README.md +5 -0
- package/skills/fui-skill/design-md/tesla/DESIGN.md +286 -0
- package/skills/fui-skill/design-md/tesla/README.md +5 -0
- package/skills/fui-skill/design-md/theverge/DESIGN.md +339 -0
- package/skills/fui-skill/design-md/theverge/README.md +5 -0
- package/skills/fui-skill/design-md/together.ai/DESIGN.md +633 -0
- package/skills/fui-skill/design-md/together.ai/README.md +5 -0
- package/skills/fui-skill/design-md/uber/DESIGN.md +636 -0
- package/skills/fui-skill/design-md/uber/README.md +5 -0
- package/skills/fui-skill/design-md/vercel/DESIGN.md +736 -0
- package/skills/fui-skill/design-md/vercel/README.md +5 -0
- package/skills/fui-skill/design-md/vodafone/DESIGN.md +538 -0
- package/skills/fui-skill/design-md/vodafone/README.md +5 -0
- package/skills/fui-skill/design-md/voltagent/DESIGN.md +521 -0
- package/skills/fui-skill/design-md/voltagent/README.md +5 -0
- package/skills/fui-skill/design-md/warp/DESIGN.md +526 -0
- package/skills/fui-skill/design-md/warp/README.md +5 -0
- package/skills/fui-skill/design-md/webflow/DESIGN.md +588 -0
- package/skills/fui-skill/design-md/webflow/README.md +5 -0
- package/skills/fui-skill/design-md/wired/DESIGN.md +497 -0
- package/skills/fui-skill/design-md/wired/README.md +5 -0
- package/skills/fui-skill/design-md/wise/DESIGN.md +544 -0
- package/skills/fui-skill/design-md/wise/README.md +5 -0
- package/skills/fui-skill/design-md/x.ai/DESIGN.md +465 -0
- package/skills/fui-skill/design-md/x.ai/README.md +5 -0
- package/skills/fui-skill/design-md/zapier/DESIGN.md +537 -0
- package/skills/fui-skill/design-md/zapier/README.md +5 -0
- package/skills/fui-skill/examples/component.vue +162 -0
- package/skills/fui-skill/examples/f-table-patterns.json +331 -0
- package/skills/fui-skill/examples/module-patterns.json +973 -0
- package/skills/fui-skill/examples/project-patterns.json +222 -0
- package/skills/fui-skill/metadata.json +75 -0
- package/skills/fui-skill/references/INDEX.md +144 -0
- package/skills/fui-skill/references/advanced-techniques.md +160 -0
- package/skills/fui-skill/references/coding-standards.md +112 -0
- package/skills/fui-skill/references/component-design.md +455 -0
- package/skills/fui-skill/references/component-quickref.md +77 -0
- package/skills/fui-skill/references/component-table.md +276 -0
- package/skills/fui-skill/references/components-dialog.md +192 -0
- package/skills/fui-skill/references/components-display.md +147 -0
- package/skills/fui-skill/references/components-echart.md +391 -0
- package/skills/fui-skill/references/components-input.md +359 -0
- package/skills/fui-skill/references/controls-patterns.md +847 -0
- package/skills/fui-skill/references/controls-styling-vocabulary.md +140 -0
- package/skills/fui-skill/references/db-table-design.md +77 -0
- package/skills/fui-skill/references/db-workflow.md +504 -0
- package/skills/fui-skill/references/default-function.md +415 -0
- package/skills/fui-skill/references/design-modes.md +85 -0
- package/skills/fui-skill/references/echart-templates.md +481 -0
- package/skills/fui-skill/references/fastproject.md +97 -0
- package/skills/fui-skill/references/fsheet.md +218 -0
- package/skills/fui-skill/references/fullstack-workflow.md +351 -0
- package/skills/fui-skill/references/module-data-patterns.md +126 -0
- package/skills/fui-skill/references/module-json-anatomy.md +137 -0
- package/skills/fui-skill/references/module-structure.md +260 -0
- package/skills/fui-skill/references/new-session.md +108 -0
- package/skills/fui-skill/references/pdfmake.md +60 -0
- package/skills/fui-skill/references/permission-system.md +169 -0
- package/skills/fui-skill/references/platform-architecture.md +294 -0
- package/skills/fui-skill/references/project-config.md +335 -0
- package/skills/fui-skill/references/project-provisioning.md +383 -0
- package/skills/fui-skill/references/script-map.md +296 -0
- package/skills/fui-skill/references/sql-clr-functions.md +224 -0
- package/skills/fui-skill/references/system-design.md +116 -0
- package/skills/fui-skill/references/tapi-file-api.md +191 -0
- package/skills/fui-skill/references/tapi-permission-patterns.md +158 -0
- package/skills/fui-skill/references/tapi-reference.md +549 -0
- package/skills/fui-skill/references/tools-registry.md +460 -0
- package/skills/fui-skill/references/ui-crosswindow-patterns.md +317 -0
- package/skills/fui-skill/references/ui-dialog-patterns.md +229 -0
- package/skills/fui-skill/references/ui-layout-patterns.md +176 -0
- package/skills/fui-skill/references/ui-patterns.md +315 -0
- package/skills/fui-skill/references/ui-screenshot-review.md +94 -0
- package/skills/fui-skill/references/ui-table-cell-patterns.md +316 -0
- package/skills/fui-skill/references/ui-templates.md +29 -0
- package/skills/fui-skill/references/verification.md +246 -0
- package/skills/fui-skill/references/watcher-patterns.md +196 -0
- package/skills/fui-skill/references/websocket-realtime.md +254 -0
- package/skills/fui-skill/scripts/component-3.0.js +2549 -0
- package/skills/fui-skill/scripts/component.js +3142 -0
- package/skills/fui-skill/scripts/componentTable-3.0.js +909 -0
- package/skills/fui-skill/scripts/componentTable.js +769 -0
- package/skills/fui-skill/scripts/defaultfunction-3.0.js +781 -0
- package/skills/fui-skill/scripts/defaultfunction.js +966 -0
- package/skills/fui-skill/scripts/fastproject-3.0.js +870 -0
- package/skills/fui-skill/scripts/fastproject.js +828 -0
- package/skills/fui-skill/scripts/fechart.js +890 -0
- package/skills/fui-skill/scripts/fsheet.js +1330 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fui-org/fui-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Token-lean CLI for the FUI low-code platform, successor to Fui MCP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -31,15 +31,27 @@
|
|
|
31
31
|
"lint": "oxlint",
|
|
32
32
|
"format": "oxfmt",
|
|
33
33
|
"format:check": "oxfmt --check",
|
|
34
|
-
"typecheck": "tsc --noEmit"
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"sync:skill": "bun scripts/sync-skill.ts",
|
|
36
|
+
"sync:upstream-tests": "bun scripts/sync-upstream-tests.ts"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
39
|
+
"@fui-org/fui-mcp": "1.4.0",
|
|
37
40
|
"@types/bun": "latest",
|
|
38
41
|
"oxfmt": "^0.70.0",
|
|
39
42
|
"oxlint": "^1.85.0",
|
|
43
|
+
"playwright": "1.62.1",
|
|
40
44
|
"typescript": "^7.0.2"
|
|
41
45
|
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"playwright": ">=1.40.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"playwright": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
42
54
|
"engines": {
|
|
43
55
|
"bun": ">=1.4.0"
|
|
44
56
|
}
|
|
45
|
-
}
|
|
57
|
+
}
|
package/skills/fui/SKILL.md
CHANGED
|
@@ -1,109 +1,192 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fui
|
|
3
|
-
description: Use the `fui` CLI
|
|
3
|
+
description: Use the `fui` CLI for FUI (low-code platform) work — projects, modules (get, validate, preview, publish), components, imports, project users, DB connections, SQL, schema, stored procedures (tAPI spAPI_*), workspace files, publish ledger and history. Prefer it over Fui MCP tools whenever `fui` covers the tool (see the map below); same guards, a fraction of the tokens.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# fui CLI
|
|
7
7
|
|
|
8
|
-
`fui` is the shell replacement for
|
|
8
|
+
`fui` is the shell replacement for Fui MCP tools. Run it with your shell tool. It uses the same workspace, connection files, publish ledger, `_history` and error log as Fui MCP, so you can mix the two during the transition.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- stdout carries data only. Query results are TSV with a header row; `NULL` means SQL null; tab, newline and backslash inside cells are escaped as `\t`, `\n`, `\\`.
|
|
13
|
-
- stderr carries `# ...` notes (row counts, truncation) and `error: ...` / `guard: ...` messages.
|
|
14
|
-
- Add `--json` for compact single-line JSON instead of TSV.
|
|
15
|
-
- Exit codes: `0` ok, `1` runtime error (network/SQL), `2` usage error (read the message; it lists valid choices), `3` blocked by a safety guard.
|
|
16
|
-
|
|
17
|
-
## Pick a connection
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
fui db list # db, engine, default, apiDomain, database, userToken
|
|
21
|
-
```
|
|
10
|
+
Domain rules (module.json, controls, tAPI conventions) live in the `fui-skill` skill. Read its `references/` as needed, then run `fui skill loaded`; strict mode (`FUI_MCP_STRICT=1`) blocks deploys until you do.
|
|
22
11
|
|
|
23
|
-
|
|
24
|
-
- With no `--db`: the only connection, else the project default. `sp` commands infer the connection from the object name.
|
|
25
|
-
- Writes (`exec`, write SQL in `query`) never fall back to the default when a project has several connections. Pass `--db`.
|
|
26
|
-
- Engines come from the token. `mssql` goes through tAPI over HTTPS. `postgres`, `mysql` and `sqlite` connect directly with Bun.SQL. `schema` and `sp` commands are MSSQL-only.
|
|
12
|
+
## Output contract
|
|
27
13
|
|
|
28
|
-
|
|
14
|
+
- stdout is data only: TSV with a header when piped, an aligned table in a terminal, `--json` for one-line JSON, `--no-header` to drop the header.
|
|
15
|
+
- stderr carries `# ...` notes and `error:` / `guard:` lines.
|
|
16
|
+
- Exit codes:
|
|
17
|
+
- `0`: ok, including "skipped: unchanged".
|
|
18
|
+
- `1`: runtime error (network or SQL).
|
|
19
|
+
- `2`: usage error. Read the message; it lists the valid choices.
|
|
20
|
+
- `3`: blocked by a guard, or waiting for `--confirm-write`.
|
|
21
|
+
|
|
22
|
+
## Targets
|
|
23
|
+
|
|
24
|
+
- **Project and module**, first match wins:
|
|
25
|
+
1. `-p <project> -m <module>`. Passing only one of them is an error.
|
|
26
|
+
2. The current directory, if it is inside `<workspace>/<project>/modules/<module>/`.
|
|
27
|
+
3. The session target.
|
|
28
|
+
- **Session:** one per `FUI_SESSION` (default `default`). Parallel agents should each set their own `FUI_SESSION`.
|
|
29
|
+
- **Connection:**
|
|
30
|
+
- `--db <alias>` or `--db <project>/<alias>`.
|
|
31
|
+
- With no `--db`: the only connection, else one inferred from the object name (`sp` commands), else the default.
|
|
32
|
+
- Writes never use the default when a project has several connections.
|
|
33
|
+
- `fui file where` prints what resolved and why.
|
|
34
|
+
- `fui config` shows the workspace and API settings with their sources. They inherit from the Fui MCP entry in `~/.claude.json`.
|
|
35
|
+
- A global install updates itself in the background, at most once a day. A line starting `# fui updated` means a new version is running; run `fui skill install` if the skills were installed as files. `fui --version` prints the version.
|
|
36
|
+
|
|
37
|
+
## Fui MCP tool → fui command
|
|
38
|
+
|
|
39
|
+
Implemented (same guards, same files, same requests as Fui MCP 1.4.0):
|
|
40
|
+
|
|
41
|
+
| MCP tool | fui |
|
|
42
|
+
| --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| session_set / session_read / session_clear / session_resolve | `use <target>` / `use` / `use --clear` / `resolve <target>` |
|
|
44
|
+
| project_list / project_sync | `project list` / `project sync` |
|
|
45
|
+
| project_new / project_update / project_publish_config | `project new --data {…}` / `project update --data {id:…}` / `project publish-config` |
|
|
46
|
+
| project_user_search / list / new / update / delete | `user search <text>` / `user list` / `user add <UserID> --right N` / `user set …` / `user remove <UserID>` |
|
|
47
|
+
| module_list / new / update / delete | `module list` / `module new <id> --name N` / `module update [--new-id] [--framework] …` / `module delete -p P -m M` |
|
|
48
|
+
| module_get / module_get_ui / module_get_html | `module get [<target>]` / `module get-ui` / `module get-html` |
|
|
49
|
+
| module_validate / module_preview | `module validate` / `module preview` |
|
|
50
|
+
| module_outline / module_simulate | `module outline` / `module simulate [--scenario [...]] [--mocks {...}] [--user {...}] [--url-params {...}]` |
|
|
51
|
+
| module_simulate renderUI / component_preview | `module simulate --render [--device mobile] [--vue-data {...}]` / `component preview <uc-name> [--cases [...]] [--device desktop,mobile]` |
|
|
52
|
+
| error_log_read / error_log_clear | `log read [--tool T] [--limit N\|0] [--summary]` / `log clear` |
|
|
53
|
+
| module_publish_html / json / script / css | `module publish html --approval <token>` / `module publish json` / `… script` / `… css` |
|
|
54
|
+
| component_list / get / new / update / delete | `component list` / `component get <name>` / `component new <name>` / `component update <name>` / `component delete <name>` |
|
|
55
|
+
| file_import_list / get / new / update / upload_content / delete | `import list` / `import get <id>` / `import new …` / `import update <id> …` / `import upload <id> -f file` / `import delete <id>` |
|
|
56
|
+
| db_config_read / db_connect | `db list` / `db add <alias> --token - --api-domain host` |
|
|
57
|
+
| db_connect_by_name / db_alias_list / db_alias_new | `db add-by-name <alias>` / `db alias list [--search s]` / `db alias new <alias> …` |
|
|
58
|
+
| db_user_token_set / db_token_rebuild | `db user-token [--from p/alias]` / `db token-rebuild --uid U --pwd-env VAR` |
|
|
59
|
+
| right_system_* / right_function_* | `right system list\|new <0-9>\|update <0-9>\|delete <0-9>` / `right function list\|new --code N\|update <id>\|delete <id>` |
|
|
60
|
+
| db_schema_get / db_schema_read | `schema pull [--prune-local-only]` / `schema [--type T] [--search text]` |
|
|
61
|
+
| db_sp_list / db_sp_get / db_sp_save | `sp list` / `sp get <name> [--print]` / `sp save <name> -f file` |
|
|
62
|
+
| db_sp_deploy / db_sp_help | `sp deploy <name>` / `sp help <name\|Fn> [--full]` |
|
|
63
|
+
| db_sp_verify / db_sp_delete / db_sp_rename | `sp verify <name\|Fn> [--params {…}] [--check-grant]` / `sp delete <name> --type Procedure\|Function` / `sp rename <old> <new>` |
|
|
64
|
+
| db_sql_execute / db_sql_execute_nonquery | `query "<sql>"` / `exec "<sql>"` (+ `--confirm-write`) |
|
|
65
|
+
| skill_get / skill_reference_get / skill_sync | `skill get` / `skill ref <path...>` / `skill sync` |
|
|
66
|
+
| design_list / design_read | `design list` / `design read <brand>` |
|
|
67
|
+
|
|
68
|
+
Every Fui MCP 1.4.0 tool has a fui command (the SSE-only `workspace_*` and `*_stage` tools are out of scope).
|
|
69
|
+
|
|
70
|
+
## Modules
|
|
71
|
+
|
|
72
|
+
1. `fui module get /project/module` (also a live URL or display name).
|
|
73
|
+
- It archives local files that differ, deletes `.vue` files the server no longer has, and makes the module the session target.
|
|
74
|
+
2. Edit the files in `<workspace>/<project>/modules/<module>/`. Running `fui` from inside that folder targets it.
|
|
75
|
+
3. Check, cheapest first:
|
|
76
|
+
- `fui module validate`: fix every error (exit 1 while any remain); it only reads local files.
|
|
77
|
+
- `fui module outline`: the layout tree (grid widths, bindings, actions, dialogs) to confirm the structure is what you meant.
|
|
78
|
+
- `fui module simulate --scenario '[{"click":"Save"},{"assert":"vueData.list.length > 0"}]'`: runs the module in a simulated runtime; exit 1 when an assert fails. `--mocks` wins over live data. An unmocked static API may call the real tAPI when its local `.sql` body reads as read-only (max 8 calls, cached in `_testdata/`). For an existing SP take mocks from `fui sp verify`, never invent them.
|
|
79
|
+
- `fui component preview <uc-name> --cases '[{"name":"empty","props":{"items":[]}}]'`: one local `.vue` alone in a real browser; do it before wiring a component in and before publishing a project-scope one.
|
|
80
|
+
- `fui module simulate --render [--device mobile]`: the real page in headless Chromium, last and only for problems that need pixels. Project-level assets come from the server, so publish project files first. It prints screenshot paths: open and read them, then fix what you see. Needs Playwright once: `bun add -g playwright && bunx playwright install chromium`.
|
|
81
|
+
4. Publish:
|
|
82
|
+
- **Whole module, including header/body:** `fui module preview` → show the changes to the user → after approval `fui module publish html --approval <token>`.
|
|
83
|
+
- The token breaks if any payload file changes after the preview.
|
|
84
|
+
- **One file:** `fui module publish json|script|css`, `fui component update <name>`, or `fui file push <path...>`, which routes each path to the right publisher.
|
|
85
|
+
- Unchanged files are skipped via the publish ledger.
|
|
86
|
+
5. `fui file status` lists what is still unpublished.
|
|
87
|
+
|
|
88
|
+
`fui remote module --part ui|html|script|css|load|components|imports` and `fui remote project --part config|modules|…` show the server copy without touching the workspace. `fui remote diff <path...>` compares local files with the server.
|
|
89
|
+
|
|
90
|
+
Ask the user before `module delete`, `component delete`, `import delete` and `user remove`.
|
|
91
|
+
|
|
92
|
+
## Data
|
|
29
93
|
|
|
30
94
|
```bash
|
|
31
95
|
fui query "SELECT TOP 20 * FROM tblStudent WHERE ClassID = 5" --db lhu-docs/docs
|
|
32
|
-
fui query -f report.sql --limit 0
|
|
96
|
+
fui query -f report.sql --limit 0 # default cap 200 rows; 0 = all
|
|
33
97
|
echo "SELECT 1 AS x" | fui query -
|
|
34
98
|
```
|
|
35
99
|
|
|
36
|
-
Narrow with `TOP`/`WHERE`
|
|
100
|
+
Narrow with `TOP`/`WHERE` first. Every row you read costs tokens.
|
|
37
101
|
|
|
38
102
|
## Structure (MSSQL)
|
|
39
103
|
|
|
40
104
|
```bash
|
|
41
|
-
fui schema --
|
|
42
|
-
fui schema --
|
|
43
|
-
fui schema pull
|
|
44
|
-
fui sp list --
|
|
105
|
+
fui schema --search studentid # compact DDL lines; --search matches the whole line (columns, params)
|
|
106
|
+
fui schema --type API --search Student # Table View API "API File" Procedure Function
|
|
107
|
+
fui schema pull # refresh schema.json + every local .sql body
|
|
108
|
+
fui sp list --search Student # columns: db name kind count local
|
|
45
109
|
```
|
|
46
110
|
|
|
47
|
-
|
|
111
|
+
- With no cache, `schema` fails and tells you to run `fui schema pull`. It never pulls on its own.
|
|
112
|
+
- A `# warning: ... last synced N days ago` note means pull before trusting the names.
|
|
113
|
+
- `schema pull` archives and deletes local `.sql` files whose objects were dropped on the server.
|
|
114
|
+
- It only lists drafts that exist in neither schema. `--prune-local-only` archives those too, but only once the user confirms they are stale.
|
|
115
|
+
|
|
116
|
+
## Stored procedures (MSSQL)
|
|
48
117
|
|
|
49
|
-
|
|
118
|
+
1. `fui sp get <name>` saves the live body to `_db/<alias>/<name>.sql`. A differing local copy is archived first.
|
|
119
|
+
- For a new SP: `fui sp path <name> --db <ref>`, or `fui sp save <name> -f file.sql --db <ref>`.
|
|
120
|
+
2. Edit the file. `CREATE` versus `ALTER` does not matter.
|
|
121
|
+
3. `fui sp deploy <name>`:
|
|
122
|
+
- saves the live body as a rollback copy
|
|
123
|
+
- fixes the verb
|
|
124
|
+
- grants `EXECUTE` to `[public]` on new procedures and checks it
|
|
125
|
+
- clears the tAPI cache
|
|
126
|
+
4. If the grant failed, do **not** redeploy. Run the printed `fui exec "GRANT ..."`.
|
|
50
127
|
|
|
51
|
-
|
|
52
|
-
For a new SP: `fui sp path spAPI_New --db <ref>` prints where to create the file.
|
|
53
|
-
2. Edit that file with your file tools. `CREATE` or `ALTER` both work; deploy fixes the verb.
|
|
54
|
-
3. `fui sp deploy spAPI_Student_Select` does all of this:
|
|
55
|
-
- archives the live body to `_history/` as the rollback copy
|
|
56
|
-
- runs the file
|
|
57
|
-
- grants `EXECUTE` to `[public]` for new procedures and verifies the grant
|
|
58
|
-
- clears the tAPI parameter cache for `spAPI_*` names
|
|
59
|
-
4. If the output says the grant failed, do **not** redeploy. Run the printed `fui exec "GRANT ..."` line.
|
|
128
|
+
Before writing `apiMocks` for an SP that exists, run `fui sp verify <name>`. It reads the real body (never calls the endpoint) and prints the params, the response shape, the error contract, read/write and a mock snippet. `sp delete` and `sp rename` change the server: ask the user first.
|
|
60
129
|
|
|
61
|
-
|
|
130
|
+
## Writes need the user
|
|
62
131
|
|
|
63
|
-
|
|
132
|
+
- Writes to real data exit `3` until you add `--confirm-write`. That covers `INSERT`, `UPDATE`, `DELETE`, `MERGE` and `TRUNCATE` in `query` or `exec`, and `ALTER TABLE ... ALTER COLUMN`.
|
|
133
|
+
- Add `--confirm-write` **only after the user approved that exact write in chat.**
|
|
134
|
+
- Always blocked, with no flag to unlock them. Show the SQL to the user to run by hand:
|
|
135
|
+
- `DROP TABLE`
|
|
136
|
+
- `ALTER TABLE ... DROP COLUMN` or `SWITCH`
|
|
137
|
+
- `DELETE`/`UPDATE` without `WHERE` in `exec`
|
|
138
|
+
- Never write or call a live API SP "to test" it. Read its body.
|
|
139
|
+
|
|
140
|
+
## Workspace files (local, no network)
|
|
64
141
|
|
|
65
142
|
```bash
|
|
66
|
-
fui
|
|
143
|
+
fui file where # workspace, project, module, dirs, and why
|
|
144
|
+
fui file status [--all] # files changed since the last publish/sync, with the command to push each
|
|
145
|
+
fui file history <path> # archived versions in _history, newest first
|
|
146
|
+
fui file restore <path> [--at YYYYMMDD_HHMMSS] # the current file is archived first
|
|
147
|
+
fui file ledger <path...> [--mark|--forget]
|
|
67
148
|
```
|
|
68
149
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
- Never run a write or call a live API SP "to test" it. Read the SP body instead.
|
|
150
|
+
## Compose with shell
|
|
151
|
+
|
|
152
|
+
Filter and loop in the shell. Piped output costs no tokens. Every table also takes `--filter text`, `--where col=value` and `--fields a,b` (applied after the request, so nothing else changes).
|
|
73
153
|
|
|
74
|
-
|
|
154
|
+
```bash
|
|
155
|
+
fui sp list --no-header --type API | cut -f2 # API SP names
|
|
156
|
+
fui sp list --no-header | awk -F'\t' '$5=="yes"{print $2}' # SPs with a local copy
|
|
157
|
+
fui schema --type Procedure | grep -i tblStudent | cut -d' ' -f3 # procedures mentioning a word
|
|
158
|
+
fui sp list --no-header --search Student | cut -f2 | xargs -n1 fui sp get
|
|
159
|
+
fui query "SELECT TOP 5 ID, Name FROM tblX" --json | jq -r '.[].Name'
|
|
160
|
+
```
|
|
75
161
|
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
- Signal errors in SPs with `RAISERROR`. Callers read `Message`.
|
|
79
|
-
- Every new procedure needs `GRANT EXECUTE ... TO [public]`. Deploy handles it; raw `fui exec CREATE PROCEDURE` does not.
|
|
162
|
+
- Check exit codes. An exit `3` inside a loop means ask the user; do not retry.
|
|
163
|
+
- Never put `--confirm-write` in a loop or `xargs`.
|
|
80
164
|
|
|
81
|
-
## Connections and
|
|
165
|
+
## Connections and secrets
|
|
82
166
|
|
|
83
167
|
```bash
|
|
84
|
-
printf %s "$TOKEN" | fui db add docs -p lhu-docs --token - --api-domain tapi.lhu.edu.vn
|
|
85
|
-
fui db add local -p demo --conn-env PG_URL
|
|
86
|
-
fui db add cache -p demo --conn-env SQLITE_URL # sqlite:///abs/path/app.db
|
|
168
|
+
printf %s "$TOKEN" | fui db add docs -p lhu-docs --token - --api-domain tapi.lhu.edu.vn --user-token-env UT
|
|
169
|
+
fui db add local -p demo --conn-env PG_URL # postgres:// mysql:// sqlite:// connect directly
|
|
87
170
|
fui db default lhu-docs/docs
|
|
88
171
|
fui db test --db lhu-docs/docs
|
|
89
|
-
fui token decode --db lhu-docs/docs
|
|
90
|
-
fui token encode --server S --database D --uid U --pwd-env PWD # Base64 MSSQL dbToken
|
|
172
|
+
fui token decode --db lhu-docs/docs # never shows the password
|
|
91
173
|
```
|
|
92
174
|
|
|
93
|
-
|
|
94
|
-
- Secrets are accepted only from stdin (`-`) or `--*-env VAR`. Never echo, log or paste token values.
|
|
95
|
-
- `db add` tests with `SELECT 1` before saving (`--no-test` skips the test). The previous `_connections.json` is archived to `_history/`.
|
|
175
|
+
Secrets are accepted only from stdin (`-`) or `--*-env VAR`. Never echo or paste token values.
|
|
96
176
|
|
|
97
|
-
|
|
177
|
+
- Never `cat`, `jq` or otherwise print `_db/_connections.json`, `_db/config.json` or MCP config files. Use `fui db list`, `fui token decode` or `fui config`; they never print secrets.
|
|
178
|
+
- No token at hand? `fui db user-token` lists fingerprints of the tokens already in the workspace; copy one with `--from <project/alias>`. The value never appears.
|
|
179
|
+
- Know the alias but not the connection string? `fui db alias list`, then `fui db add-by-name <alias>`: it borrows the SQL login of a connection on the same apiDomain.
|
|
180
|
+
- `right *` and `db alias new` write to the shared acc system. Ask the user first, especially for `delete`.
|
|
181
|
+
- `fui db list` shows a pre-1.4 `_db/config.json` as `engine=legacy`. Migrate it with `fui db import-legacy -p <project>`.
|
|
98
182
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
fui config # effective workdir and its source
|
|
103
|
-
fui config set workdir ~/work/fui # persist a custom location
|
|
104
|
-
fui config unset workdir
|
|
105
|
-
```
|
|
183
|
+
## FUI conventions
|
|
106
184
|
|
|
107
|
-
|
|
185
|
+
- tAPI routes:
|
|
186
|
+
- `spAPI_<Fn>` → `/<alias>/<Fn>`
|
|
187
|
+
- `spAPI_AUTH_<Fn>` → `/<alias>/auth/<Fn>`
|
|
188
|
+
- `spAPIFILE_*` → file endpoints
|
|
189
|
+
- tAPI parameters must not have default values (`@x int = 0`). Deploy blocks them.
|
|
190
|
+
- Every new procedure needs `GRANT EXECUTE ... TO [public]`. `sp deploy` does it; raw `exec` only reports it.
|
|
108
191
|
|
|
109
192
|
`fui --help` lists commands. `fui <command> --help` shows usage for one command.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# FUI Skill
|
|
2
|
+
|
|
3
|
+
> Agent Skill hỗ trợ AI phát triển web module theo kiến trúc metadata-driven của FUI — nơi giao diện và logic được định nghĩa hoàn toàn bằng JSON.
|
|
4
|
+
|
|
5
|
+
## ✨ Tổng quan
|
|
6
|
+
|
|
7
|
+
**FUI Skill** cung cấp cho AI agent các hướng dẫn và công cụ để xây dựng FUI web module, bao gồm:
|
|
8
|
+
|
|
9
|
+
- 📐 **Kiến trúc metadata-driven** — Giao diện và logic định nghĩa trong `module.json`
|
|
10
|
+
- 🧱 **Hệ thống grid bắt buộc** — Cấu trúc container > rows > cols nhất quán
|
|
11
|
+
- ⚡ **Action Protocol** — Gọi API, điều kiện, callback theo cách khai báo
|
|
12
|
+
- 🧩 **Template có sẵn** — Form, CRUD table, dialog, Vue component
|
|
13
|
+
- 🔍 **Đảm bảo chất lượng** — Review code và phân tích edge-case tích hợp
|
|
14
|
+
- 🛠️ **Công cụ module** — Lưu và publish module/component qua script
|
|
15
|
+
|
|
16
|
+
## 📦 Cài đặt
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx skills add fui-labs/fui-skill
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 📁 Cấu trúc thư mục
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
fui-skill/
|
|
26
|
+
├── SKILL.md # VĂN BẢN CHÍNH SÁCH: Session Start Protocol, quy tắc cứng,
|
|
27
|
+
│ # cổng quyết định, chuỗi publish. KHÔNG dạy cách làm.
|
|
28
|
+
├── metadata.json # Manifest (documentation-only)
|
|
29
|
+
├── examples/ # Template mẫu (module/f-table/project-patterns.json + component.vue)
|
|
30
|
+
├── references/ # 44 file tài liệu chi tiết (load theo nhu cầu)
|
|
31
|
+
│ ├── INDEX.md # ROUTER: tình huống/component → file cần load (Tier A)
|
|
32
|
+
│ ├── controls-patterns.md # Value resolution, action engine, layout grid, control object (Tier A)
|
|
33
|
+
│ ├── module-structure.md # Cấu trúc file module/project (Tier A)
|
|
34
|
+
│ ├── design-modes.md # App-mode vs Web-mode, {projectId}/DESIGN.md, giới hạn border-radius
|
|
35
|
+
│ ├── controls-styling-vocabulary.md # Bộ class/prop/style được duyệt
|
|
36
|
+
│ ├── script-map.md # Bản đồ script + thư viện đã bundled (đừng thêm CDN trùng)
|
|
37
|
+
│ ├── ui-patterns.md # UI core (+ ui-table-cell / ui-dialog / ui-crosswindow / ui-layout)
|
|
38
|
+
│ ├── components-echart.md # f-echart (+ echart-templates.md)
|
|
39
|
+
│ ├── tapi-reference.md # tAPI core (+ tapi-permission-patterns / tapi-file-api)
|
|
40
|
+
│ ├── permission-system.md # Phân quyền: SystemRight vs FunctionRight, 4 tool quản lý định nghĩa quyền
|
|
41
|
+
│ ├── db-workflow.md # Kết nối DB/SP (+ db-table-design.md)
|
|
42
|
+
│ ├── system-design.md # Thiết kế app nhiều module
|
|
43
|
+
│ └── ... # component-*, verification, tools-registry, ...
|
|
44
|
+
└── scripts/ # Mã nguồn runtime (component.js, componentTable.js, defaultfunction.js, fastproject.js)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> Bản đồ đầy đủ tình huống → file: xem [references/INDEX.md](references/INDEX.md).
|
|
48
|
+
|
|
49
|
+
**Nguyên tắc biên tập — canonical owner:** mỗi sự thật chỉ được viết đầy đủ ở **đúng một file**; nơi
|
|
50
|
+
khác chỉ để link. Mỗi reference mở đầu bằng một dòng `> File này sở hữu: X. Về Y xem <file>.md.` —
|
|
51
|
+
đọc dòng đó để biết nội dung mới thuộc về đâu, đừng viết lại vào `SKILL.md`.
|
|
52
|
+
|
|
53
|
+
## 🚀 Bắt đầu nhanh
|
|
54
|
+
|
|
55
|
+
Sau khi cài đặt, agent sẽ tự động sử dụng skill này khi bạn yêu cầu **tạo, chỉnh sửa hoặc review FUI module**.
|
|
56
|
+
|
|
57
|
+
### Tạo module mới
|
|
58
|
+
|
|
59
|
+
> *"Tạo module `user-management` có bảng dữ liệu và dialog thêm/sửa."*
|
|
60
|
+
|
|
61
|
+
Agent sẽ:
|
|
62
|
+
1. Tạo thư mục module với `module.json`, `_info.json`, `script.js`
|
|
63
|
+
2. Áp dụng hệ thống grid layout bắt buộc
|
|
64
|
+
3. Sử dụng Action Protocol để tích hợp API
|
|
65
|
+
4. Tuân theo coding standards và best practices
|
|
66
|
+
|
|
67
|
+
### Các khái niệm chính
|
|
68
|
+
|
|
69
|
+
| Khái niệm | Mô tả |
|
|
70
|
+
|:---|:---|
|
|
71
|
+
| **module.json** | File chính định nghĩa `data`, `watch`, `controls`, và `set` |
|
|
72
|
+
| **Action Protocol** | Khai báo action bằng `API`, `IN`, `OUT`, `CALL`, `IF/THEN/ELSE` |
|
|
73
|
+
| **Grid System** | Cấu trúc bắt buộc `container > rows > cols` cho mọi layout |
|
|
74
|
+
| **Control Object** | Phần tử UI được định nghĩa bởi `el`, `attr`, `w`, `col`, `innerHTML` |
|
|
75
|
+
|
|
76
|
+
### Ví dụ — Lấy dữ liệu bằng Action
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"fetchUsers": {
|
|
81
|
+
"API": "/api/users",
|
|
82
|
+
"IN": { "GroupID": "vueData.selectedGroup" },
|
|
83
|
+
"OUT": "userList",
|
|
84
|
+
"CALLBACK": { "MESS": "Tải thành công!" }
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 📚 Tài liệu tham khảo
|
|
90
|
+
|
|
91
|
+
| Tài liệu | Mô tả |
|
|
92
|
+
|:---|:---|
|
|
93
|
+
| [INDEX.md](references/INDEX.md) | **Router** — tình huống/component → file cần load |
|
|
94
|
+
| [controls-patterns.md](references/controls-patterns.md) | Action engine, value resolution, layout grid |
|
|
95
|
+
| [module-structure.md](references/module-structure.md) | Cấu trúc file module/project |
|
|
96
|
+
| [ui-patterns.md](references/ui-patterns.md) | UI core (data/watch/toolbar) + các file ui-* tách theo tình huống |
|
|
97
|
+
| [tapi-reference.md](references/tapi-reference.md) | tAPI SP naming, params, response + permission/file-api |
|
|
98
|
+
| [permission-system.md](references/permission-system.md) | Phân quyền: SystemRight (cấp bậc) vs FunctionRight (theo chức năng), 4 tool quản lý định nghĩa quyền |
|
|
99
|
+
| [system-design.md](references/system-design.md) | Thiết kế app nhiều module từ mô tả |
|
|
100
|
+
| [verification.md](references/verification.md) | Review code & checklist definition-of-done |
|
|
101
|
+
|
|
102
|
+
## 🤝 Đóng góp
|
|
103
|
+
|
|
104
|
+
Skill này là **tài liệu sống**, liên tục được cập nhật. Sau khi hoàn thành các task phức tạp, agent sẽ hỏi:
|
|
105
|
+
|
|
106
|
+
> *"Có bài học, pattern hoặc chỉnh sửa nào từ task này cần bổ sung vào FUI skill không?"*
|
|
107
|
+
|
|
108
|
+
Phản hồi sẽ được tích hợp bằng cách cập nhật hướng dẫn, thêm tài liệu mới, hoặc loại bỏ thông tin lỗi thời — đảm bảo skill luôn phản ánh best practices mới nhất.
|
|
109
|
+
|
|
110
|
+
## 📄 Giấy phép
|
|
111
|
+
|
|
112
|
+
MIT
|