overmux 0.0.5 → 0.0.6
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/CHANGELOG.md +9 -0
- package/README.md +16 -2
- package/dist/docs/200-getting-started/500-set-up-overmux-with-packages.md +42 -0
- package/dist/docs/400-reference/200-configuration.md +1 -1
- package/dist/docs/400-reference/500-server/500-api.md +1 -1
- package/dist/docs/400-reference/600-client/005-setting-up-your-ui.md +137 -0
- package/dist/docs/400-reference/600-client/007-deep-links.md +87 -0
- package/dist/docs/400-reference/600-client/010-commands.md +189 -0
- package/dist/docs/400-reference/600-client/020-shortcuts.md +171 -0
- package/dist/docs/400-reference/600-client/100-api.md +1 -1
- package/dist/docs/400-reference/600-client/200-theming.md +179 -64
- package/docs/200-getting-started/500-set-up-overmux-with-packages.md +42 -0
- package/docs/400-reference/200-configuration.md +1 -1
- package/docs/400-reference/500-server/500-api.md +1 -1
- package/docs/400-reference/600-client/005-setting-up-your-ui.md +137 -0
- package/docs/400-reference/600-client/007-deep-links.md +87 -0
- package/docs/400-reference/600-client/010-commands.md +189 -0
- package/docs/400-reference/600-client/020-shortcuts.md +171 -0
- package/docs/400-reference/600-client/100-api.md +1 -1
- package/docs/400-reference/600-client/200-theming.md +179 -64
- package/package.json +2 -2
|
@@ -2,93 +2,208 @@
|
|
|
2
2
|
title: Theming and CSS
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Your
|
|
5
|
+
Your Overmux UI owns its CSS. Overmux provides shared theme variables, light/dark defaults, and theme scopes for individual sections.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Load your CSS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Import your stylesheet from your browser entry point:
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
```tsx
|
|
12
|
+
import { OvermuxHost } from "overmux/client";
|
|
13
|
+
import { createRoot } from "react-dom/client";
|
|
14
|
+
|
|
15
|
+
import definition from "./app";
|
|
16
|
+
import "./styles.css";
|
|
17
|
+
|
|
18
|
+
createRoot(document.getElementById("root")!).render(
|
|
19
|
+
<OvermuxHost definition={definition} />,
|
|
20
|
+
);
|
|
21
|
+
```
|
|
15
22
|
|
|
16
|
-
|
|
23
|
+
Overmux components load their own styles automatically. Use ordinary CSS and component `className` props to customize them. Overmux defaults use CSS layers, so normal unlayered application styles take precedence.
|
|
17
24
|
|
|
18
|
-
##
|
|
25
|
+
## Choose light or dark
|
|
19
26
|
|
|
20
|
-
Set
|
|
27
|
+
Set appearance in your client definition:
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| `--om-font-sans` | Font-family list | Interface text |
|
|
35
|
-
| `--om-font-mono` | Font-family list | Code and diagnostics |
|
|
36
|
-
| `--om-spacing` | Length | Spacing unit; components may scale it |
|
|
37
|
-
| `--om-radius` | Length | Corner radius; components may scale it |
|
|
38
|
-
| `--om-elevation` | Box-shadow | Panel and popover shadows |
|
|
39
|
-
| `--om-focus-ring` | Box-shadow | Focus-ring shadows |
|
|
40
|
-
| `--om-motion-duration` | Time | Transition duration |
|
|
29
|
+
```tsx
|
|
30
|
+
import { defineOvermuxClient } from "overmux/client";
|
|
31
|
+
|
|
32
|
+
export default defineOvermuxClient({
|
|
33
|
+
commands: {},
|
|
34
|
+
component: App,
|
|
35
|
+
appearance: {
|
|
36
|
+
scheme: "dark",
|
|
37
|
+
contrast: "auto",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
- `scheme`: `"system"` (default), `"light"`, or `"dark"`.
|
|
43
|
+
- `contrast`: `"auto"` (default), `"normal"`, or `"high"`.
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
`"system"` follows the system color preference. `"auto"` follows the system preference for increased contrast.
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
Appearance applies to your app and Overmux-owned UI inside `OvermuxHost`. It changes built-in defaults, not custom CSS variables.
|
|
48
|
+
|
|
49
|
+
## Set colors, fonts, and other theme variables
|
|
50
|
+
|
|
51
|
+
Define shared variables in your stylesheet. This example supplies a custom dark palette and every shared theme variable:
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
:root {
|
|
55
|
+
--om-color-canvas: #111318;
|
|
56
|
+
--om-color-surface: #191c24;
|
|
57
|
+
--om-color-panel: #222735;
|
|
58
|
+
--om-color-fg: #eef0f6;
|
|
59
|
+
--om-color-muted: #a3adc2;
|
|
60
|
+
--om-color-border: #394156;
|
|
61
|
+
--om-color-accent: #b59aff;
|
|
62
|
+
--om-color-accent-fg: #111318;
|
|
63
|
+
--om-color-danger: #ff8b82;
|
|
64
|
+
--om-color-success: #65d6a2;
|
|
65
|
+
|
|
66
|
+
--om-font-sans: "Inter", sans-serif;
|
|
67
|
+
--om-font-mono: "JetBrains Mono", monospace;
|
|
68
|
+
|
|
69
|
+
--om-spacing: 0.75rem;
|
|
70
|
+
--om-radius: 0.5rem;
|
|
71
|
+
--om-elevation: 0 0.75rem 2rem rgb(0 0 0 / 30%);
|
|
72
|
+
--om-focus-ring: 0 0 0 3px rgb(181 154 255 / 30%);
|
|
73
|
+
--om-motion-duration: 120ms;
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Colors
|
|
78
|
+
|
|
79
|
+
- `--om-color-canvas`: page background.
|
|
80
|
+
- `--om-color-surface`: content surface background.
|
|
81
|
+
- `--om-color-panel`: panel and grouped-content background.
|
|
82
|
+
- `--om-color-fg`: primary text.
|
|
83
|
+
- `--om-color-muted`: secondary text.
|
|
84
|
+
- `--om-color-border`: borders and separators.
|
|
85
|
+
- `--om-color-accent`: highlighted controls and actions.
|
|
86
|
+
- `--om-color-accent-fg`: text on an accent background.
|
|
87
|
+
- `--om-color-danger`: errors and destructive states.
|
|
88
|
+
- `--om-color-success`: success states.
|
|
89
|
+
|
|
90
|
+
### Fonts
|
|
91
|
+
|
|
92
|
+
- `--om-font-sans`: interface font family.
|
|
93
|
+
- `--om-font-mono`: monospace font family.
|
|
94
|
+
|
|
95
|
+
Load custom fonts yourself; these variables only select them.
|
|
96
|
+
|
|
97
|
+
#### Loading custom fonts
|
|
98
|
+
|
|
99
|
+
Load fonts with `@font-face`, then reference their family names in your theme variables:
|
|
100
|
+
|
|
101
|
+
```css
|
|
102
|
+
@font-face {
|
|
103
|
+
font-family: "My Font";
|
|
104
|
+
src: url("./fonts/my-font.woff2") format("woff2");
|
|
105
|
+
font-display: swap;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:root {
|
|
109
|
+
--om-font-sans: "My Font", sans-serif;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For a monospace font, use the same approach with `--om-font-mono`.
|
|
114
|
+
|
|
115
|
+
### Spacing and effects
|
|
116
|
+
|
|
117
|
+
- `--om-spacing`: base spacing used by components.
|
|
118
|
+
- `--om-radius`: base corner radius.
|
|
119
|
+
- `--om-elevation`: elevated-surface box shadow.
|
|
120
|
+
- `--om-focus-ring`: additional focus box shadow.
|
|
121
|
+
- `--om-motion-duration`: transition duration.
|
|
122
|
+
|
|
123
|
+
Components decide which variables they use.
|
|
124
|
+
|
|
125
|
+
### Applying your theme
|
|
126
|
+
|
|
127
|
+
Variables on `:root` reach both your application and Overmux-owned UI, including recovery, update, and settings screens. The separate login screen does not load userland CSS.
|
|
128
|
+
|
|
129
|
+
Use the same variables in your own components:
|
|
130
|
+
|
|
131
|
+
```css
|
|
132
|
+
body {
|
|
133
|
+
margin: 0;
|
|
134
|
+
background: var(--om-color-canvas);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.panel {
|
|
138
|
+
color: var(--om-color-fg);
|
|
139
|
+
background: var(--om-color-surface);
|
|
140
|
+
border: 1px solid var(--om-color-border);
|
|
141
|
+
border-radius: var(--om-radius);
|
|
142
|
+
padding: var(--om-spacing);
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Overmux does not paint your application's page background for you.
|
|
147
|
+
|
|
148
|
+
Public `--om-*` variables are override inputs: Overmux does not populate them with its built-in palette. Define them before using them in your own CSS, or supply CSS fallbacks.
|
|
149
|
+
|
|
150
|
+
Custom values remain in effect when `scheme` changes. If you supply a custom palette, you also own its light/dark variants and any saved theme preference.
|
|
151
|
+
|
|
152
|
+
## Theme one section
|
|
153
|
+
|
|
154
|
+
Wrap a section in `OvermuxThemeScope`:
|
|
47
155
|
|
|
48
156
|
```tsx
|
|
49
|
-
|
|
157
|
+
import { OvermuxThemeScope } from "overmux/client";
|
|
158
|
+
|
|
159
|
+
<OvermuxThemeScope
|
|
160
|
+
scheme="light"
|
|
161
|
+
contrast="normal"
|
|
162
|
+
className="preview"
|
|
163
|
+
style={{ "--om-color-accent": "rebeccapurple" }}
|
|
164
|
+
>
|
|
50
165
|
<Preview />
|
|
51
|
-
</OvermuxThemeScope
|
|
166
|
+
</OvermuxThemeScope>;
|
|
52
167
|
```
|
|
53
168
|
|
|
54
|
-
|
|
55
|
-
| --- | --- | --- |
|
|
56
|
-
| `children` | `ReactNode` | Required |
|
|
57
|
-
| `scheme` | `OvermuxScheme` | `"system"` |
|
|
58
|
-
| `contrast` | `OvermuxContrast` | `"auto"` |
|
|
59
|
-
| `className` | `string` | Unset |
|
|
60
|
-
| `style` | `OvermuxStyle` | Unset |
|
|
169
|
+
The scope renders a wrapper `<div>` and applies appearance to its contents.
|
|
61
170
|
|
|
62
|
-
|
|
171
|
+
Custom CSS variables inherit normally. A light scope inside a custom dark palette will still inherit those custom colors unless you override them.
|
|
63
172
|
|
|
64
|
-
|
|
173
|
+
`OvermuxHost` already creates an application-wide scope. A scope inside your app affects only that section, not surrounding Overmux-owned UI.
|
|
65
174
|
|
|
66
|
-
##
|
|
175
|
+
## Keep overlays themed
|
|
67
176
|
|
|
68
|
-
|
|
177
|
+
Use `OvermuxPortal` for menus, dialogs, and other overlays:
|
|
69
178
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
179
|
+
```tsx
|
|
180
|
+
import { OvermuxPortal, OvermuxThemeScope } from "overmux/client";
|
|
181
|
+
|
|
182
|
+
<OvermuxThemeScope scheme="dark">
|
|
183
|
+
<Editor />
|
|
184
|
+
<OvermuxPortal>
|
|
185
|
+
<EditorMenu />
|
|
186
|
+
</OvermuxPortal>
|
|
187
|
+
</OvermuxThemeScope>;
|
|
188
|
+
```
|
|
76
189
|
|
|
77
|
-
The overlay
|
|
190
|
+
The overlay renders inside the nearest theme scope, preserving its appearance and inherited variables.
|
|
78
191
|
|
|
79
|
-
|
|
192
|
+
If you supply an external container, you own its theme attributes and CSS variables:
|
|
80
193
|
|
|
81
|
-
|
|
194
|
+
```tsx
|
|
195
|
+
<OvermuxPortal
|
|
196
|
+
external={{
|
|
197
|
+
container: overlayElement,
|
|
198
|
+
scopeAttributesAndVariables: "caller-owned",
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
<EditorMenu />
|
|
202
|
+
</OvermuxPortal>;
|
|
203
|
+
```
|
|
82
204
|
|
|
83
|
-
|
|
205
|
+
## Packages
|
|
84
206
|
|
|
85
|
-
|
|
86
|
-
| --- | --- | --- |
|
|
87
|
-
| Runtime host UI | Theme tokens where consumed | Client `appearance` |
|
|
88
|
-
| UI split views | Border and accent tokens | App owns pane contents |
|
|
89
|
-
| Git React UI | Colors, fonts, spacing, radius | Diff options and themes; `registerGitDiffTheme` registers custom themes |
|
|
90
|
-
| Pi React UI | Colors, fonts, spacing, radius, elevation | Code highlighting uses Tokyo Night |
|
|
91
|
-
| xterm | Wrapper background: `--om-xterm-terminal-background` | `options.theme` for terminal colors; options such as `fontFamily` for fonts |
|
|
92
|
-
| tmux / Zellij terminal wrappers | xterm wrapper styles | Forwarded xterm props |
|
|
207
|
+
Packages use shared `--om-*` variables where applicable. They may also expose additional CSS variables, `className`, `classNames`, or other styling props.
|
|
93
208
|
|
|
94
|
-
|
|
209
|
+
Some rendered content has separate theme options rather than inheriting CSS colors. See each package's documentation for its styling controls.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Set Up with Packages
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
To understand how Overmux works and how to configure your Overmux, start with the [reference docs](/docs/reference/project-structure). They cover your project structure, configuration, server, and browser UI.
|
|
6
|
+
|
|
7
|
+
To get the most out of Overmux you'll want to use some packages.
|
|
8
|
+
|
|
9
|
+
## What are packages?
|
|
10
|
+
|
|
11
|
+
Packages are building blocks for your Overmux. They can provide server functionality, UI components, or both.
|
|
12
|
+
|
|
13
|
+
Overmux packages are just standard npm packages you install and use in your Overmux project.
|
|
14
|
+
|
|
15
|
+
## Packages to start with
|
|
16
|
+
|
|
17
|
+
### Terminals with xterm and tmux
|
|
18
|
+
|
|
19
|
+
Use these two packages together to add interactive terminals backed by persistent tmux sessions.
|
|
20
|
+
|
|
21
|
+
- **[tmux](/docs/packages/tmux)** connects your Overmux to your machine's tmux sessions, windows, and panes. It provides live state, terminal streaming, and operations for controlling tmux, along with React components and hooks for your UI.
|
|
22
|
+
- **[xterm](/docs/packages/xterm)** renders an [xterm.js](https://xtermjs.org/) terminal in your browser. It handles terminal display and input, but doesn't start a shell or manage sessions.
|
|
23
|
+
|
|
24
|
+
Together, they let you interact with your terminals through Overmux UI while tmux keeps your sessions running when you disconnect.
|
|
25
|
+
|
|
26
|
+
Follow the package docs for installation and wiring examples.
|
|
27
|
+
|
|
28
|
+
### Source control with git
|
|
29
|
+
|
|
30
|
+
The **[git package](/docs/packages/git)** adds repository changes and diffs to your Overmux, with ready-made UI components for browsing them.
|
|
31
|
+
|
|
32
|
+
You choose which repository paths your server can access. You can also enable actions such as staging, unstaging, and discarding changes; write permissions are off by default.
|
|
33
|
+
|
|
34
|
+
## Explore more packages
|
|
35
|
+
|
|
36
|
+
Depending on your setup, you might also want:
|
|
37
|
+
|
|
38
|
+
- **[Zellij](/docs/packages/zellij)** for a Zellij-backed terminal setup instead of tmux. Experimental; compatibility is not guaranteed.
|
|
39
|
+
- **[Pi](/docs/packages/pi)** for viewing AI agent conversations and interacting with running agents. Experimental; compatibility is not guaranteed.
|
|
40
|
+
- **[JSONL store](/docs/packages/jsonl-store)** for storing schema-validated records in a local file.
|
|
41
|
+
|
|
42
|
+
Start with the pieces you need. Each package's documentation explains what it provides and how to connect it to your Overmux.
|
|
@@ -111,7 +111,7 @@ IDs must be 1-253 lowercase ASCII characters, start and end with a letter or dig
|
|
|
111
111
|
|
|
112
112
|
An ID function runs once at startup using the actual listening port. Every address serving the same running instance reports the same ID. Distinct instances need distinct IDs; IDs are not credentials.
|
|
113
113
|
|
|
114
|
-
See [Deep
|
|
114
|
+
See [Deep links](./600-client/007-deep-links.md) and [`overmux instance`](/docs/reference/cli/instance).
|
|
115
115
|
|
|
116
116
|
### `vite`
|
|
117
117
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Setting up your UI
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Your Overmux UI is a React application served and built with Vite. You own its layout, components, and styles; `OvermuxHost` provides the runtime for Overmux’s client APIs.
|
|
6
|
+
|
|
7
|
+
Run `overmux init` to generate a starter project with the UI setup below.
|
|
8
|
+
|
|
9
|
+
## File layout
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
overmux.config.ts
|
|
13
|
+
vite.config.ts
|
|
14
|
+
src/ui/
|
|
15
|
+
index.html
|
|
16
|
+
main.tsx
|
|
17
|
+
app.tsx
|
|
18
|
+
styles.css
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Configure Vite
|
|
22
|
+
|
|
23
|
+
Set your UI directory as Vite’s root and enable React:
|
|
24
|
+
|
|
25
|
+
```ts title="vite.config.ts"
|
|
26
|
+
import react from "@vitejs/plugin-react";
|
|
27
|
+
import { defineConfig } from "vite";
|
|
28
|
+
|
|
29
|
+
export default defineConfig({
|
|
30
|
+
root: "src/ui",
|
|
31
|
+
plugins: [react()],
|
|
32
|
+
build: {
|
|
33
|
+
emptyOutDir: true,
|
|
34
|
+
outDir: "../../dist",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Point your Overmux configuration at this file, keeping your existing server and authentication settings:
|
|
40
|
+
|
|
41
|
+
```ts title="overmux.config.ts"
|
|
42
|
+
import { defineOvermuxConfig } from "overmux";
|
|
43
|
+
import server from "./src/server/index";
|
|
44
|
+
|
|
45
|
+
export default defineOvermuxConfig({
|
|
46
|
+
server,
|
|
47
|
+
auth: { mode: "cli-login" },
|
|
48
|
+
vite: "./vite.config.ts",
|
|
49
|
+
productionWebAssetsDir: "./dist",
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Vite’s output directory is relative to its UI root; `productionWebAssetsDir` points to the same directory from your Overmux configuration.
|
|
54
|
+
|
|
55
|
+
## The HTML entry point
|
|
56
|
+
|
|
57
|
+
Provide a root element and load your React entry point:
|
|
58
|
+
|
|
59
|
+
```html title="src/ui/index.html"
|
|
60
|
+
<!doctype html>
|
|
61
|
+
<html lang="en">
|
|
62
|
+
<head>
|
|
63
|
+
<meta charset="UTF-8" />
|
|
64
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
65
|
+
<title>My Overmux</title>
|
|
66
|
+
</head>
|
|
67
|
+
<body>
|
|
68
|
+
<div id="root"></div>
|
|
69
|
+
<script type="module" src="/main.tsx"></script>
|
|
70
|
+
</body>
|
|
71
|
+
</html>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Mount OvermuxHost
|
|
75
|
+
|
|
76
|
+
Mount your client definition inside `OvermuxHost`. It supplies the runtime required by hooks such as `useCommand` and `useCommands`.
|
|
77
|
+
|
|
78
|
+
```tsx title="src/ui/main.tsx"
|
|
79
|
+
import { OvermuxHost } from "overmux/client";
|
|
80
|
+
import { createRoot } from "react-dom/client";
|
|
81
|
+
|
|
82
|
+
import { client } from "./app";
|
|
83
|
+
import "./styles.css";
|
|
84
|
+
|
|
85
|
+
const root = document.querySelector("#root");
|
|
86
|
+
if (!root) {
|
|
87
|
+
throw new Error("Missing root element");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
createRoot(root).render(<OvermuxHost definition={client} />);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Define your client
|
|
94
|
+
|
|
95
|
+
Use `defineOvermuxClient` to connect your root React component and command registry:
|
|
96
|
+
|
|
97
|
+
```tsx title="src/ui/app.tsx"
|
|
98
|
+
import { defineOvermuxClient } from "overmux/client";
|
|
99
|
+
|
|
100
|
+
const App = () => <main>My Overmux UI</main>;
|
|
101
|
+
|
|
102
|
+
export const client = defineOvermuxClient({
|
|
103
|
+
component: App,
|
|
104
|
+
commands: {},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`App` is an ordinary React component. Add your own components, state, and layout, or compose components from ecosystem packages.
|
|
109
|
+
|
|
110
|
+
Start with an empty command registry. See [Commands](./commands) when you want named actions for menus, command palettes, or keyboard shortcuts.
|
|
111
|
+
|
|
112
|
+
## Add styles
|
|
113
|
+
|
|
114
|
+
Import your application CSS from `main.tsx`:
|
|
115
|
+
|
|
116
|
+
```css title="src/ui/styles.css"
|
|
117
|
+
body {
|
|
118
|
+
margin: 0;
|
|
119
|
+
font-family: system-ui, sans-serif;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
main {
|
|
123
|
+
padding: 1rem;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Individual ecosystem components may require additional stylesheet imports.
|
|
128
|
+
|
|
129
|
+
## Run your Overmux server
|
|
130
|
+
|
|
131
|
+
Run your instance through Overmux so the UI has access to its server:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
overmux serve --config ./overmux.config.ts
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Open the UI URL shown by the server. Vite updates the UI as you edit your React components and styles.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Deep links
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Your Overmux UI is a website, so each page has a URL. Deep links let you open those same routes in a specific Overmux instance using `overmux://` instead of an `http://` web address.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
overmux://work-laptop/my-page?tab=logs
|
|
9
|
+
instance UI route
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Instances
|
|
13
|
+
|
|
14
|
+
An **instance** is one Overmux server. Its ID defaults to `<hostname>-<port>`. Set [`instanceId`](../200-configuration.md#instanceid) in `overmux.config.ts` to give it a stable identity.
|
|
15
|
+
|
|
16
|
+
The instance ID is not a network address. Desktop remembers how to reach an instance when you connect to it.
|
|
17
|
+
|
|
18
|
+
Run [`overmux instance --json`](../700-cli/350-instance.md) to get the running server’s `instanceId` and `deepLinkPrefix`.
|
|
19
|
+
|
|
20
|
+
## Creating links
|
|
21
|
+
|
|
22
|
+
Append your Overmux UI’s route to the instance’s deep-link prefix.
|
|
23
|
+
|
|
24
|
+
Server handlers receive `instance` through their context argument:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { defineOperation } from "overmux/server";
|
|
28
|
+
import { z } from "zod";
|
|
29
|
+
|
|
30
|
+
export const getPageLink = defineOperation({
|
|
31
|
+
input: z.void(),
|
|
32
|
+
output: z.string(),
|
|
33
|
+
handle: (_input, { instance }) =>
|
|
34
|
+
`${instance.getDeepLinkPrefix()}/my-page?tab=logs`,
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
In React, use `useInstance` from your `createOvermuxHooks` setup. It re-renders when the server’s identity becomes available or changes:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { useInstance } from "./overmux";
|
|
42
|
+
|
|
43
|
+
const PageLink = () => {
|
|
44
|
+
const instance = useInstance();
|
|
45
|
+
if (!instance) return null;
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<a href={`${instance.deepLinkPrefix}/my-page?tab=logs`}>
|
|
49
|
+
View logs
|
|
50
|
+
</a>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`useInstance()` returns `undefined` until the server identifies itself.
|
|
56
|
+
|
|
57
|
+
## Routing in your Overmux UI
|
|
58
|
+
|
|
59
|
+
Your Overmux UI owns routing. We recommend [TanStack Router](https://tanstack.com/router/latest) for routing with React. See [Tech stack recommendations](./300-tech-stack-recommendations.md).
|
|
60
|
+
|
|
61
|
+
Overmux passes the path, query, and fragment to your client’s `navigate` callback. Connect this callback to your router to navigate without reloading the page. Without that callback, Overmux loads the route normally.
|
|
62
|
+
|
|
63
|
+
With an existing TanStack Router instance exported from `./router`:
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { RouterProvider } from "@tanstack/react-router";
|
|
67
|
+
import { defineOvermuxClient } from "overmux/client";
|
|
68
|
+
import { router } from "./router";
|
|
69
|
+
|
|
70
|
+
const App = () => <RouterProvider router={router} />;
|
|
71
|
+
|
|
72
|
+
export const client = defineOvermuxClient({
|
|
73
|
+
commands: {},
|
|
74
|
+
component: App,
|
|
75
|
+
navigate: (route) => router.navigate({ href: route }),
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For `overmux://work-laptop/my-page?tab=logs#latest`, `route` is `/my-page?tab=logs#latest`.
|
|
80
|
+
|
|
81
|
+
## Opening links
|
|
82
|
+
|
|
83
|
+
- **Inside your Overmux UI or PWA:** same-instance links navigate locally. No OS protocol handler is needed.
|
|
84
|
+
- **Desktop:** opening a link launches or focuses Desktop. Links can also switch to another known instance after confirmation. Connect to that instance first so Desktop knows its address.
|
|
85
|
+
- **Browser/PWA:** links to different or not-yet-discovered instances are blocked.
|
|
86
|
+
|
|
87
|
+
Installing the PWA does not register it as an OS-wide `overmux://` handler. Links clicked outside your Overmux UI require Overmux Desktop.
|