@fui-org/fui-cli 1.0.4 → 1.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fui-org/fui-cli",
3
- "version": "1.0.4",
4
- "description": "Token-lean CLI for the FUI low-code platform, successor to Fui MCP",
3
+ "version": "1.1.0",
4
+ "description": "Token-lean CLI for the FUI low-code platform (Bun or Node.js), successor to Fui MCP",
5
5
  "keywords": [
6
6
  "ai",
7
7
  "bun",
@@ -23,9 +23,9 @@
23
23
  "access": "public"
24
24
  },
25
25
  "scripts": {
26
- "fui": "bun src/cli.ts",
27
- "build": "bun build src/cli.ts --target bun --minify --outfile dist/fui.js",
28
- "build:bin": "bun build --compile --minify src/cli.ts --outfile dist/fui",
26
+ "fui": "bun src/bin.ts",
27
+ "build": "bun build src/bin.ts --target node --minify --external bun --outfile dist/fui.js",
28
+ "build:bin": "bun build --compile --minify src/bin.ts --outfile dist/fui",
29
29
  "prepack": "bun run build",
30
30
  "test": "bun test",
31
31
  "lint": "oxlint",
@@ -33,7 +33,8 @@
33
33
  "format:check": "oxfmt --check",
34
34
  "typecheck": "tsc --noEmit",
35
35
  "sync:skill": "bun scripts/sync-skill.ts",
36
- "sync:upstream-tests": "bun scripts/sync-upstream-tests.ts"
36
+ "sync:upstream-tests": "bun scripts/sync-upstream-tests.ts",
37
+ "test:node": "bun run build && FUI_TEST_NODE=1 bun test test/cli.test.ts test/file.test.ts test/log.test.ts test/settings.test.ts test/simulate-last.test.ts"
37
38
  },
38
39
  "devDependencies": {
39
40
  "@fui-org/fui-mcp": "1.4.0",
@@ -52,6 +53,7 @@
52
53
  }
53
54
  },
54
55
  "engines": {
55
- "bun": ">=1.4.0"
56
+ "bun": ">=1.4.0",
57
+ "node": ">=22"
56
58
  }
57
59
  }
@@ -1,13 +1,27 @@
1
1
  ---
2
2
  name: fui
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.
3
+ description: Use the `fui` CLI for all FUI (low-code platform) work — projects, modules (get, validate, simulate, preview, publish), components, imports, project users, rights, DB connections, SQL, schema, stored procedures (tAPI spAPI_*), framework library, workspace files, publish ledger and history. Run it in the shell.
4
4
  ---
5
5
 
6
6
  # fui CLI
7
7
 
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.
8
+ `fui` is the command-line tool for the FUI low-code platform. Run it with your shell tool.
9
9
 
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.
10
+ ## Before you start
11
+
12
+ - FUI has its own conventions (module.json action engine, tAPI SP naming, `f-*` components). They differ from standard Vue/Vuetify/REST, so never rely on training-data assumptions.
13
+ - Before creating, editing, reviewing or deploying any module, component or stored procedure: run `fui skill get`, pick the reference files for your task from `references/INDEX.md`, and load them with `fui skill ref references/<file>.md ...`. The same files are in the `fui-skill` skill.
14
+ - Strict mode (`FUI_STRICT=1`) blocks publishing and deploys until the skill was read this session (`fui skill get`, `fui skill ref` or `fui skill loaded`) and while module.json has validation errors.
15
+ - First use on a machine: `fui config set api-base <url>` and `printf %s "$TOKEN" | fui config set api-token -` (ask the user for both). `fui config` shows what is set.
16
+
17
+ ## Working rules
18
+
19
+ - **Build order:** UI first with fake data in `data[]` plus a visual check, then design and deploy the SP contract, then replace the fake data with real API bindings (IN/OUT/CALLBACK).
20
+ - **Check cheapest first:** `module validate` (fix every error) → `module outline` → `module simulate` → `component preview` → `module simulate --render`. Read every screenshot you get and fix what you see in the same turn.
21
+ - **Never call a real API/SP/DML "to test".** Verifying an SP means reading its body (`fui sp verify`). Data edits the user asks for still run, gated by `--confirm-write`.
22
+ - **Create and edit are separate commands** (`new` / `update`); nothing upserts. Editing needs the record id.
23
+ - **Publishing is per file:** edit the local file, then push it. Pushing module.json does not carry script.js along (`module publish json` / `script` / `css` / `html`, `component new` / `update`, `import upload`, `project publish-config`).
24
+ - **Local files are a snapshot;** other people publish to the same project. `module get`, `project sync`, `schema pull` and `sp get` overwrite every file in their scope without asking. Whatever they replace is copied to `<workspace>/_history/` first (`fui file history <path>`, `fui file restore <path>`).
11
25
 
12
26
  ## Output contract
13
27
 
@@ -31,41 +45,8 @@ Domain rules (module.json, controls, tAPI conventions) live in the `fui-skill` s
31
45
  - With no `--db`: the only connection, else one inferred from the object name (`sp` commands), else the default.
32
46
  - Writes never use the default when a project has several connections.
