@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/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,115 +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. Run `fui skill install` afterwards if you installed the 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.
50
+ Ask your FUI administrator for the API address and your API token, then:
66
51
 
67
- Remove with `bun remove -g @fui-org/fui-cli`.
52
+ ```bash
53
+ fui config set api-base https://<fui-api-host>
54
+ printf %s "$FUI_TOKEN" | fui config set api-token -
55
+ fui project list
56
+ ```
57
+
58
+ The token is read from stdin, so it never lands in your shell history. `fui config` shows the current settings.
68
59
 
69
- ### From source
60
+ For real-browser checks (`fui module simulate --render`, `fui component preview`), install Playwright once:
70
61
 
71
62
  ```bash
72
- bun install
73
- bun link
63
+ bun add -g playwright && bunx playwright install chromium
74
64
  ```
75
65
 
76
- `bun link` points `fui` at `src/cli.ts`, so source edits apply immediately.
66
+ ## Updates
77
67
 
78
- ### Build outputs
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`.
79
69
 
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
70
+ ## Use with an AI agent
84
71
 
85
- npm never accepts the same version twice, so bump before every publish (`patch` for fixes, `minor` for features):
72
+ `fui` installs two skills for each AI agent it finds, and refreshes them after every update:
86
73
 
87
- ```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>
91
- ```
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.
92
76
 
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.
77
+ | Agent | Skills folder |
78
+ | ----------- | ------------------------------ |
79
+ | Claude Code | `~/.claude/skills` |
80
+ | Codex | `~/.agents/skills` |
81
+ | Antigravity | `~/.gemini/antigravity/skills` |
94
82
 
95
- ## Use with an AI agent
83
+ Installed an agent later? The next `fui` run adds its skills. To install by hand:
96
84
 
97
85
  ```bash
98
- fui skill install
86
+ fui skill install [--agent claude,codex,antigravity|all]
99
87
  ```
100
88
 
101
- This writes `~/.claude/skills/fui/SKILL.md`, which teaches the agent the commands, output format, exit codes and safety rules. `fui skill` prints the same guide.
102
-
103
89
  ## Quick tour
104
90
 
105
91
  ```bash
92
+ fui --help
93
+ fui module get /my-project/my-module
94
+ fui module validate
106
95
  fui db list
107
- fui query "SELECT TOP 5 * FROM tblX" --db lhu-docs/docs
96
+ fui query "SELECT TOP 5 * FROM tblX" --db my-project/docs
108
97
  fui schema --search student
109
98
  fui sp get spAPI_Student_Select
110
- fui sp deploy spAPI_Student_Select
111
99
  fui file status
112
100
  ```
113
101
 
114
- ## Parity with Fui MCP
115
-
116
- `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).
117
-
118
- - **Source of truth:** `@fui-org/fui-mcp@1.4.0` is pinned as a dev dependency.
119
- - **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.
120
- - **What stays identical:** guards, confirmations, reading and pulling.
121
- - **What changes:** output is terse, and limits that exist only for the context window can be lifted with flags.
122
-
123
- 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.
124
103
 
125
104
  ## Workspace location
126
105
 
127
- `fui` picks the workspace folder in this order:
128
-
129
- 1. `--workdir <dir>`
130
- 2. `FUI_MCP_WORKDIR` env var
131
- 3. `fui config set workdir <dir>`, saved in `~/.config/fui/config.json` (respects `XDG_CONFIG_HOME`)
132
- 4. `FUI_MCP_WORKDIR` of the Fui MCP server in `~/.claude.json` (project scope first, then user scope; respects `CLAUDE_CONFIG_DIR`)
133
- 5. `~/.fui-mcp/workspaces`
106
+ `fui` keeps projects in `~/.fui-mcp/workspaces`, the same folder Fui MCP uses. To use another folder:
134
107
 
135
108
  ```bash
136
- fui config # effective value and where it came from
137
109
  fui config set workdir ~/work/fui
138
- fui config unset workdir
139
110
  ```
140
111
 
141
- ## Connections
142
-
143
- A dbToken is Base64 of a connection string. The engine is detected from the token:
144
-
145
- | Connection string | Engine | Transport |
146
- | --------------------------------------------- | --------------- | ------------------------------------------- |
147
- | `Server=...; Database=...; UID=...; PWD=...;` | MSSQL | tAPI over HTTPS, the same path Fui MCP uses |
148
- | `postgres://...` | Postgres | direct, through `Bun.SQL` |
149
- | `mysql://...`, `mariadb://...` | MySQL / MariaDB | direct, through `Bun.SQL` |
150
- | `sqlite://...`, `file:...` | SQLite | direct, through `Bun.SQL` |
112
+ ## Database connections
151
113
 
152
114
  Secrets are read only from stdin (`-`) or from an env var (`--*-env VAR`):
153
115
 
154
116
  ```bash
155
- 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
156
118
  fui db add local -p demo --conn-env PG_URL
119
+ fui db list
157
120
  ```
158
121
 
159
- ## Development
122
+ A connection is an MSSQL string (through tAPI) or a `postgres://`, `mysql://` or `sqlite://` URL.
123
+
124
+ ## Uninstall
160
125
 
161
126
  ```bash
162
- bun test
163
- bun run typecheck
164
- bun run lint
165
- bun run format:check
127
+ bun remove -g @fui-org/fui-cli
166
128
  ```
129
+
130
+ With npm: `npm uninstall -g @fui-org/fui-cli`.