- OCaml 51.1%
- Python 18.9%
- Rust 15.6%
- Svelte 8.2%
- TypeScript 4.2%
- Other 1.9%
- Geist and JetBrains Mono, a 14px base with 15px messages, a radius scale, light-dark() tokens, one form-control base and fading popups; fewer rules between rows. - A theme setting (System, Light, Dark) in server_settings, saved with the Save bar and cached for the first paint; Dark is a neutral carbon palette. - Settings in tabs at the top, its fields as rows; ExecutionNodes split out of the page. - Messages without bubbles: the user's in a full-width band, right aligned; tool calls open into a box with their rows and output; disclosure chevrons on the right, shown on hover. - The input bar outside the scroller, with no rule or ground, a hint with the Enter key, a monochrome send that stop replaces, and the access warning as a full-width banner. - The select ring drawn over the pane's content; the side panels' current row ringed inside its row. Co-Authored-By: Qwen 3.8 27B <noreply@qwen.ai> |
||
|---|---|---|
| backend | ||
| bin | ||
| core | ||
| design | ||
| gen | ||
| json | ||
| net | ||
| nix | ||
| node | ||
| packages | ||
| ppx | ||
| providers | ||
| rust | ||
| sdk | ||
| server | ||
| share/bubble/packages | ||
| test | ||
| tools | ||
| web | ||
| .gitignore | ||
| AGENTS.md | ||
| dune | ||
| dune-project | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| RESUME.md | ||
| shell.nix | ||
bubble
An agent server. You talk to agents in a web UI, and they run commands on nodes: small bubble-node processes that dial the server from the machines and accounts the agents work in.
This page sets up a server and a node with Nix. The design and its decisions are in design/; developing bubble is in AGENTS.md.
Packages
The flake builds these, for x86_64-linux and aarch64-linux:
| Package | Holds | For |
|---|---|---|
bubble |
bin/bubble, the server and its CLI; bin/bubble-node; the tool packages |
the server, and nodes on hosts with Nix |
bubble-web |
the web app | the server's UI; bubble serves it by default |
bubble-node-static |
bin/bubble-node, static (musl) |
nodes on hosts without Nix |
bubble-node-windows-aarch64 |
bin/bubble-node.exe |
a node on Windows 11 on ARM64; cross-built, and checked only on x86_64-linux |
The commands below use flakes: enable them with experimental-features = nix-command flakes in nix.conf, or pass --extra-experimental-features 'nix-command flakes'. The flake's httpun-ws input is fetched over SSH from git.outfoxxed.me, so building needs SSH access to that forge. There's no binary cache: everything builds from source.
A scratch server and node
From a checkout, this gives a shell with bubble, bubble-node and bwrap on its PATH:
nix shell .#bubble nixpkgs#bubblewrap
mkdir -p ~/bubble-scratch
bubble serve --db ~/bubble-scratch/bubble.db
The server keeps its other state beside the database. Its flags:
--host IPand--port PORT: where it listens,127.0.0.1:7340by default.--static DIR: the web app to serve. The package defaults it tobubble-web; a dev build isweb/build.--allow-host NAME: a host name browsers may reach it by, besides IP addresses and localhost, such as a TLS proxy's. Repeat it for each.
bubble serve --help lists the rest.
Pair your browser. In a second such shell, print a single-use token, good for 15 minutes:
bubble pair --db ~/bubble-scratch/bubble.db
Open http://127.0.0.1:7340, enter the token, and Pair. Add a model provider's account in Settings, under Models & connections.
Run a node, from the directory its commands should start in:
bubble-node --name scratch ws://127.0.0.1:7340/node
It shows in a thread's nodes sidebar, where you bind it to the thread. Binding is sandboxed by default, which needs bwrap on the node's PATH. It runs commands as you, and redials if the server goes away.
/nodeis unauthenticated: anything that reaches the server's port can register as a node and receive its commands. Bind--hostto loopback or to a trusted network's address, such as a WireGuard or Tailscale IP, never0.0.0.0. A TLS proxy doesn't authenticate/node, and one that forwards every path reaches it even on a loopback-bound server: block/nodethere (below).
NixOS
The flake's nixosModules.default runs the server, and nodes as users. In your system's flake:
{
inputs.bubble.url = "git+ssh://git@git.outfoxxed.me/bubble/bubble";
outputs = { nixpkgs, bubble, ... }: {
nixosConfigurations.HOST = nixpkgs.lib.nixosSystem {
modules = [ bubble.nixosModules.default ./configuration.nix ];
};
};
}
Leave bubble's nixpkgs its own, without follows: its packages are built and checked against it. Its inputs come over SSH, so run nixos-rebuild switch --sudo --flake .#HOST as yourself, not under sudo, which fetches as root without your key; or give root a key for the forge. An older nixos-rebuild without --sudo takes --use-remote-sudo.
A server, with a node for the user alice dialing it:
services.bubble = {
server.enable = true;
nodes.alice-node.user = "alice";
};
The server listens on 127.0.0.1:7340 and keeps its state in /var/lib/bubble. Pair a browser with:
sudo -u bubble bubble pair --db /var/lib/bubble/bubble.db
On a headless server, reach the UI through ssh -L 7340:127.0.0.1:7340 HOST, or a TLS proxy that forwards Host and X-Forwarded-Proto, with its name in server.allowedHosts.
The proxy must not forward
/node./nodeis unauthenticated (see above): through the proxy, anyone who reaches it could register as one of your nodes and receive its commands and files. Nodes connect to the server's own address on a trusted network instead. Block the path at the proxy, for examplerespond /node 403in a Caddy site, orlocation = /node { return 403; }in nginx.
The options are in nix/module.nix, and the design in design/nix.md §10.
Logging in with OIDC
With OIDC, a browser logs in through your identity provider instead of carrying a pairing token, with the provider's own MFA. Pairing keeps working beside it: it's the recovery path, and a way in that doesn't depend on the provider. A login makes an ordinary device that lasts --oidc-session-days (30 by default) and then ends, its sockets closing and the login page coming back. Everything else is as it was: a device logged in this way can do what a paired one can, including pairing others. A device paired from it is an ordinary paired device: it doesn't expire with the login, and taking your account or group away at the provider doesn't remove it; remove it in Settings → Devices.
At the identity provider, register a client for bubble (a web client, authorization code flow) whose redirect URI is exactly <public-url>/auth/oidc/callback, for example https://bubble.example/auth/oidc/callback. A confidential client has a secret; a public one needs none (bubble always sends PKCE, S256).
With flags:
bubble serve --db ~/bubble-scratch/bubble.db \
--public-url http://127.0.0.1:7340 \
--oidc-issuer https://idp.example/application/o/bubble/ \
--oidc-client-id bubble --oidc-client-secret-file /run/secrets/oidc-client-secret
--public-url URL: bubble's external origin, no path. It's the redirect URI's base, and its host counts as an--allow-host. Required with OIDC: a redirect URI must never come from a request's Host.--oidc-issuer URL: the issuer, exactly as its discovery document states it (Authentik's ends in/). Turns OIDC on. It must behttps, orhttpon a loopback host for tests.--oidc-client-id ID, and--oidc-client-secret-file FILEfor a confidential client. Without the file, bubble readsoidc-client-secretin$CREDENTIALS_DIRECTORYwhen systemd set one (the module's way); with neither, it's a public client.--oidc-name LABEL: the login button's label; the issuer's host by default.--oidc-session-days N: how long a login lasts, 1 to 400, 30 by default.--oidc-require-claim NAME=VALUE: admit only logins whose claimNAMEis the stringVALUE, or a list holding it, such asgroups=bubble. Without it, anyone the provider authenticates may log in — restrict the client at the provider itself, or set a rule. The strongest issub=<your id>, which the provider never lets anyone else have;groups=…suits a provider whose groups you manage, andhd=example.coma Google Workspace domain.email=…is only as strong as the provider's check of the address, which bubble doesn't read (email_verified): Google vouches only for@gmail.comaddresses and its Workspace domains, so with Google anemail=rule should name a@gmail.comaddress.
With the module, under services.bubble.server:
services.bubble.server = {
publicUrl = "https://bubble.example";
oidc = {
issuer = "https://idp.example/application/o/bubble/";
clientId = "bubble";
clientSecretFile = "/run/secrets/oidc-client-secret"; # a path outside the store
requireClaim = "groups=bubble";
};
};
The secret file stays where it is: the module passes it to the unit as systemd's LoadCredential, so it's in neither the store nor the unit's environment. oidc.name sets the button's label, and oidc.sessionDays the session length.
A public login page still doesn't guard
/node. If you serve bubble through a TLS proxy, the proxy must not forward/node(see above): it's unauthenticated, so anyone who reaches it through the proxy could register as a node. Block it there, for examplerespond /node 403in a Caddy site, orlocation = /node { return 403; }in nginx, and keep nodes on a trusted network.
The design, the notes on each provider, and what phase 1 leaves out are in design/auth.md §3.
A node on another machine
The server must listen on an address the node can reach, on a trusted network only (see above). With the module, open its port on that network's interface alone, not with server.openFirewall, which opens it on every interface:
services.bubble.server.host = "100.64.0.1"; # this machine's Tailscale IP
networking.firewall.interfaces.tailscale0.allowedTCPPorts = [ 7340 ];
With Nix there, run the node straight from the flake, with nothing to install:
nix shell git+ssh://git@git.outfoxxed.me/bubble/bubble#bubble nixpkgs#bubblewrap -c bubble-node --name laptop ws://SERVER:7340/node
That machine needs flakes enabled, and your SSH key and a known_hosts entry for git.outfoxxed.me, for bubble and its httpun-ws input. It builds from source. A checkout's path works in place of the URL.
The node lasts as long as that command. For one that stays up, use the module's node unit on NixOS, with services.bubble.nodes.<name>.url, or a service of your own.
Without Nix, build bubble-node-static for the target's system on a machine with Nix, copy its bin/bubble-node over, and run it the same way. For an ARM target, that's .#packages.aarch64-linux.bubble-node-static, which needs an aarch64 builder.
nix build .#bubble-node-static
scp result/bin/bubble-node laptop:
A node on Windows
On Windows 11 on ARM64, the node is bubble-node.exe, cross-built on Linux. It works as a node elsewhere does, with these differences:
- It has no sandbox. Commands, and nodes opened inside it (launch
sandbox: "none"only), run with your account's full rights. - Commands are PowerShell 7, not
sh. - There's no glob, grep or MCP servers on it. Agents search with PowerShell instead.
- A command can't outlive its own run: everything it starts ends with it. That doesn't hold for what something else starts on its behalf, such as a service, Task Scheduler or WMI.
- An edit or write replaces the file itself: it takes its folder's access-control list and loses its alternate data streams (Zone.Identifier among them), hidden and system attributes and hard links.
Build it, and copy it to the machine:
nix build .#bubble-node-windows-aarch64
scp result/bin/bubble-node.exe laptop:
It's unsigned, so Defender may scan it on first run, and Smart App Control, if it's on, blocks it.
It needs PowerShell 7.4 or later, from Microsoft's ZIP, first on your PATH. Use the win-arm64 ZIP from PowerShell's GitHub releases, not the Store's PowerShell: that one escapes the node's cleanup, so the node skips it. In PowerShell:
$ps = "$env:LOCALAPPDATA\Programs\PowerShell\7"
Expand-Archive PowerShell-7.7.0-win-arm64.zip $ps
[Environment]::SetEnvironmentVariable('PATH', "$ps;" + [Environment]::GetEnvironmentVariable('PATH', 'User'), 'User')
Put the node in %LOCALAPPDATA%\Programs\bubble, and run it from a new prompt, with the same trusted-network rule as above:
& "$env:LOCALAPPDATA\Programs\bubble\bubble-node.exe" --name laptop ws://SERVER:7340/node
Ctrl+C, or closing its window, stops it, ending what it runs.
For one that stays up, register a logon task. It opens the node's window at each logon. Task Scheduler's defaults would stop it after 72 hours, and on battery, so this turns both off:
$exe = "$env:LOCALAPPDATA\Programs\bubble\bubble-node.exe"
$action = New-ScheduledTaskAction -Execute $exe -Argument '--name laptop ws://SERVER:7340/node' -WorkingDirectory $HOME
$trigger = New-ScheduledTaskTrigger -AtLogOn -User (whoami)
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit ([TimeSpan]::Zero) -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
Register-ScheduledTask -TaskName 'bubble node' -Action $action -Trigger $trigger -Settings $settings
Start-ScheduledTask 'bubble node' starts it without logging on again.
For a wss:// server whose certificate comes from a private CA, import that CA's root into your own store: Import-Certificate ca.crt -CertStoreLocation Cert:\CurrentUser\Root.