Remote terminal, files, and git in one live session

Motif

Run your workdir, shells, file operations, and git state on one machine. Attach from any lightweight client and see the same session.

iOS on the App Store. macOS, Android, Linux, and Windows on GitHub Releases. Web runs in the browser.

Open source (MIT/Apache-2.0) and self-hosted. No account or sign-in—your code stays on the machine running motifd.

Persistent
sessions stay alive on the machine running motifd
Mirrored
multiple clients see one authoritative session
Reachable
Pair, SSH, Tailscale, relay, or browser same-origin

What Motif is

A long-lived development session you can reattach to.

Motif combines a Rust server named motifd with Flutter clients. The server owns the workdir, PTY pool, filesystem operations, and git diff. Clients are thin surfaces that attach, detach, and reconnect.

The result feels like code-server plus tmux attach: open the same session from your laptop, phone, tablet, desktop app, or browser and keep seeing the same file tree, terminals, and diff.

Everything in the session

Core features

Motif focuses on the daily remote development loop: terminals, files, diffs, connection setup, and cross-device continuity.

Ghostty-powered terminal

Render remote PTY bytes locally with libghostty on native platforms and WebAssembly in the browser.

Long-lived sessions

Sessions live on the server with their workdir and terminal state even when a client disconnects.

Mirrored clients

Multiple clients attach to the same session and observe the same PTY output, file tree, and git state.

File tree and editing

Browse, create, rename, delete, preview, edit, and resolve write conflicts inside the server workdir.

Git diff views

Review all changes or per-file diffs without leaving the remote session.

Quick commands

Use reusable command sets, sticky modifiers, and an editor for fast mobile and desktop terminal input.

Flexible connectivity

Reach motifd over embedded Tailscale (tsnet), relay, or motif://pair links and QR, with certificate pinning and psk-derived bearer auth.

Embedded Web client

motifd can serve the Flutter Web client from the same origin as RPC, events, and PTY streams.

Desktop embedded server

Desktop builds can run motifd in-process, managed from the Server view or system tray.

SSH auto-provisioning

Connect over SSH and Motif can download, install, and start motifd on the remote host automatically when it is missing.

Voice, photo, and image flows

Native clients support voice input, photo attach, image view, and terminal-focused interaction helpers.

Encrypted push notifications

E2E push uses AES-256-GCM and native APNs paths without Firebase in the iOS flow.

Product walkthrough

Every core workflow, captured from a live review server.

These are real macOS and iPhone captures connected to a public motifd review server: session management, terminal attach, files, git diff, mobile input helpers, settings, and the embedded server view.

How it compares

Why Motif instead of SSH + tmux or a browser IDE?

Motif keeps one authoritative session on the server and mirrors it to native clients on every device—with files, git diff, and built-in connectivity. Here is how that compares to the usual setups.

Capability SSH + tmux mosh code-server Motif
Persistent, mirrored server session ~
Survives roaming and flaky links (local echo)
Native phone, tablet, and desktop apps ~ ~
Native scrollback, no copy-mode keys
File tree, editing, and git diff
Custom shortcuts and quick-command input
Forward remote ports to localhost ~
AI agent helpers: image upload, completion hooks
Built-in Tailscale, relay, and QR pairing

✓ built in · ~ with extra setup · — not really

Two ways to run

Use Motif as a server daemon or as your computer's remote entrance.

Every session lives in a motifd server. Desktop apps include motifd—run it locally in one click. Mobile, web, and other desktops attach to a motifd you run on a computer or server.

Run on a server

Deploy motifd on a VPS, cloud box, remote workstation, or long-lived dev machine. Clients attach from anywhere that can reach it.

docker run -d --name motifd --restart=unless-stopped \
  -p 7777:7777 \
  -v motifd-data:/data \
  -v "$PWD:/work" \
  -e MOTIFD_ADVERTISE_HOST=<host> \
  ghcr.io/xiachufang/motifd:latest

Then read the pairing link from the logs and scan or paste it in any client:

docker logs motifd 2>&1 | grep -o 'motif://pair[^ ]*'

Run on your computer

The desktop app ships motifd built in—no separate install. Start the embedded server from the Server view or tray, then connect from mobile, web, or another desktop.

  1. Open Motif desktop.
  2. Choose Loopback, Local network, Tailscale, or relay pairing.
  3. Scan or paste the pairing link from another client.

