@fui-org/fui-cli 0.3.0 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fui-org/fui-cli",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "description": "Token-lean CLI for the FUI low-code platform, successor to Fui MCP",
5
5
  "keywords": [
6
6
  "ai",
@@ -32,15 +32,25 @@
32
32
  "format": "oxfmt",
33
33
  "format:check": "oxfmt --check",
34
34
  "typecheck": "tsc --noEmit",
35
- "sync:skill": "bun scripts/sync-skill.ts"
35
+ "sync:skill": "bun scripts/sync-skill.ts",
36
+ "sync:upstream-tests": "bun scripts/sync-upstream-tests.ts"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@fui-org/fui-mcp": "1.4.0",
39
40
  "@types/bun": "latest",
40
41
  "oxfmt": "^0.70.0",
41
42
  "oxlint": "^1.85.0",
43
+ "playwright": "1.62.1",
42
44
  "typescript": "^7.0.2"
43
45
  },
46
+ "peerDependencies": {
47
+ "playwright": ">=1.40.0"
48
+ },
49
+ "peerDependenciesMeta": {
50
+ "playwright": {
51
+ "optional": true
52
+ }
53
+ },
44
54
  "engines": {
45
55
  "bun": ">=1.4.0"
46
56
  }
@@ -32,39 +32,52 @@ Domain rules (module.json, controls, tAPI conventions) live in the `fui-skill` s
32
32
  - Writes never use the default when a project has several connections.
33
33
  - `fui file where` prints what resolved and why.
34
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.
35
36
 
36
37
  ## Fui MCP tool → fui command
37
38
 
38
39
  Implemented (same guards, same files, same requests as Fui MCP 1.4.0):
39
40
 
40
- | MCP tool | fui |
41
- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
42
- | session_set / session_read / session_clear / session_resolve | `use <target>` / `use` / `use --clear` / `resolve <target>` |
43
- | project_list / project_sync | `project list` / `project sync` |
44
- | project_new / project_update / project_publish_config | `project new --data {…}` / `project update --data {id:…}` / `project publish-config` |
45
- | project_user_search / list / new / update / delete | `user search <text>` / `user list` / `user add <UserID> --right N` / `user set …` / `user remove <UserID>` |
46
- | module_list / new / update / delete | `module list` / `module new <id> --name N` / `module update [--new-id] [--framework] …` / `module delete -p P -m M` |
47
- | module_get / module_get_ui / module_get_html | `module get [<target>]` / `module get-ui` / `module get-html` |
48
- | module_validate / module_preview | `module validate` / `module preview` |
49
- | module_publish_html / json / script / css | `module publish html --approval <token>` / `module publish json` / `… script` / `… css` |
50
- | component_list / get / new / update / delete | `component list` / `component get <name>` / `component new <name>` / `component update <name>` / `component delete <name>` |
51
- | 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>` |
52
- | db_config_read / db_connect | `db list` / `db add <alias> --token - --api-domain host` |
53
- | db_schema_get / db_schema_read | `schema pull [--prune-local-only]` / `schema [--type T] [--search text]` |
54
- | db_sp_list / db_sp_get / db_sp_save | `sp list` / `sp get <name> [--print]` / `sp save <name> -f file` |
55
- | db_sp_deploy / db_sp_help | `sp deploy <name>` / `sp help <name\|Fn> [--full]` |
56
- | db_sql_execute / db_sql_execute_nonquery | `query "<sql>"` / `exec "<sql>"` (+ `--confirm-write`) |
57
- | skill_get / skill_reference_get / skill_sync | `skill get` / `skill ref <path...>` / `skill sync` |
58
- | design_list / design_read | `design list` / `design read <brand>` |
59
-
60
- Not in fui yet (use the Fui MCP tool): `right_*`, `db_alias_*`, `db_connect_by_name`, `db_sp_verify`, `db_sp_delete`, `db_sp_rename`, `db_token_rebuild`, `db_user_token_set`, `module_outline`, `module_simulate`, `component_preview`, `error_log_*`.
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).
61
69
 
62
70
  ## Modules
63
71
 
64
72
  1. `fui module get /project/module` (also a live URL or display name).
65
73
  - It archives local files that differ, deletes `.vue` files the server no longer has, and makes the module the session target.
66
74
  2. Edit the files in `<workspace>/<project>/modules/<module>/`. Running `fui` from inside that folder targets it.
67
- 3. `fui module validate`: fix every error; it only reads local files.
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`.
68
81
  4. Publish:
69
82
  - **Whole module, including header/body:** `fui module preview` → show the changes to the user → after approval `fui module publish html --approval <token>`.
70
83
  - The token breaks if any payload file changes after the preview.
@@ -112,6 +125,8 @@ fui sp list --search Student # columns: db name kind count local
112
125
  - clears the tAPI cache
113
126
  4. If the grant failed, do **not** redeploy. Run the printed `fui exec "GRANT ..."`.
114
127
 
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.
129
+
115
130
  ## Writes need the user
116
131
 
117
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`.
@@ -134,7 +149,7 @@ fui file ledger <path...> [--mark|--forget]
134
149
 
135
150
  ## Compose with shell
136
151
 
137
- Filter and loop in the shell. Piped output costs no tokens.
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).
138
153
 
139
154
  ```bash
140
155
  fui sp list --no-header --type API | cut -f2 # API SP names
@@ -160,6 +175,9 @@ fui token decode --db lhu-docs/docs # never shows the password
160
175
  Secrets are accepted only from stdin (`-`) or `--*-env VAR`. Never echo or paste token values.
161
176
 
162
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`.
163
181
  - `fui db list` shows a pre-1.4 `_db/config.json` as `engine=legacy`. Migrate it with `fui db import-legacy -p <project>`.
164
182
 
165
183
  ## FUI conventions