33
47
  - `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 an hour. 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).
48
+ - `fui config` shows the workspace and API settings with their sources: flag, env (`FUI_WORKDIR`, `FUI_API_BASE`, `FUI_API_TOKEN`), `fui config set`, then a Fui MCP entry in `~/.claude.json` if one exists.
49
+ - A global install updates itself in the background, at most once an hour. A line starting `# fui updated` means a new version is running; the skills for Claude Code, Codex and Antigravity refresh on their own. `fui --version` prints the version.
69
50
 
70
51
  ## Modules
71
52
 
@@ -89,6 +70,16 @@ Every Fui MCP 1.4.0 tool has a fui command (the SSE-only `workspace_*` and `*_st
89
70
 
90
71
  Ask the user before `module delete`, `component delete`, `import delete` and `user remove`.
91
72
 
73
+ ## Components
74
+
75
+ - A component is one `uc-<name>.vue` file (Vue 2 options API). FUI takes the name from the file name and registers every `uc-*.vue` globally, so leave out `name:` and `components: {}` in `export default`.
76
+ - Use Vuetify components where they fit and validate props.
77
+ - Check it alone with `fui component preview <uc-name> --cases [...]` before wiring it into a module, then `fui component new|update <name>`.
78
+
79
+ ## Framework library
80
+
81
+ `fui library` lists the FUI framework sources on fui.vn (`component`, `component-table`, `default-function`, `fast-project`, `default-style`). `fui library default-function --path` caches one for a day and prints its path, so you can `grep` it instead of reading it whole.
82
+
92
83
  ## Data
93
84
 
94
85
  ```bash
@@ -190,3 +181,37 @@ Secrets are accepted only from stdin (`-`) or `--*-env VAR`. Never echo or paste
190
181
  - Every new procedure needs `GRANT EXECUTE ... TO [public]`. `sp deploy` does it; raw `exec` only reports it.
191
182
 
192
183
  `fui --help` lists commands. `fui <command> --help` shows usage for one command.
184
+
185
+ ## Coming from Fui MCP
186
+
187
+ `fui` shares the workspace, connection files, publish ledger, `_history` and error log with Fui MCP, so the two can run side by side. Each Fui MCP 1.4.0 tool maps to a command with the same guards, files and requests:
188
+
189
+ | MCP tool | fui |
190
+ | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
191
+ | session_set / session_read / session_clear / session_resolve | `use <target>` / `use` / `use --clear` / `resolve <target>` |
192
+ | project_list / project_sync | `project list` / `project sync` |
193
+ | project_new / project_update / project_publish_config | `project new --data {…}` / `project update --data {id:…}` / `project publish-config` |
194
+ | project_user_search / list / new / update / delete | `user search <text>` / `user list` / `user add <UserID> --right N` / `user set …` / `user remove <UserID>` |
195
+ | module_list / new / update / delete | `module list` / `module new <id> --name N` / `module update [--new-id] [--framework] …` / `module delete -p P -m M` |
196
+ | module_get / module_get_ui / module_get_html | `module get [<target>]` / `module get-ui` / `module get-html` |
197
+ | module_validate / module_preview | `module validate` / `module preview` |
198
+ | module_outline / module_simulate | `module outline` / `module simulate [--scenario [...]] [--mocks {...}] [--user {...}] [--url-params {...}]` |
199
+ | module_simulate renderUI / component_preview | `module simulate --render [--device mobile] [--vue-data {...}]` / `component preview <uc-name> [--cases [...]] [--device desktop,mobile]` |
200
+ | error_log_read / error_log_clear | `log read [--tool T] [--limit N\|0] [--summary]` / `log clear` |
201
+ | module_publish_html / json / script / css | `module publish html --approval <token>` / `module publish json` / `… script` / `… css` |
202
+ | component_list / get / new / update / delete | `component list` / `component get <name>` / `component new <name>` / `component update <name>` / `component delete <name>` |
203
+ | 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>` |
204
+ | db_config_read / db_connect | `db list` / `db add <alias> --token - --api-domain host` |
205
+ | db_connect_by_name / db_alias_list / db_alias_new | `db add-by-name <alias>` / `db alias list [--search s]` / `db alias new <alias> …` |
206
+ | db_user_token_set / db_token_rebuild | `db user-token [--from p/alias]` / `db token-rebuild --uid U --pwd-env VAR` |
207
+ | 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>` |
208
+ | db_schema_get / db_schema_read | `schema pull [--prune-local-only]` / `schema [--type T] [--search text]` |
209
+ | db_sp_list / db_sp_get / db_sp_save | `sp list` / `sp get <name> [--print]` / `sp save <name> -f file` |
210
+ | db_sp_deploy / db_sp_help | `sp deploy <name>` / `sp help <name\|Fn> [--full]` |
211
+ | 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>` |
212
+ | db_sql_execute / db_sql_execute_nonquery | `query "<sql>"` / `exec "<sql>"` (+ `--confirm-write`) |
213
+ | skill_get / skill_reference_get / skill_sync | `skill get` / `skill ref <path...>` / `skill sync` |
214
+ | design_list / design_read | `design list` / `design read <brand>` |
215
+ | resources lowcode://library/v2/\* / prompt generate-vue-component | `library <name>` / the Components section above |
216
+
217
+ Every Fui MCP 1.4.0 tool has a fui command (the SSE-only `workspace_*` and `*_stage` tools are out of scope).