@@ -168,8 +168,207 @@ nix build .#logos-app-poc --override-input logos-cpp-sdk path:./repos/logos-cpp-
168168Available directly or as ` ws ` subcommands (e.g. ` lgx ` or ` ws lgx ` ).
169169Auto-build on first use, auto-rebuild when source files change. Only builds the specific binary, not the full repo.
170170
171- - ` lm ` (logos-module) — module inspector: ` lm metadata <plugin> ` , ` lm methods <plugin> `
172- - ` logoscore ` (logos-liblogos) — headless runtime: ` logoscore -m <dir> --load-modules <name> `
173- - ` lgx ` (logos-package) — package tool: ` lgx create ` , ` lgx add-variant ` , ` lgx list ` , ` lgx verify `
174- - ` lgpm ` (logos-package-manager-module) — package manager: ` lgpm install ` , ` lgpm search ` , ` lgpm list `
175- - ` logos-cpp-generator ` (logos-cpp-sdk) — SDK code generator from plugin metadata
171+ ### ` logoscore ` — headless module runtime (logos-liblogos)
172+
173+ Loads modules and optionally calls their methods. Essential for testing modules without the full GUI app.
174+
175+ ``` bash
176+ logoscore [options]
177+ -m, --modules-dir < path> Directory to scan for module plugins (repeatable)
178+ -l, --load-modules < mod1,mod2> Comma-separated modules to load (auto-resolves deps)
179+ -c, --call < module.method(args)> Call a method after loading (repeatable, sequential)
180+ -h, --help Show help
181+ --version Show version
182+ ```
183+
184+ Method call syntax for ` -c ` : ` module_name.method(arg1, arg2) `
185+ - Type auto-detection: ` true ` /` false ` → bool, ` 42 ` → int, ` 3.14 ` → double, else → string
186+ - ` @filename ` loads file content as the argument (e.g. ` @config.json ` )
187+ - 30-second timeout per call; exit code 1 on failure
188+
189+ ``` bash
190+ # Load a module (auto-resolves transitive dependencies)
191+ logoscore -m ./modules --load-modules my_module
192+
193+ # Load and call a method
194+ logoscore -m ./modules -l my_module -c " my_module.doSomething(hello)"
195+
196+ # Sequential calls with file parameter
197+ logoscore -m ./modules -l storage_module \
198+ -c " storage_module.init(@config.json)" \
199+ -c " storage_module.start()"
200+
201+ # Multiple modules (deps resolved automatically)
202+ logoscore -m ./modules -l waku_module,chat,my_module
203+ ```
204+
205+ ### ` lm ` — module inspector (logos-module)
206+
207+ Introspects compiled Qt plugin files to show metadata and method signatures.
208+
209+ ``` bash
210+ lm [command] < plugin-path> [options]
211+
212+ Commands:
213+ (none) Show both metadata and methods
214+ metadata Show plugin metadata only
215+ methods Show exposed Q_INVOKABLE methods only
216+
217+ Options:
218+ --json Output structured JSON (works with all commands)
219+ --debug Show Qt debug output during plugin loading
220+ -h, --help Show help
221+ -v, --version
222+ ```
223+
224+ ``` bash
225+ # Inspect a built module
226+ lm ./result/lib/my_module_plugin.so
227+ lm metadata ./result/lib/my_module_plugin.so
228+ lm methods ./result/lib/my_module_plugin.so --json
229+
230+ # JSON metadata output includes: name, version, description, author, type, dependencies
231+ # JSON methods output includes: name, signature, returnType, isInvokable, parameters[]
232+ ```
233+
234+ ### ` lgx ` — LGX package tool (logos-package)
235+
236+ Creates and manages ` .lgx ` packages (gzip tar archives with platform-specific variants).
237+
238+ ``` bash
239+ lgx < command> [options]
240+
241+ Commands:
242+ create < name> Create empty .lgx package
243+ add < pkg> -v < variant> -f < path> Add files to a variant (replaces if exists)
244+ --variant, -v < name> Variant name (e.g. linux-x86_64, darwin-arm64)
245+ --files, -f < path> File or directory to add
246+ --main, -m < relpath> Main entry point (required if --files is a directory)
247+ --yes, -y Skip confirmation prompts
248+ remove < pkg> -v < variant> Remove a variant
249+ extract < pkg> [-v < variant> ] [-o < dir> ] Extract variant(s)
250+ verify < pkg> Validate against LGX spec
251+ sign < pkg> (not yet implemented)
252+ publish < pkg> (not yet implemented)
253+ ` ` `
254+
255+ ` ` ` bash
256+ # Create and populate a package
257+ lgx create my_module
258+ lgx add my_module.lgx -v linux-x86_64 -f ./result/lib/my_module_plugin.so
259+ lgx add my_module.lgx -v darwin-arm64 -f ./result/lib/my_module_plugin.dylib
260+
261+ # Add a directory variant with main entry point
262+ lgx add my_module.lgx -v web -f ./dist --main index.js -y
263+
264+ # Inspect and verify
265+ lgx verify my_module.lgx
266+ lgx extract my_module.lgx -v linux-x86_64 -o ./extracted
267+ ` ` `
268+
269+ # ## `lgpm` — package manager (logos-package-manager-module)
270+
271+ Installs, searches, and manages module packages. Fetches from GitHub releases with automatic dependency resolution.
272+
273+ ` ` ` bash
274+ lgpm [global-options] < command> [options]
275+
276+ Global options:
277+ --modules-dir < path> Target directory for core modules
278+ --ui-plugins-dir < path> Target directory for UI plugins
279+ --release < tag> GitHub release tag (default: latest)
280+ --json Output JSON format
281+ -h, --help
282+
283+ Commands:
284+ search < query> Search packages by name/description
285+ list [--category < cat> ] [--installed] List packages
286+ info < package> Show package details
287+ categories List available categories
288+ install < pkg> [pkgs...] Install packages (resolves deps automatically)
289+ --file < path> Install from local .lgx file instead
290+ ` ` `
291+
292+ ` ` ` bash
293+ # Search and browse
294+ lgpm search waku
295+ lgpm list --installed
296+ lgpm list --category networking
297+ lgpm info my_module
298+
299+ # Install from registry (with automatic dep resolution)
300+ lgpm --modules-dir ./modules install my_module
301+
302+ # Install from local .lgx file
303+ lgpm --modules-dir ./modules install --file ./my_module.lgx
304+
305+ # Install specific release
306+ lgpm --modules-dir ./modules --release v2.0.0 install my_module
307+ ` ` `
308+
309+ # # Creating a new module
310+
311+ Scaffold, build, test, package — the full lifecycle:
312+
313+ ` ` ` bash
314+ # 1. Scaffold
315+ mkdir logos-my-module && cd logos-my-module
316+ nix flake init -t github:logos-co/logos-module-builder
317+ # Edit module.yaml (name, version, deps) and src/ files
318+ # For modules wrapping external C/C++ libs, use the #with-external-lib template instead
319+
320+ # 2. Build
321+ git init && git add -A # nix needs files tracked by git
322+ nix build # outputs: result/lib/<name>_plugin.so, result/include/
323+
324+ # 3. Inspect
325+ lm ./result/lib/my_module_plugin.so # metadata + methods
326+ lm methods ./result/lib/my_module_plugin.so --json # method signatures as JSON
327+
328+ # 4. Test with logoscore
329+ logoscore -m ./result/lib -l my_module -c " my_module.someMethod(arg)"
330+
331+ # 5. Package
332+ lgx create my_module
333+ lgx add my_module.lgx -v linux-x86_64 -f ./result/lib/my_module_plugin.so
334+ lgx verify my_module.lgx
335+
336+ # 6. Install locally
337+ lgpm --modules-dir ./test-modules install --file ./my_module.lgx
338+
339+ # 7. Run with other modules
340+ logoscore -m ./test-modules -l my_module -c " my_module.someMethod(test)"
341+ ` ` `
342+
343+ Key files in a module:
344+ - ` module.yaml` — name, version, type, category, dependencies, nix_packages, external_libraries, cmake settings
345+ - ` flake.nix` — ~ 15 lines, calls ` logos-module-builder.lib.mkLogosModule`
346+ - ` src/< name> _interface.h` — pure virtual interface (inherits ` PluginInterface` )
347+ - ` src/< name> _plugin.h` — ` Q_OBJECT` + ` Q_INVOKABLE` methods = public API
348+ - ` src/< name> _plugin.cpp` — implementation
349+ - ` CMakeLists.txt` — uses ` logos_module()` macro from LogosModule.cmake
350+
351+ Every ` Q_INVOKABLE` method is automatically discoverable by ` lm` , callable by ` logoscore -c` , and accessible from other modules via ` LogosAPI` .
352+
353+ # # Inter-module communication
354+
355+ Modules receive a ` LogosAPI* ` pointer via ` initLogos()` . Use it to call other modules:
356+
357+ ` ` ` cpp
358+ // Raw call
359+ LogosAPIClient* client = logosAPI-> getClient(" other_module" );
360+ QVariant result = client-> invokeRemoteMethod(" other_module" , " method" , arg1, arg2);
361+
362+ // Or use generated type-safe wrappers (from logos-cpp-generator):
363+ LogosModules* logos = new LogosModules(logosAPI);
364+ QString result = logos-> other_module.doSomething(" hello" );
365+ ` ` `
366+
367+ Return structured results with ` LogosResult` :
368+ ` ` ` cpp
369+ Q_INVOKABLE LogosResult fetchData(const QString& id) {
370+ if (id.isEmpty()) return {false, QVariant (), " ID cannot be empty" };
371+ QVariantMap data; data[" id" ] = id; data[" count" ] = 42;
372+ return {true, data};
373+ }
374+ ` ` `
0 commit comments