@fui-org/fui-cli 1.0.5 → 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/README.md CHANGED
@@ -1,17 +1,6 @@
1
1
  # fui
2
2
 
3
- A token-lean CLI for the FUI low-code platform, built with Bun. It is the successor to the Fui MCP server (`@fui-org/fui-mcp`).
4
-
5
- v1 covers the database workflow:
6
-
7
- - connections
8
- - SQL
9
- - schema
10
- - stored procedures
11
-
12
- It shares the Fui MCP workspace, so existing connections work immediately.
13
-
14
- Design: [docs/specs/2026-09-28-fui-cli-v1-design.md](docs/specs/2026-09-28-fui-cli-v1-design.md)
3
+ A command-line tool for the FUI low-code platform: projects, modules, components, imports, users, rights, database connections, SQL, schema and stored procedures. It works with AI agents (Claude Code, Codex, Antigravity) and replaces the Fui MCP server.
15
4
 
16
5
  ## Install
17
6
 
@@ -52,128 +41,90 @@ bun add -g @fui-org/fui-cli
52
41
  fui --version
53
42
  ```
54
43
 
55
- This puts `fui` on your `PATH`, in `~/.bun/bin` on macOS and Linux and in `%USERPROFILE%\.bun\bin` on Windows. To run it once without installing:
44
+ This puts `fui` on your `PATH`, in `~/.bun/bin` on macOS and Linux and in `%USERPROFILE%\.bun\bin` on Windows.
56
45
 
57
- ```bash
58
- bunx --package @fui-org/fui-cli fui --help
59
- ```
46
+ Already use Node.js 22 or later? `npm install -g @fui-org/fui-cli` works too. Also install Node.js 22+ on a Bun-only machine, because `fui` starts through `node`. Postgres and MySQL connections need Bun.
60
47
 
61
- A global install updates itself. At most once an hour, a command starts a background check against the npm registry. When a newer release exists, the check runs `bun add -g @fui-org/fui-cli@<latest>`. The command you ran is never delayed, and the next run prints one line saying what changed and refreshes the Claude skills.
48
+ ### 3. Set up
62
49
 
63
- - `fui update` updates now; `fui update --check` only reports.
64
- - Turn it off with `fui config set auto-update off` or `FUI_AUTO_UPDATE=0`.
65
- - A `bun link` checkout or a compiled binary never replaces itself; `fui update` prints the install command instead.
66
-
67
- Remove with `bun remove -g @fui-org/fui-cli`.
68
-
69
- ### From source
50
+ Ask your FUI administrator for the API address and your API token, then:
70
51
 
71
52
  ```bash
72
- bun install
73
- bun link
53
+ fui config set api-base https://<fui-api-host>
54
+ printf %s "$FUI_TOKEN" | fui config set api-token -
55
+ fui project list
74
56
  ```
75
57
 
76
- `bun link` points `fui` at `src/cli.ts`, so source edits apply immediately.
77
-
78
- ### Build outputs
79
-
80
- - `bun run build` writes `dist/fui.js`, a single minified bundle for Bun. This is the file the npm package ships; `prepack` runs it automatically.
81
- - `bun run build:bin` writes `dist/fui`, a standalone executable that runs without Bun installed.
82
-
83
- ### Release
58
+ The token is read from stdin, so it never lands in your shell history. `fui config` shows the current settings.
84
59
 
85
- npm never accepts the same version twice, so bump before every publish (`patch` for fixes, `minor` for features):
60
+ For real-browser checks (`fui module simulate --render`, `fui component preview`), install Playwright once:
86
61
 
87
62
  ```bash
88
- bun test && bun run typecheck && bun run lint && bun run format:check
89
- bun pm version patch --no-git-tag-version
90
- bun publish --otp <code>
63
+ bun add -g playwright && bunx playwright install chromium
91
64
  ```
92
65
 
93
- `bun publish` packs `dist/fui.js`, `skills/` and `README.md`, and needs npm access to the `@fui-org` scope and 2FA on the account.
66
+ ## Updates
94
67
 
95
- ## Use with an AI agent
68
+ `fui` updates itself in the background, at most once an hour, and prints one line after an update. `fui update` updates now, and `fui update --check` only reports. Turn it off with `fui config set auto-update off`.
96
69
 
97
- A global install gives each AI agent on the machine two skills:
70
+ ## Use with an AI agent
98
71
 
99
- - `fui/SKILL.md` teaches the agent the commands, output format, exit codes and safety rules. `fui skill` prints the same guide.
100
- - `fui-skill/` is the FUI domain skill from Fui MCP 1.4.0, unchanged: module.json, components, tAPI and SP references, design systems.
72
+ `fui` installs two skills for each AI agent it finds, and refreshes them after every update:
101
73
 
102
- | Agent | Found when this folder exists | Skills go to |
103
- | ----------- | ------------------------------------ | ------------------------------ |
104
- | Claude Code | `~/.claude` (or `CLAUDE_CONFIG_DIR`) | `~/.claude/skills` |
105
- | Codex | `~/.codex` (or `CODEX_HOME`) | `~/.agents/skills` |
106
- | Antigravity | `~/.gemini/antigravity` | `~/.gemini/antigravity/skills` |
74
+ - `fui` teaches the agent the commands and safety rules. `fui skill` prints it.
75
+ - `fui-skill` holds the FUI domain rules: module.json, components, tAPI and stored procedures, design systems.
107
76
 
108
- The skills are written on the first `fui` run after install, right after every update, and on the first run after you install another agent. On Windows, `~` is `%USERPROFILE%`. Each install replaces both folders, so keep your own notes elsewhere. Turn it off with `FUI_AUTO_SKILLS=0`.
77
+ | Agent | Skills folder |
78
+ | ----------- | ------------------------------ |
79
+ | Claude Code | `~/.claude/skills` |
80
+ | Codex | `~/.agents/skills` |
81
+ | Antigravity | `~/.gemini/antigravity/skills` |
109
82
 
110
- To install by hand, for an agent not installed yet, or into another folder:
83
+ Installed an agent later? The next `fui` run adds its skills. To install by hand:
111
84
 
112
85
  ```bash