Rendezvous relay

Deploy rzv once, then pair through it when direct routes are hard.

Run the relay on any reachable host. motifd and clients both dial out, the relay matches them by token, and Motif's TLS/psk layer stays end-to-end.

Run the relay

Expose one TCP port on a small VPS or internal host. The relay holds only in-flight pairing state.

docker run -d --name motif-rzv --restart=unless-stopped \
  -p 8765:8765 \
  ghcr.io/xiachufang/motif-rendezvous:latest

Point motifd at it

For relay-only Docker deployments, disable the direct listener and set MOTIFD_RZV_RELAY. For source builds, pass --rzv-relay.

Docker:

docker run -d --name motifd --restart=unless-stopped \
  -v motifd-data:/data \
  -v "$PWD:/work" \
  -e MOTIFD_LISTEN=off \
  -e MOTIFD_RZV_RELAY=relay.example.com:8765 \
  ghcr.io/xiachufang/motifd:latest

Binary:

motifd --rzv-relay relay.example.com:8765

Pair and verify

Copy the motif://pair URI from motifd logs, then scan or paste it in Motif. The same link carries the relay address, psk, and cert pin.

docker logs motifd 2>&1 | grep -o 'motif://pair[^ ]*'
docker inspect --format '{{.State.Health.Status}}' motif-rzv

Connection paths

Pick the route that matches your network.

Path Best for Notes
Direct TCP LAN or public host Network listeners auto-encrypt and use pairing credentials.
SSH forward Existing SSH access Keep motifd on 127.0.0.1 and forward a local port. The desktop app can auto-install and start motifd over SSH when it is missing.
Tailscale NAT, travel, private devices Use embedded tsnet on supported clients and servers.
Rendezvous relay QR pairing when direct routes are hard The relay forwards encrypted bytes; clients still pin the server cert.
Browser same-origin Local loopback or trusted HTTPS host motifd serves the Flutter Web client next to RPC and WebSocket routes.

How it fits together

motifd owns state. Clients attach to it.

RPC, event streams, and PTY streams share one protocol surface. The web client can be embedded by motifd, while native clients use the same server model through HTTP and WebSocket transports.

iOS app macOS app Browser Linux / Windows
motifd Sessions PTY pool File ops Git diff
Host filesystem, shell, and git

Security model

Single-user by design, explicit about trust.

Motif treats the machine running motifd as the trusted execution environment. Shell commands run with that user's permissions, and workdir access is bounded by the server-side path checks.

  • Network listeners use self-signed TLS with client-side certificate pinning.
  • Pairing links carry the psk material used to derive bearer auth.
  • Loopback mode stays plaintext and unauthenticated for local-only workflows.
  • Tailscale and SSH are available when you want network access without opening a public port.

FAQ

Common questions

Does Motif copy my project to the client?

No. The workdir stays on the machine running motifd. Clients operate remotely and render the current server state.

Can I use it from a browser?

Yes for loopback, SSH-forwarded, or trusted HTTPS origins. Browsers cannot pin Motif's self-signed cert for network pairing, so native apps are recommended there.

What happens when I close the app?

The client detaches. The session continues on the server until you destroy it or stop motifd.

Is Motif an AI agent?

No. The current product is a remote development surface, not an LLM agent. It focuses on sessions, terminals, files, git, and connectivity.

Which platforms are supported?

The Flutter client targets iOS, macOS, Android, Web, Linux, and Windows. Desktop builds can include the embedded server path.

Do I need to install motifd on my remote host?

Not necessarily. For an SSH server, enable Auto initialize and the desktop app downloads, installs, and starts motifd on the remote host (Linux or macOS, x86_64 or arm64) when it is missing. On your own computer, motifd is built into the desktop app.

Is Motif free, and do I need an account?

Motif is open source (MIT/Apache-2.0) and free to self-host. There is no account or sign-in—clients pair directly with your motifd over pinned TLS, and nothing is sent to a third-party service.

How mature is Motif?

Motif is actively developed and ships tagged releases. Check the GitHub Releases page for the current version and changelog.

What does the motifd server need to run?

A single motifd binary on Linux or macOS (x86_64 or arm64). Use the Docker image on a Linux host, or run the binary directly. No database or extra services are required.

Where should I read more?

Browse the docs/ folder in the GitHub repo—usage, rpc, tailscale, and web-client guides. For help or bug reports, open a GitHub issue.