@omochi-ui/cli 0.0.0-stage → 0.1.1
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 +202 -0
- package/README.md +278 -2
- package/bin/omochi-ui.js +2 -0
- package/dist/catalog-codegen.d.ts +9 -0
- package/dist/catalog-codegen.js +185 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +454 -0
- package/dist/help.d.ts +3 -0
- package/dist/help.js +187 -0
- package/dist/hub/dashboards.d.ts +17 -0
- package/dist/hub/dashboards.js +230 -0
- package/dist/hub/gateway-supervisor.d.ts +19 -0
- package/dist/hub/gateway-supervisor.js +75 -0
- package/dist/hub/hub.d.ts +41 -0
- package/dist/hub/hub.js +353 -0
- package/dist/hub/ssh-gateway.d.ts +16 -0
- package/dist/hub/ssh-gateway.js +110 -0
- package/dist/hub/static-ui.d.ts +2 -0
- package/dist/hub/static-ui.js +30 -0
- package/dist/stdio-websocket-bridge.d.ts +17 -0
- package/dist/stdio-websocket-bridge.js +78 -0
- package/dist/up.d.ts +21 -0
- package/dist/up.js +229 -0
- package/package.json +37 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,279 @@
|
|
|
1
|
-
#
|
|
1
|
+
# CLI reference
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[Overview](../../README.md) · [Architecture](../../docs/architecture.md) · [Discovery guide](../../docs/discovery.md)
|
|
4
|
+
|
|
5
|
+
Build the workspace with `bun install` and `bun run build`. Run commands from its
|
|
6
|
+
root using `bun run omochi-ui`; the binary is provided by `@omochi-ui/cli`; the TypeScript SDK is
|
|
7
|
+
`@omochi-ui/sdk`.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun run omochi-ui --help
|
|
11
|
+
bun run omochi-ui hub --help
|
|
12
|
+
bun run omochi-ui help generate catalog
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
No arguments prints the overview. `-h`, `--help`, and `help <command>` print help
|
|
16
|
+
to stdout and exit successfully without starting services or changing config.
|
|
17
|
+
Invalid arguments print usage to stderr and exit with code 2.
|
|
18
|
+
|
|
19
|
+
## Command map
|
|
20
|
+
|
|
21
|
+
| Task | Command | Browser UI included? |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| Start a project composition | `up [FILE]` | Yes; `--open` opens it automatically |
|
|
24
|
+
| Develop a single app | `dev -- <command> [args...]` | Start the Vite preview separately |
|
|
25
|
+
| Compose dashboards from running apps | `hub` | Yes |
|
|
26
|
+
| Publish this machine's running apps | `gateway` | No; connect a hub |
|
|
27
|
+
| Show or name this machine | `id` | No |
|
|
28
|
+
| Pair with a TCP gateway | `pair HOST:PORT` | No |
|
|
29
|
+
| Inspect or remove paired peers | `trust list`, `trust forget <nodeId>` | No |
|
|
30
|
+
| Generate SDK catalog types | `generate catalog` | No |
|
|
31
|
+
|
|
32
|
+
## up
|
|
33
|
+
|
|
34
|
+
Start local services, the hub, and a read-only dashboard preset from TOML.
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
bun run omochi-ui up --open
|
|
38
|
+
bun run omochi-ui up --port 5557 ./examples/quickstart/omochi.toml
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The file defaults to `./omochi.toml`. A service uses either a literal `command`
|
|
42
|
+
or an `omochi-utils` shorthand. Commands do not use a shell; relative working
|
|
43
|
+
directories are resolved from the composition file. Child services receive
|
|
44
|
+
`OMOCHI_SERVICE` and remain independent: one exiting leaves its panel unavailable
|
|
45
|
+
without stopping the others. Utility shorthand supports `button`, `watch`,
|
|
46
|
+
`process`, `tail`, and `http`. Stdio-owned `stream` and `mcp` processes stay
|
|
47
|
+
external; this lets an agent connect and disconnect independently of the preset.
|
|
48
|
+
|
|
49
|
+
```toml
|
|
50
|
+
version = 1
|
|
51
|
+
id = "local-development"
|
|
52
|
+
|
|
53
|
+
[services.health]
|
|
54
|
+
utility = ["http", "http://127.0.0.1:5173/"]
|
|
55
|
+
|
|
56
|
+
[services.app]
|
|
57
|
+
command = ["uv", "run", "app.py"]
|
|
58
|
+
cwd = "./backend"
|
|
59
|
+
|
|
60
|
+
[dashboard]
|
|
61
|
+
name = "Local development"
|
|
62
|
+
|
|
63
|
+
[[dashboard.rows]]
|
|
64
|
+
panels = ["health", "app"]
|
|
65
|
+
height = "medium"
|
|
66
|
+
|
|
67
|
+
[dashboard.panels.health]
|
|
68
|
+
title = "Health"
|
|
69
|
+
service = "health"
|
|
70
|
+
|
|
71
|
+
[dashboard.panels.app]
|
|
72
|
+
title = "Application"
|
|
73
|
+
service = "app"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Rows divide the twelve-column dashboard evenly. Heights are `small`, `medium`,
|
|
77
|
+
or `large`; a panel's surface defaults to `main`. Presets do not modify saved
|
|
78
|
+
dashboard storage. Use **Save as dashboard** in the hub to make an editable copy.
|
|
79
|
+
Ctrl+C stops only the services and gateway started by this command.
|
|
80
|
+
|
|
81
|
+
| Option | Meaning | Default |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `--host HOST` | Hub bind address | `127.0.0.1` |
|
|
84
|
+
| `--port PORT` | Hub port; `0` chooses an available port | `5555` |
|
|
85
|
+
| `--allow-origin ORIGIN` | Add an exact browser origin; repeatable | Loopback origins only |
|
|
86
|
+
| `--open` | Open the selected preset in the desktop browser | Off |
|
|
87
|
+
|
|
88
|
+
## dev
|
|
89
|
+
|
|
90
|
+
Launch a child application and bridge its JSONL stdin/stdout to WebSocket.
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
# Terminal 1: browser preview
|
|
94
|
+
bun run --filter @omochi-ui/dev-server dev
|
|
95
|
+
# Terminal 2: app + bridge
|
|
96
|
+
bun run omochi-ui dev -- uv run --project examples/python examples/python/app.py
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Open `http://127.0.0.1:5173/`. The preview's default `/ws` proxy reaches the bridge.
|
|
100
|
+
All arguments after `--` belong to the child, including any `--help` flag.
|
|
101
|
+
Application logging must go to stderr; stdout is reserved for A2UI JSONL.
|
|
102
|
+
|
|
103
|
+
| Option | Meaning | Default |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| `--host HOST` | Bridge bind address | `127.0.0.1` |
|
|
106
|
+
| `--port PORT` | Bridge port; `0` chooses an available port | `5555` |
|
|
107
|
+
|
|
108
|
+
The bridge serves WebSocket at `/ws`; it does not serve an HTML page. Startup
|
|
109
|
+
prints a preview URL with `?ws=` for its actual address. The preview must already
|
|
110
|
+
be running; use its printed port if Vite selected one other than 5173.
|
|
111
|
+
All clients share application state, and late clients receive a current snapshot.
|
|
112
|
+
The bridge has no authentication or TLS; keep the loopback default.
|
|
113
|
+
|
|
114
|
+
## hub
|
|
115
|
+
|
|
116
|
+
Serve the dashboard UI, discover available surfaces, and route browser actions.
|
|
117
|
+
Apps must already be running with `UnixSocketServerTransport`. The bundled
|
|
118
|
+
examples select that transport when `OMOCHI_SERVICE` is set.
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
# Terminal 1
|
|
122
|
+
OMOCHI_SERVICE=python-example uv run --project examples/python examples/python/app.py
|
|
123
|
+
# Terminal 2
|
|
124
|
+
bun run omochi-ui hub
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Open `http://127.0.0.1:5555/`. The hub serves its own UI and automatically starts
|
|
128
|
+
a local gateway when none is listening. It reuses an existing gateway and does
|
|
129
|
+
not stop a gateway it did not start.
|
|
130
|
+
|
|
131
|
+
| Option | Meaning | Default |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| `--host HOST` | HTTP/WebSocket bind address | `127.0.0.1` |
|
|
134
|
+
| `--port PORT` | HTTP/WebSocket port; `0` chooses an available port | `5555` |
|
|
135
|
+
| `--gateway TARGET` | Unix socket path or `<nodeId>@HOST:PORT`; repeatable | Local gateway |
|
|
136
|
+
| `--ssh HOST` | SSH hostname, alias, or `user@host`; one target | Off |
|
|
137
|
+
| `--ssh-socket PATH` | Remote gateway socket override; requires `--ssh` | Resolved through SSH |
|
|
138
|
+
| `--no-auto-gateway` | Do not start a missing local gateway | Auto-start enabled |
|
|
139
|
+
| `--discover-lan` | Also look for paired gateways via mDNS | Off |
|
|
140
|
+
| `--allow-origin ORIGIN` | Add an exact allowed browser origin; repeatable | Loopback origins only |
|
|
141
|
+
|
|
142
|
+
Explicit `--gateway` or `--ssh` targets replace the default local gateway. Add
|
|
143
|
+
`--gateway /path/to/local/gateway.sock` to include it too. Explicit targets can
|
|
144
|
+
be combined with `--discover-lan`. A TCP target needs its paired node ID; a Unix
|
|
145
|
+
socket or SSH target does not need pairing.
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
# Remote machine: gateway and apps must already be running
|
|
149
|
+
bun run omochi-ui gateway
|
|
150
|
+
# Local machine: SSH authenticates and forwards the remote gateway socket
|
|
151
|
+
bun run omochi-ui hub --ssh user@remote
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The hub has no authentication or TLS on its browser-facing listener. Keep its
|
|
155
|
+
loopback binding. See [SSH setup](../../docs/discovery.md#connecting-through-ssh)
|
|
156
|
+
for requirements and cleanup behavior.
|
|
157
|
+
|
|
158
|
+
## gateway
|
|
159
|
+
|
|
160
|
+
Discover the current user's apps and publish their surfaces. A gateway does not
|
|
161
|
+
launch apps or serve the dashboard UI. It normally listens only on a Unix socket.
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
bun run omochi-ui gateway
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
| Option | Meaning | Default |
|
|
168
|
+
| --- | --- | --- |
|
|
169
|
+
| `--root DIR` | Directory containing service manifests and sockets | `$XDG_RUNTIME_DIR/omochi` |
|
|
170
|
+
| `--socket PATH` | Gateway Unix socket | `<root>/gateway.sock` |
|
|
171
|
+
| `--node-name NAME` | Persist this machine's display name | Existing name or hostname |
|
|
172
|
+
| `--listen HOST:PORT` | Enable the TLS TCP listener | Off |
|
|
173
|
+
| `--advertise` | Advertise over mDNS; requires a TCP listener | Off |
|
|
174
|
+
| `--pair` | Open a one-time pairing window; requires a TCP listener | Off |
|
|
175
|
+
| `--lan` | `--listen 0.0.0.0:5556 --advertise` | Off |
|
|
176
|
+
|
|
177
|
+
If `XDG_RUNTIME_DIR` is unset, the registry uses
|
|
178
|
+
`<system temporary directory>/omochi-<uid>/omochi`. Apps and gateways must use the
|
|
179
|
+
same runtime directory. See [Service discovery](../../docs/discovery.md) for the
|
|
180
|
+
manifest format and SDK transport examples.
|
|
181
|
+
|
|
182
|
+
Network reachability, advertisement, and trust are separate. `--listen` enables
|
|
183
|
+
the paired TLS listener; mDNS only advertises its location. Neither allows an
|
|
184
|
+
unpaired hub to read application data.
|
|
185
|
+
|
|
186
|
+
## pair
|
|
187
|
+
|
|
188
|
+
Pair once before connecting a hub to a gateway over TCP. SSH does not require this.
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
# Machine running the apps: open a TCP listener and pairing window
|
|
192
|
+
bun run omochi-ui gateway --lan --pair
|
|
193
|
+
# Machine running the hub: enter the code printed by the gateway
|
|
194
|
+
bun run omochi-ui pair 192.168.1.42:42317 # use the random pairing port printed above
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`pair HOST:PORT` reads the code from stdin. `--code CODE` supplies it explicitly;
|
|
198
|
+
stdin keeps it out of shell history. The window lasts three minutes, permits
|
|
199
|
+
five exchange attempts, and closes after one successful pairing. Its dedicated HTTPS
|
|
200
|
+
listener uses a random port and exposes no application API. Normal connections use
|
|
201
|
+
mutual TLS with pinned device certificates; legacy PSK peers must pair again.
|
|
202
|
+
|
|
203
|
+
After success, run the printed `hub --gateway <nodeId>@HOST:PORT` command, prefixed
|
|
204
|
+
with `bun run` in a source checkout. Alternatively, use `hub --discover-lan`
|
|
205
|
+
when the gateway advertises on the same local network. mDNS generally does not
|
|
206
|
+
cross VLANs or VPNs.
|
|
207
|
+
|
|
208
|
+
## id and trust
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
bun run omochi-ui id
|
|
212
|
+
bun run omochi-ui id --node-name workstation
|
|
213
|
+
bun run omochi-ui trust list
|
|
214
|
+
bun run omochi-ui trust forget NODE_ID
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
`id` creates a persistent identity on first use and prints its node ID and name.
|
|
218
|
+
Changing the name preserves the ID. `trust list` prints peer IDs, roles, names,
|
|
219
|
+
and pairing times. `trust forget` removes the local peer entry and waits for running local processes
|
|
220
|
+
to close affected connections before reporting success; it returns code
|
|
221
|
+
1 when the peer does not exist. Pair again to establish trust after removal.
|
|
222
|
+
|
|
223
|
+
## generate catalog
|
|
224
|
+
|
|
225
|
+
Generate typed bindings from a local A2UI v0.9 catalog for any subset of SDKs.
|
|
226
|
+
Create output directories before running the command.
|
|
227
|
+
|
|
228
|
+
```sh
|
|
229
|
+
mkdir -p generated
|
|
230
|
+
bun run omochi-ui generate catalog \
|
|
231
|
+
--catalog ./catalog.json \
|
|
232
|
+
--name ProductCatalog \
|
|
233
|
+
--typescript ./generated/product-catalog.ts \
|
|
234
|
+
--python ./generated/product_catalog.py \
|
|
235
|
+
--rust ./generated/product_catalog.rs
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
| Option | Meaning |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| `--catalog FILE` | Required catalog JSON input |
|
|
241
|
+
| `--name NAME` | Type name; defaults to catalog title or `GeneratedCatalog` |
|
|
242
|
+
| `--typescript FILE` | TypeScript output |
|
|
243
|
+
| `--python FILE` | Python output |
|
|
244
|
+
| `--rust FILE` | Rust output |
|
|
245
|
+
| `--check` | Check outputs without writing; fail if missing or stale |
|
|
246
|
+
|
|
247
|
+
At least one output flag is required. Generation resolves local schemas only;
|
|
248
|
+
it does not fetch schemas over the network. Reuse the same invocation with
|
|
249
|
+
`--check` in CI.
|
|
250
|
+
|
|
251
|
+
## Ports and storage
|
|
252
|
+
|
|
253
|
+
| Resource | Default |
|
|
254
|
+
| --- | --- |
|
|
255
|
+
| Vite browser preview | `http://127.0.0.1:5173/` |
|
|
256
|
+
| Development bridge | `ws://127.0.0.1:5555/ws` |
|
|
257
|
+
| Hub UI / A2UI | `http://127.0.0.1:5555/` / `ws://127.0.0.1:5555/ws` |
|
|
258
|
+
| Gateway Unix socket | `$XDG_RUNTIME_DIR/omochi/gateway.sock` (fallback above) |
|
|
259
|
+
| Gateway TCP with `--lan` | `0.0.0.0:5556` (paired TLS) |
|
|
260
|
+
| Node identity and peers | `$XDG_CONFIG_HOME/omochi/{node,peers}.json` |
|
|
261
|
+
| Saved dashboards | `$XDG_CONFIG_HOME/omochi/dashboards.json` |
|
|
262
|
+
|
|
263
|
+
`XDG_CONFIG_HOME` defaults to `~/.config`. Runtime directories and configuration
|
|
264
|
+
are per-user; identity and trust persist across restarts. Dashboard files store
|
|
265
|
+
names, surface references, and layouts, not app state.
|
|
266
|
+
|
|
267
|
+
## Troubleshooting
|
|
268
|
+
|
|
269
|
+
| Symptom | What to check |
|
|
270
|
+
| --- | --- |
|
|
271
|
+
| `dev` starts but there is no page | Start `bun run --filter @omochi-ui/dev-server dev` and open its URL, not port 5555 |
|
|
272
|
+
| Preview says disconnected | Start the bridge; with a custom port, use the printed `?ws=` URL |
|
|
273
|
+
| Address already in use | `dev` and `hub` share default port 5555; stop one or set `--port 5557` |
|
|
274
|
+
| Vite uses a port other than 5173 | Use Vite's printed URL, adding the bridge's `?ws=` parameter if needed |
|
|
275
|
+
| Hub has no apps | Run an app with `OMOCHI_SERVICE` set and the same user/runtime directory |
|
|
276
|
+
| Hub loses the local apps when using SSH | Explicit targets replace the local default; add the local socket with `--gateway` |
|
|
277
|
+
| Pairing/advertising requires a listener | Use `gateway --lan --pair` or provide `--listen HOST:PORT` |
|
|
278
|
+
| Remote gateway is not found | Check that it is running; use SSH or an explicit paired TCP target when multicast is unavailable |
|
|
279
|
+
| Command or build output is missing | Run `bun install` and `bun run build` from the repository root |
|
package/bin/omochi-ui.js
ADDED