@lenso/cli 0.1.24 → 0.1.27

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lenso contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -16,27 +16,30 @@ cargo install lenso-cli
16
16
  lenso host init my-app
17
17
  cd my-app
18
18
  cp .env.example .env
19
+ lenso console update
19
20
  lenso serve
20
21
  ```
21
22
 
22
23
  The package name defaults to the target directory name and can be overridden with
23
24
  `--name`. Pass `--force` to scaffold into a non-empty directory.
24
- Release builds of `lenso-cli` also copy the bundled Runtime Console into the
25
- new project, so the API serves it at `/console` without requiring Node.js or
26
- pnpm in the host application.
27
-
28
- Update the hosted console later by upgrading `lenso-cli` and running:
25
+ Install or update the hosted Runtime Console with:
29
26
 
30
27
  ```sh
31
- lenso host update-console
28
+ lenso console update
32
29
  ```
33
30
 
31
+ The command downloads the latest `lenso-runtime-console` release artifact and
32
+ installs it under `.lenso/console`, so the host API can serve `/console`
33
+ without requiring Node.js or pnpm in the host application. For local builds,
34
+ pass `--artifact <dir-or-tar.gz>`. For a pinned release, pass
35
+ `--console-version vX.Y.Z`.
36
+
34
37
  After creating a password user, grant the first Runtime Console admin:
35
38
 
36
39
  ```sh
37
- lenso host bootstrap-admin --identifier admin@example.com
40
+ lenso console bootstrap-admin --identifier admin@example.com
38
41
  # or
39
- lenso host bootstrap-admin --user-id usr_...
42
+ lenso console bootstrap-admin --user-id usr_...
40
43
  ```
41
44
 
42
45
  `console.admin` is always added. Pass extra `--scope <name>` flags when the
@@ -67,7 +70,86 @@ workspace package:
67
70
  lenso module create billing --with-console
68
71
  ```
69
72
 
70
- For a standalone remote package:
73
+ For a standalone service provider:
74
+
75
+ ```sh
76
+ lenso service create support-suite-provider --lang ts --output-dir ../services
77
+ lenso service create support-suite-provider --lang rust --output-dir ../services --port 4110
78
+ ```
79
+
80
+ The generated provider includes a `lenso.service.json` manifest and a minimal
81
+ service process. A service name ending in `-provider` or `-service` provides a
82
+ module named without that suffix, so `support-suite-provider` provides
83
+ `support-suite`.
84
+ `service create` also updates `lenso.workspace.json` unless `--no-workspace` is
85
+ set. That workspace file is the local service plane for development:
86
+
87
+ ```sh
88
+ lenso service workspace list
89
+ lenso service dev
90
+ ```
91
+
92
+ `lenso service dev` starts workspace services first, then starts declared
93
+ installed services from `.lenso/module-services.json`, then runs the host.
94
+ Workspace reads prefer `lenso.workspace.json` and also accept the older
95
+ `.lenso/services.json` path for compatibility.
96
+ Generated TS and Rust services also support `--check-release` to print the
97
+ development module release descriptor before packaging.
98
+ Before handing a service to another app or deployment pipeline, package-check
99
+ the project and then emit a local service artifact:
100
+
101
+ ```sh
102
+ cd ../services/support-suite-provider
103
+ lenso service package --check
104
+ lenso service package --output-dir dist/lenso-service
105
+ ```
106
+
107
+ The package artifact contains the canonical `lenso.service.json`,
108
+ `lenso.service-package.json`, and one
109
+ `modules/<module>/lenso.module.json` plus
110
+ `modules/<module>/lenso.module-release.json` file for each provided module.
111
+ The service package records the provider name, version, and provided module
112
+ names; each module release is the business-module install entrypoint.
113
+ Operators can install a provider directly. For a local package artifact, still
114
+ pass the runtime service base URL:
115
+
116
+ ```sh
117
+ lenso service install dist/lenso-service/support-suite-provider/lenso.service-package.json \
118
+ --base-url http://127.0.0.1:4100/lenso/service/v1
119
+ ```
120
+
121
+ Install a packaged module release with the module command:
122
+
123
+ ```sh
124
+ lenso module release inspect dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json
125
+ lenso module release check dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
126
+ --base-url http://127.0.0.1:4100/lenso/service/v1
127
+ lenso module install dist/lenso-service/support-suite-provider/modules/support-ticket/lenso.module-release.json \
128
+ --base-url http://127.0.0.1:4100/lenso/service/v1
129
+ lenso module enable support-ticket
130
+ lenso module disable support-ticket
131
+ ```
132
+
133
+ `lenso.module-release.v1` is the module release channel. It records the module
134
+ name, version, capabilities, source, and optional provider pointer. V11 keeps
135
+ `lenso module install` as the unified business-capability entrypoint:
136
+
137
+ - `source: service` resolves to a provider service package or service manifest.
138
+ - `source: linked` enables linked Rust code in the host.
139
+ - `source: bundled` enables a host-bundled module.
140
+
141
+ `lenso service install` remains the lower-level provider/process command. It
142
+ connects a service, but it does not mean every module inside that service is
143
+ the user-facing install target.
144
+
145
+ When this command runs from a framework checkout with sibling `lenso` and
146
+ `lenso-runtime-console` repositories, the scaffold uses local path/file
147
+ dependencies so `cargo check` or `pnpm install` can run before the packages are
148
+ published. Outside that checkout it keeps the future-publish version
149
+ dependencies and prints a note to replace them with local paths until
150
+ `lenso-service` and `@lenso/service-kit` are published.
151
+
152
+ The older standalone module package generator is still available as:
71
153
 
