feat(cli): add chatlab web command for one-click Web UI launch

- New `chatlab web` subcommand: starts HTTP API + serves Web SPA + auto-opens browser
- Options: --port, --host, --no-open
- Cross-platform `openBrowser()` using open/start/xdg-open
- Add `setWebMode()` in auth: static resources bypass token auth in web mode
- Add `build:full` and `prepare:web` scripts for dist-web preparation
This commit is contained in:
digua committed 2026-05-19 21:53:00 +08:00
1 parent b1427e2422
commit 09d4b1ddac
4 files changed
+86 -3

No files matched your search

+2
View File
@@ -41,6 +41,8 @@
"scripts": {
"cli": "node scripts/ensure-native.mjs && tsx src/cli.ts",
"build": "tsup",
"build:full": "pnpm -w run build:web && pnpm run build && pnpm run prepare:web",
"prepare:web": "rm -rf dist-web && cp -r ../../dist-web dist-web",
"ensure-native": "node scripts/ensure-native.mjs",
"rebuild-native": "bash scripts/rebuild-native.sh",
"rebuild-sqlite": "npm rebuild better-sqlite3",