113
- fui skill install [--agent claude,codex,antigravity|all] [--dir <skills-root>]
86
+ fui skill install [--agent claude,codex,antigravity|all]
114
87
  ```
115
88
 
116
89
  ## Quick tour
117
90
 
118
91
  ```bash
92
+ fui --help
93
+ fui module get /my-project/my-module
94
+ fui module validate
119
95
  fui db list
120
- fui query "SELECT TOP 5 * FROM tblX" --db lhu-docs/docs
96
+ fui query "SELECT TOP 5 * FROM tblX" --db my-project/docs
121
97
  fui schema --search student
122
98
  fui sp get spAPI_Student_Select
123
- fui sp deploy spAPI_Student_Select
124
99
  fui file status
125
100
  ```
126
101
 
127
- ## Parity with Fui MCP
128
-
129
- `fui` ports Fui MCP 1.4.0 tool by tool. The spec is [docs/specs/2026-09-28-fui-cli-v2-parity-design.md](docs/specs/2026-09-28-fui-cli-v2-parity-design.md).
130
-
131
- - **Source of truth:** `@fui-org/fui-mcp@1.4.0` is pinned as a dev dependency.
132
- - **Parity tests:** `test/parity/` runs its real tool handlers next to `fui` on twin workspaces. They compare the HTTP requests, the files written and the outcome byte for byte.
133
- - **What stays identical:** guards, confirmations, reading and pulling.
134
- - **What changes:** output is terse, and limits that exist only for the context window can be lifted with flags.
135
-
136
- Commands already ported, and the MCP tools still to come, are listed in the `fui` skill (`fui skill`).
102
+ `fui <command> --help` shows the options of one command.
137
103
 
138
104
  ## Workspace location
139
105
 
140
- `fui` picks the workspace folder in this order:
141
-
142
- 1. `--workdir <dir>`
143
- 2. `FUI_MCP_WORKDIR` env var
144
- 3. `fui config set workdir <dir>`, saved in `~/.config/fui/config.json` (respects `XDG_CONFIG_HOME`)
145
- 4. `FUI_MCP_WORKDIR` of the Fui MCP server in `~/.claude.json` (project scope first, then user scope; respects `CLAUDE_CONFIG_DIR`)
146
- 5. `~/.fui-mcp/workspaces`
106
+ `fui` keeps projects in `~/.fui-mcp/workspaces`, the same folder Fui MCP uses. To use another folder:
147
107
 
148
108
  ```bash
149
- fui config # effective value and where it came from
150
109
  fui config set workdir ~/work/fui
151
- fui config unset workdir
152
110
  ```
153
111
 
154
- ## Connections
155
-
156
- A dbToken is Base64 of a connection string. The engine is detected from the token:
157
-
158
- | Connection string | Engine | Transport |
159
- | --------------------------------------------- | --------------- | ------------------------------------------- |
160
- | `Server=...; Database=...; UID=...; PWD=...;` | MSSQL | tAPI over HTTPS, the same path Fui MCP uses |
161
- | `postgres://...` | Postgres | direct, through `Bun.SQL` |
162
- | `mysql://...`, `mariadb://...` | MySQL / MariaDB | direct, through `Bun.SQL` |
163
- | `sqlite://...`, `file:...` | SQLite | direct, through `Bun.SQL` |
112
+ ## Database connections
164
113
 
165
114
  Secrets are read only from stdin (`-`) or from an env var (`--*-env VAR`):
166
115
 
167
116
  ```bash
168
- printf %s "$TOKEN" | fui db add docs -p lhu-docs --token - --api-domain tapi.lhu.edu.vn
117
+ printf %s "$TOKEN" | fui db add docs -p my-project --token - --api-domain tapi.example.edu.vn
169
118
  fui db add local -p demo --conn-env PG_URL
119
+ fui db list
170
120
  ```
171
121
 
172
- ## Development
122
+ A connection is an MSSQL string (through tAPI) or a `postgres://`, `mysql://` or `sqlite://` URL.
123
+
124
+ ## Uninstall
173
125
 
174
126
  ```bash
175
- bun test
176
- bun run typecheck
177
- bun run lint
178
- bun run format:check
127
+ bun remove -g @fui-org/fui-cli
179
128
  ```
129
+
130
+ With npm: `npm uninstall -g @fui-org/fui-cli`.