lianrouter 0.0.0-stage → 2.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 +95 -2
- package/dist/cli.js +3315 -0
- package/dist/tray.js +1274 -0
- package/package.json +41 -4
package/README.md
CHANGED
|
@@ -1,3 +1,96 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lianrouter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The LianRouter launcher. One command starts the gateway, opens its console,
|
|
4
|
+
keeps it running in the background, and updates it — without cloning the
|
|
5
|
+
repository.
|
|
6
|
+
|
|
7
|
+
LianRouter is a multi-provider gateway for OpenAI-compatible chat, embedding, and
|
|
8
|
+
image APIs: one local endpoint, many upstream providers, with routing, keys,
|
|
9
|
+
usage accounting, and an admin console. This package is only the **launcher**.
|
|
10
|
+
The gateway itself is a separate compiled binary that this package installs on
|
|
11
|
+
first run.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add -g lianrouter
|
|
17
|
+
# or
|
|
18
|
+
npm i -g lianrouter
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The bin runs under the Bun runtime and declares `engines.bun`, so Bun must be on
|
|
22
|
+
`PATH` whichever package manager put the launcher there.
|
|
23
|
+
|
|
24
|
+
## First run
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
lianrouter
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The launcher does **not** download anything during `bun add -g` / `npm i -g` —
|
|
31
|
+
an install that reaches the network breaks offline and CI installs. Instead, the
|
|
32
|
+
first `lianrouter` run finds no gateway in the install root, fetches the release
|
|
33
|
+
archive for your platform, verifies its sha256, and installs it atomically,
|
|
34
|
+
showing progress while it downloads:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
gateway not installed; fetching the latest release
|
|
38
|
+
downloading 42% 19.2 MB / 44.7 MB
|
|
39
|
+
verifying 78% checksum ok (sha256 0123456789ab…)
|
|
40
|
+
installing 90% installed lianrouter.exe
|
|
41
|
+
Gateway 2.0.0 installed at ~/.local/share/LianRouter/lianrouter
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
An archive without a published digest is refused rather than installed, and a
|
|
45
|
+
platform with no published build is told so by name instead of failing later at
|
|
46
|
+
spawn. The newest release for your platform is installed regardless of how its
|
|
47
|
+
version compares to the launcher's own, so a first release that shares the
|
|
48
|
+
launcher's version still installs. Every subsequent run finds the binary and
|
|
49
|
+
starts offline.
|
|
50
|
+
|
|
51
|
+
Installing the gateway is not the same as configuring it: the gateway still needs
|
|
52
|
+
`DATABASE_URL` (and `REDIS_URL` when `REDIS_MODE=normal`) in its environment or a
|
|
53
|
+
`.env` in its working directory before `/health` can answer. See
|
|
54
|
+
[`README.md`](https://github.com/ReXooGen/Lian-Router/blob/main/README.md) for the
|
|
55
|
+
variable list; a startup failure prints the gateway's own error line.
|
|
56
|
+
|
|
57
|
+
## Use
|
|
58
|
+
|
|
59
|
+
With no arguments, `lianrouter` starts the gateway and opens the menu — Web UI,
|
|
60
|
+
Terminal UI, Hide to Tray, Exit. Subcommands skip the menu:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
lianrouter start # start in the foreground, then the menu
|
|
64
|
+
lianrouter status # print state and exit
|
|
65
|
+
lianrouter stop # stop the supervised gateway
|
|
66
|
+
lianrouter update # check, install, restart
|
|
67
|
+
lianrouter tray # background gateway with a tray icon (Windows)
|
|
68
|
+
lianrouter tui # terminal console
|
|
69
|
+
lianrouter --version
|
|
70
|
+
lianrouter --help
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`status` and `stop` never install anything: they answer a question about the
|
|
74
|
+
current machine and must work offline. `--port`, `--host`, `--no-open`, and
|
|
75
|
+
`--background` cover the rest.
|
|
76
|
+
|
|
77
|
+
## Where things live
|
|
78
|
+
|
|
79
|
+
The gateway binary, `migrations/`, the console assets, the pid file, the log, and
|
|
80
|
+
the update cache all live under one install root:
|
|
81
|
+
|
|
82
|
+
| Platform | Root |
|
|
83
|
+
|---|---|
|
|
84
|
+
| Windows | `%LOCALAPPDATA%\LianRouter` |
|
|
85
|
+
| macOS | `~/Library/Application Support/LianRouter` |
|
|
86
|
+
| Linux | `$XDG_DATA_HOME/LianRouter`, else `~/.local/share/LianRouter` |
|
|
87
|
+
|
|
88
|
+
`LIANROUTER_HOME` relocates the whole layout. The gateway logs to
|
|
89
|
+
`<root>/logs/lianrouter.log`.
|
|
90
|
+
|
|
91
|
+
## Documentation
|
|
92
|
+
|
|
93
|
+
[`cli/CLI.md`](https://github.com/ReXooGen/Lian-Router/blob/main/cli/CLI.md)
|
|
94
|
+
covers the install root, the process model, the loopback control plane, the
|
|
95
|
+
update flow, the tray, and the TUI. Product documentation for the gateway itself
|
|
96
|
+
lives in the [repository](https://github.com/ReXooGen/Lian-Router).
|