22
33Use this when you want to open OK Code from another device (phone, tablet, another laptop).
44
5+ The web client supports direct browser access. The native mobile shell in ` apps/mobile ` uses the
6+ same server, but stores the auth token locally and pairs through a deep link instead of keeping the
7+ token in the browser URL.
8+
59## CLI ↔ Env option map
610
711The OK Code CLI accepts the following configuration options, available either as CLI flags or environment variables:
@@ -38,9 +42,21 @@ Then open on your phone:
3842
3943` http://<your-machine-ip>:3773 `
4044
45+ To force the mobile companion layout during dogfooding, append:
46+
47+ ` ?client=mobile `
48+
4149Example:
4250
43- ` http://192.168.1.42:3773 `
51+ ` http://192.168.1.42:3773?client=mobile `
52+
53+ To pair the native mobile app, construct a deep link using the same server URL and token:
54+
55+ ` okcode://pair?server=http%3A%2F%2F192.168.1.42%3A3773&token=<token> `
56+
57+ The app also accepts a plain server URL that includes the token as a query parameter:
58+
59+ ` http://192.168.1.42:3773?token=<token> `
4460
4561Notes:
4662
@@ -62,4 +78,27 @@ Open from any device in your tailnet:
6278
6379` http://<tailnet-ip>:3773 `
6480
81+ You can also append ` ?client=mobile ` to force the companion layout.
82+
83+ Native-app pairing uses the same deep-link format:
84+
85+ ` okcode://pair?server=http%3A%2F%2F<tailnet-ip>%3A3773&token=<token> `
86+
6587You can also bind ` --host 0.0.0.0 ` and connect through the Tailnet IP, but binding directly to the Tailnet IP limits exposure.
88+
89+ ## 3) Build the native mobile shell
90+
91+ The mobile shell wraps the built ` apps/web ` companion experience with a Capacitor runtime and a
92+ native pairing bridge.
93+
94+ ``` bash
95+ bun run --cwd apps/mobile build
96+ bun run --cwd apps/mobile sync
97+ ```
98+
99+ Then open the generated projects:
100+
101+ ``` bash
102+ bun run --cwd apps/mobile open:ios
103+ bun run --cwd apps/mobile open:android
104+ ```
0 commit comments