72
154
  ```sh
73
155
  lenso module create billing --remote --output-dir ../module-packages
@@ -76,14 +158,36 @@ lenso module create billing --remote --output-dir ../module-packages
76
158
  The Runtime Console package generator is available directly as:
77
159
 
78
160
  ```sh
79
- lenso console-package create billing
161
+ lenso console package create billing
162
+ ```
163
+
164
+ ### Runtime Console package development
165
+
166
+ Preview a console package while editing it:
167
+
168
+ ```sh
169
+ lenso console dev --package packages/auth-console
170
+ ```
171
+
172
+ From a module repository root, discover every local console package:
173
+
174
+ ```sh
175
+ lenso module dev --console
80
176
  ```
81
177
 
178
+ Both commands default to standalone mock mode. Add `--host` to proxy real Lenso
179
+ host APIs while still loading the local package bundle:
180
+
181
+ ```sh
182
+ lenso module dev --console --host http://localhost:3000
183
+ ```
184
+
185
+ Set `LENSO_RUNTIME_CONSOLE_ROOT=/path/to/lenso-runtime-console` when the Runtime
186
+ Console checkout is not a sibling of the current repository.
187
+
82
188
  ## Install a module
83
189
 
84
190
  ```sh
85
- lenso module install https://example.com/lenso/module/v1/manifest
86
- lenso module install ./lenso.module.json
87
191
  lenso module install auth
88
192
  lenso module install auth-password
89
193
  lenso module install auth-oidc
@@ -91,12 +195,42 @@ lenso module install auth-device
91
195
  ```
92
196
 
93
197
  `module install` reads `source` from the module descriptor when one is present.
94
- Remote modules update `REMOTE_MODULES`, copy declared Runtime Console bundles to
198
+ When the reference is a module name, the CLI resolves it from the official
199
+ catalog at `https://catalog.lenso.dev/v1/modules.json` unless `--catalog-url`
200
+ points at another registry. For V5 service-backed modules, `module install
201
+ <name>` is the business-capability entrypoint: the catalog resolves the provider
202
+ service, installs it when needed, then enables the requested module.
203
+ For module releases, `module install <module-release.json>` resolves the
204
+ release by source, then records `moduleRelease` provenance in
205
+ `.lenso/module-installs.json` where the source supports a receipt.
206
+
207
+ Install a service directly when you have a workspace service name or manifest
208
+ reference:
209
+
210
+ ```sh
211
+ lenso service install support-suite-provider
212
+ lenso service install https://example.com/lenso/service/v1/manifest
213
+ lenso service install ./lenso.service.json --repo-root ../my-lenso-host
214
+ ```
215
+
216
+ When the first argument matches a service in `lenso.workspace.json` or
217
+ `.lenso/services.json`, the CLI resolves its manifest and infers `--base-url`
218
+ from the service `readyUrl`. Local source manifests registered in the workspace
219
+ also infer `--base-url`; package artifacts outside that workspace still need
220
+ `--base-url` so the host records the runtime service endpoint rather than the
221
+ file path.
222
+
223
+ Service installs update `REMOTE_MODULES`, copy declared Runtime Console bundles to
95
224
  `.lenso/console/extensions`, update `.lenso/console/extensions/registry.json`,
96
225
  and record `.lenso/module-installs.json` in one step. Linked modules update the
97
226
  host `Cargo.toml`, `src/lib.rs`, `.env` toggle, and the same install receipt
98
227
  from the descriptor's `linked` section. `module add` remains a compatibility
99
- alias for remote installs.
228
+ alias for service installs.
229
+
230
+ Legacy `lenso module install <manifest-url>` still works for one compatibility
231
+ window, but prints a deprecation warning. Use `lenso service install <manifest>`
232
+ for process manifests and `lenso module install <module-name>` for business
233
+ modules.
100
234
 
101
235
  Install descriptor profiles let a module expose optional setup without baking
102
236
  module-specific choices into the CLI. For Redis-backed auth sessions:
@@ -127,36 +261,97 @@ builtin module entry.
127
261
  Use `--no-console-extension` when you want to skip Runtime Console extension
128
262
  registration.
129
263
 
130
- Remote manifests may also declare `install.env` values and `install.commands`.
131
- Env values are written to `.env`; commands are run only when you pass:
264
+ Service module manifests may also declare `install.env` values and
265
+ `install.commands`. Env values are written to `.env`; commands are run only when
266
+ you pass:
132
267
 
133
268
  ```sh
134
- lenso module install https://example.com/lenso/module/v1/manifest --run-install-commands
269
+ lenso service install https://example.com/lenso/service/v1/manifest --run-install-commands
135
270
  ```
136
271
 
137
- For long-running remote module backends, declare `install.services`. These are
138
- stored in `.lenso/module-services.json` and started before the host loads remote
139
- modules on API/worker startup. Services started by the host are tracked with
272
+ For long-running service backends, declare `install.services`. These are
273
+ stored in `.lenso/module-services.json` and started before the host loads
274
+ service-provided modules on API/worker startup. Services started by the host are tracked with
140
275
  `.lock`/`.pid` files and stopped when the owning API/worker process exits;
141
276
  services that are already ready before startup are treated as external and are
142
277
  not stopped by the host.
143
278
 
144
- Diagnose installed remote-module service state with:
279
+ During local development, start declared service providers and then the host
280
+ with:
281
+
282
+ ```sh
283
+ lenso service dev
284
+ lenso service dev --skip-db --skip-migrate
285
+ lenso service dev --workspace-file lenso.workspace.json
286
+ ```
287
+
288
+ After the service processes are running, check the workspace from another shell:
289
+
290
+ ```sh
291
+ lenso service workspace check
292
+ lenso service workspace check support-suite-provider --json
293
+ lenso service verify
294
+ lenso service verify support-suite-provider --json
295
+ lenso service verify ./lenso.service.json --env-file .env --json
296
+ ```
297
+
298
+ Use `lenso service dev --no-workspace` when only installed
299
+ `.lenso/module-services.json` providers should start.
300
+
301
+ `lenso service workspace check` verifies that each declared service directory
302
+ exists, its manifest is reachable, and its `readyUrl` is responding before the
303
+ host tries to load the provider.
304
+
305
+ `lenso service verify` is the release-readiness entrypoint. With no argument it
306
+ checks `./lenso.service.json`; with a provider name it reuses the installed
307
+ service doctor checks. Pass `--env-file` to include required/missing service env
308
+ in the verification report.
309
+
310
+ Preview service upgrade impact before writing host-local state:
311
+
312
+ ```sh
313
+ lenso service upgrade-plan billing ./lenso.service.json --json
314
+ lenso service upgrade billing ./lenso.service.json --dry-run
315
+ ```
316
+
317
+ Export workspace services into the host service-start state format when a script
318
+ or deployment handoff should consume the same service declarations:
319
+
320
+ ```sh
321
+ lenso service workspace export --output .lenso/module-services.json
322
+ ```
323
+
324
+ Diagnose installed service state with:
325
+
326
+ ```sh
327
+ lenso service doctor
328
+ lenso service doctor billing
329
+ lenso service doctor billing --json
330
+ lenso service check billing --json
331
+ ```
332
+
333
+ The doctor reads `REMOTE_MODULES`, `.lenso/module-installs.json`, and
334
+ `.lenso/module-services.json`. It reports whether the service is
335
+ installed, configured, whether an HTTP manifest is reachable, whether managed
336
+ service `readyUrl` endpoints are ready, and which stale `.lock`/`.pid` files
337
+ may be blocking a host-started service.
338
+
339
+ Export declared service processes as a Compose fragment when handing the
340
+ service to deployment tooling:
145
341
 
146
342
  ```sh
147
- lenso module doctor
148
- lenso module doctor billing
343
+ lenso service export --module billing --format compose
149
344
  ```
150
345
 
151
- The doctor reads `REMOTE_MODULES` and `.lenso/module-services.json`, checks
152
- service `readyUrl` endpoints, and points to stale `.lock`/`.pid` files when a
153
- host-started service did not become ready.
346
+ If a manifest declares incompatible `compatibility` metadata, install stops
347
+ before writing host-local state. Use `--allow-incompatible` only when an
348
+ operator deliberately accepts that override.
154
349
 
155
- Remove the local remote-module source, install receipt, service state, Runtime
350
+ Remove the local service source, install receipt, service state, Runtime
156
351
  Console extension registry entry, and copied bundle files with:
157
352
 
158
353
  ```sh
159
- lenso module uninstall billing
354
+ lenso service uninstall billing-service
160
355
  ```
161
356
 
162
357
  Use `--source linked` only when you need to force the loading source. Prefer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenso/cli",
3
- "version": "0.1.24",
3
+ "version": "0.1.27",
4
4
  "description": "Lenso command-line interface for scaffolding and operating Lenso backend projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/LioRael/lenso-cli",
Binary file
Binary file
Binary file
Binary file