lamngockhuong/termote
حول
Self-hosted PWA to control Claude Code, Codex, GitHub Copilot or any terminal from your phone or desktop. Single Go binary streaming tmux/psmux/Herdr sessions to xterm.js, native or in a container.
أدوات التطويرما يمكنك فعله
- Session switching: Multiple tmux sessions with create/edit/delete
- Session tabs: Horizontal tab bar for quick window switching
- Chat view: read and answer a pane running Claude Code, Codex (started with --no-daemon) or OpenCode 2 as a chat, with slash command suggestions, dialog answers, text quoted from the chat into the reply and running subagents, each subagent's own conversation one tap away — see Agent Chat
- Session history: list the Claude Code, Codex and OpenCode sessions that ran in a pane's folder, read one, resume it in a new tab or fork a running one — see Resuming an Old Session
النمو المقاس للنجوم
- خلال 24 ساعة
- +١
- خلال 7 أيام
- +٢
- خلال 15 يومًا
- +٣
- خلال شهر
- +٩
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصل
Remote control CLI tools (Claude Code, Codex, OpenCode, any terminal) from mobile/desktop via PWA.
[!NOTE] Termote 1.0 does not upgrade a 0.x install. Uninstall 0.x as described in the archived 0.x docs, then install 1.0 with the Quick Start commands.
Termote = Terminal + Remote
🇻🇳 Tiếng Việt | 🇨🇳 简体中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇪🇸 Español | 🇧🇷 Português (BR) | 🇫🇷 Français | 🇩🇪 Deutsch | 🇷🇺 Русский | 🇮🇩 Bahasa Indonesia
Features
- Session switching: Multiple tmux sessions with create/edit/delete
- Session tabs: Horizontal tab bar for quick window switching
- Herdr backend (native or in the container): drive Herdr workspaces instead of tmux, with per-pane coding-agent status badges — see Native Installation
- Chat view: read and answer a pane running Claude Code, Codex (started with
--no-daemon) or OpenCode 2 as a chat, with slash command suggestions, dialog answers, text quoted from the chat into the reply and running subagents, each subagent's own conversation one tap away — see Agent Chat - Session history: list the Claude Code, Codex and OpenCode sessions that ran in a pane's folder, read one, resume it in a new tab or fork a running one — see Resuming an Old Session
- Tokens and cost: each agent session's tokens and estimated cost, with daily totals — see Tokens and cost
- Files a session changed: the files an agent session edited, listed in Changes and in the session history, each opening its diff — see Changes
- Files and Changes views: browse a pane's directory and its git changes, with a Markdown preview, on every backend including psmux on Windows — see Files and Changes
- Chat queue and file links: queue a message while the agent works; tap a file path the agent wrote to open it in Files, at its line
- Review and staging: comment on lines in Changes and Files and send the review to an agent; stage, unstage or discard a change by file or by hunk
- Previews and editing in Files: PDF, .xlsx and .docx previewed read-only; Shift-JIS, EUC-JP and UTF-16 files opened and saved; Markdown edited beside a live preview
- Open in Windows (WSL): copy a file's Windows path, or open a file or folder with its Windows program, when the server runs under WSL
- Places: offer a folder outside the pane in Files with
termote start --allow-path <dir>— see Places - Tasks: run a pane's
package.jsonscripts and Makefile targets, send a failed run to an agent — see Tasks - Worktrees: open a git worktree as a group of its own, from a new or existing branch (Herdr, tmux, Zellij, herdr-core, psmux) — see Worktrees
- Separate windows (desktop): open a file, diff, tab, pane or the overview in its own window
- Image attachments: send an image from the phone to the terminal or to a Chat view message, so the agent can read it by path; an image pasted into Claude Code, Codex or OpenCode opens again from the Chat view
- Zellij backend (Linux, macOS, or the container): drive your Zellij sessions, tabs and panes instead of tmux (Zellij 0.45.0 or later), chosen with
--mux zellij— see Native Installation - herdr-core backend (native, every OS): show the spaces, tabs and panes the herdr app shows, as one more client of herdr-core (
hc0.1.16 or later), chosen with--mux hc— see herdr-core Backend - Machines: watch and drive the agents of your other computers from one Termote, over SSH with a key that can only reach Termote there (
termote machine add <alias>) — see Machines - Orchestrator: one Claude Code or Codex session that coordinates the agents in your other panes: their status, a task for one of them, its answer, its dialogs, a new agent in its own worktree (
termote agents) — see Orchestrator. Its skill comes with Termote (termote skills install) or as a plugin from termote-plugins (/plugin marketplace add lamngockhuong/termote-pluginsin Claude Code,codex plugin marketplace add lamngockhuong/termote-pluginsin Codex); install one of the two, not both - Plan and jobs: the work the orchestrator hands out, as jobs with a priority, the jobs each waits on and a workspace, their pull requests and CI checks (failed ones sent back to the agent), and a finish that closes the tab and removes the worktree after your yes (
termote agents job ...) — see Orchestrator - Questions for you: the orchestrator records what it asks you (
termote agents ask add); answer or dismiss each one from the Plan tab or the chat of the orchestrator that asked, on this Termote or on a machine's; jobs whose agent waits on a dialog show under Waiting for you — see Questions waiting on you - Herdr plugin: open the focused Herdr pane in Termote, show its link as a QR code for a phone, start or stop the server, without leaving Herdr — see Herdr Plugin
- Mobile-friendly: Virtual keyboard toolbar (Tab/Ctrl/Shift/arrows, expandable)
- Gesture support: Swipe for Ctrl+C, Tab, scrolling
- Command history: Recall previously sent commands with search
- Quick actions: The ⋯ key pinned at the end of the mobile toolbar shows an Actions row for common operations (clear, cancel, exit)
- Interface styles: Neutral, Terminal or Native, chosen in Settings, independent of light/dark theme, with an accent color shared by every style
- Interface language: English or Vietnamese, chosen in Settings; Auto follows the browser
- Settings to go: export this browser's settings to a file and import them in another, or review the settings a coding agent proposes with
termote settings propose— see Settings - GPU terminal: the terminal is drawn with WebGL2 where the device has a GPU, which keeps large output smooth
- Connection indicator: Real-time server status with auto-detect disconnect
- Update checker: Automatic new version notification from GitHub releases
- PWA: Installable to homescreen, offline-capable
- Persistent sessions: tmux keeps sessions alive
- Collapsible sidebar: Desktop UI with toggleable session sidebar
- Desktop app (Windows, macOS, Linux; not code signed yet): Termote in a window of its own that needs no web port (
termote start --web=false), with native notifications, and on Windows a Termote inside WSL as a target — see Desktop app - Fullscreen mode: Immersive terminal experience
- Runs as a service:
termote startregisters a user service (systemd, launchd, Scheduled Task) that starts at login - Config persistence:
termote startsaves its options, with the password stored encrypted
Screenshots
Try the demo: the real app in your browser, on a phone or a desktop, with fake data and no install.
Architecture
flowchart TB
subgraph Client["Client (Mobile/Desktop)"]
PWA["PWA - React + xterm.js"]
Gestures["Gesture Controls"]
Keyboard["Virtual Keyboard"]
end
subgraph Server["Termote Server :7680"]
Static["Static Files"]
Stream["Terminal WebSocket /api/mux/stream"]
API["REST API /api/mux/*"]
Guard["Host allowlist + Origin/CSRF guard"]
Auth["Basic Auth"]
end
subgraph Backend["Mux Backend (tmux/psmux, Herdr, Zellij or herdr-core)"]
Mux["Mux interface"]
tmux["tmux/psmux (PTY)"]
herdr["Herdr"]
zellij["Zellij"]
hc["herdr-core (hc)"]
Shell["Shell"]
Tools["CLI Tools"]
end
Gestures --> PWA
Keyboard --> PWA
PWA --> Static
PWA <--> Stream
PWA --> API
Guard -.-> Static & Stream & API
Auth -.-> Static & Stream & API
Stream --> Mux
API --> Mux
Mux --> tmux & herdr & zellij & hc
tmux --> Shell --> Tools
Termote streams the terminal itself (PTY on Unix, ConPTY on Windows) into xterm.js in the PWA; there is no separate terminal process to proxy to. See docs/system-architecture.md for the full request-guard model.
Quick Start
📖 New to Termote? Check out the Getting Started Guide for a complete walkthrough with examples.
Linux / macOS:
curl -fsSL https://termote.ohnice.app/install.sh | sh
termote start
Homebrew (macOS, Linux):
brew install lamngockhuong/tap/termote
termote start
A Homebrew install updates with brew, not termote update: brew upgrade termote && termote restart. Remove it with termote uninstall && brew uninstall termote.
Windows (PowerShell):
irm https://termote.ohnice.app/install.ps1 | iex
termote start
With a coding agent: paste the prompt from Install with an agent into Claude Code, Codex or another agent. It follows agents.md, checks that the server answers, and leaves the password to you.
The installer needs only curl, tar and sha256sum/shasum (PowerShell on Windows), no sudo or admin rights. It verifies the checksum of the archive, installs the termote command, and starts nothing. termote start saves the options, creates a password the first time (printed once, and only in a terminal; termote show-password shows it again), registers the service and starts it. Open http://127.0.0.1:7680 (Windows: http://127.0.0.1:7690).
A terminal backend must be installed first: tmux (sudo apt install tmux, brew install tmux), psmux on Windows (winget install psmux), or Herdr. The first start detects which one to use. Zellij 0.45.0 or later (Linux, macOS) is never detected: choose it with --mux zellij. herdr-core (hc 0.1.16 or later, every OS, native only) is never detected either: choose it with --mux hc.
Common options
termote start --lan # Listen on the LAN, not only this machine
termote start --tailscale myhost.ts.net # Publish over Tailscale HTTPS
termote start --mux herdr # Drive Herdr workspaces instead of tmux
termote start --mux zellij # Drive Zellij sessions instead of tmux (Linux, macOS)
termote start --mux hc # Show the herdr app's terminals through herdr-core
termote start --no-auth # Disable basic auth (local use only)
Options are saved: a flag not given keeps its saved value, and a boolean is turned off with =false (termote start --lan=false). The flags are the same on every OS, PowerShell included.
Everyday commands
termote status # What the running server reports
termote stop # Stop (it starts again at the next login)
termote restart # Restart with the saved options
termote logs follow # Tail the logs
termote show-password # Print the saved username and passwords (native, container)
termote url --qr # The link to open, as a QR code for a phone
termote pair # A one-time code that signs a new device in
termote devices # List the paired devices (devices revoke <id>)
termote machine add <ssh alias> # Reach another computer's Termote (Machines in the sidebar)
termote skills install # The orchestrator skill for Claude Code and Codex
termote update # Update to the latest release
termote uninstall # Remove the service, the command, the install and uploads
update switches to the new version, restarts the service and switches back if the new version does not come up. uninstall keeps the configuration (~/.config/termote) and the logs (~/.local/state/termote) and prints both paths; uninstall --purge removes them too.
Installation
Pin a version
curl -fsSL https://termote.ohnice.app/install.sh | TERMOTE_VERSION=1.0.0 sh
termote update --version 1.0.0
$env:TERMOTE_VERSION='1.0.0'; irm https://termote.ohnice.app/install.ps1 | iex
Without TERMOTE_VERSION the installer takes the newest stable release (1.0 or later) and leaves an existing install alone. With it, that version is installed beside the current one and becomes the active version, which also repairs a broken install. A pre-release (X.Y.Z-rc.N) is installed only when named this way (or with termote update --version), and only once it is published; see the Deployment Guide.
Container mode
termote container up # Run the published image (podman or docker)
termote container up --workspace ~/projects # Mount a directory at /workspace
termote container status
termote container logs -f
termote container down
container up runs ghcr.io/lamngockhuong/termote at the version of the installed termote, with podman (preferred) or docker, on port 7680 with ~/termote-workspace mounted at /workspace. It accepts --port, --lan, --tailscale, --cloudflare, --no-auth, --mux, --allow-host, --allow-path, --user, --fresh, --workspace and --build (a checkout only), saved apart from the options of start; the username is shared with the native server, but the container has its own password (--fresh changes only its own; termote show-password shows both). Docker restarts the container after a reboot; rootless Podman has no daemon to do that, so run it as a Quadlet unit.
Security note: Avoid mounting
$HOMEdirectly — sensitive directories like.ssh,.gnupgwill be accessible in container. Mount specific project directories instead.
Docker without the CLI
# Generates a password: docker exec termote cat /home/termote/.config/termote/password
docker run -d --name termote -p 7680:7680 \
-v ~/projects:/workspace \
ghcr.io/lamngockhuong/termote:latest
# With your own credentials
docker run -d --name termote -p 7680:7680 \
-e TERMOTE_USER=admin -e TERMOTE_PASS=secret \
ghcr.io/lamngockhuong/termote:latest
| Environment Variable | Description |
|---|---|
TERMOTE_USER |
Basic auth username (default: admin) |
TERMOTE_PASS |
Basic auth password (default: auto-generated, saved in /home/termote/.config/termote/password) |
NO_AUTH |
Set to true to disable authentication |
Desktop app
The desktop app (Windows, macOS, Linux) is a separate download from the releases page: the installers and termote update never install or update it. It needs the native server on the same computer and reaches it through termote desktop-link rather than the network, so the web port can stay off:
termote start --web=false # No TCP port: only the CLI and the desktop app reach the server
termote pair --role full --expires never # A code for the app's sign-in page (it names the device after the computer)
It is not code signed yet, so macOS Gatekeeper and Windows SmartScreen warn the first time it opens: check the file against its .sha256 first, then click Open Anyway in System Settings → Privacy & Security, or More info → Run anyway. On Windows it can also reach a Termote inside a WSL distro (Termote → Target → WSL: <distro>). See Desktop app for the details.
Build from source
git clone https://github.com/lamngockhuong/termote.git
cd termote
make build
./scripts/termote.sh start
make build builds the PWA and embeds it in server/termote; it needs Go, Node.js and pnpm. scripts/termote.sh (Windows: scripts\termote.ps1) only runs a checkout: it rebuilds the development binary when a source is newer, then runs it with the same arguments. termote update refuses to run in a checkout; use git pull && make build.
Upgrading from 0.x
There is no upgrade from 0.x: 1.0 installs in a new place and does not read the 0.x configuration. Uninstall 0.x as described in the archived 0.x docs, then install 1.0 with the commands above.
Deployment Modes
flowchart LR
subgraph Container["Container Mode"]
direction TB
C1["Docker/Podman"] --> C2["Termote :7680 (streams terminal itself)"] --> C3["tmux / Herdr / Zellij"]
end
subgraph Native["Native Mode"]
direction TB
N1["Host System"] --> N2["Termote :7680 (streams terminal itself)"] --> N3["tmux/psmux, Herdr, Zellij or herdr-core + Host Tools"]
end
User["User"] --> Container & Native
| Mode | Command | Use Case | Platform |
|---|---|---|---|
| Native | termote start |
Host tool access (claude, gh) | macOS, Linux, Windows |
| Container | termote container up |
Isolated environment | macOS, Linux, Windows |
The native server runs as a user service: a systemd user unit on Linux (a detached process where there is no user systemd, such as WSL2 without systemd), a launchd agent on macOS, a Scheduled Task at logon on Windows.
Options of start
| Flag | Description |
|---|---|
--port <port> |
Port (default: 7680, Windows: 7690) |
--lan[=false] |
Listen on every interface (default: localhost only) |
--tailscale <host[:port]> |
Publish over Tailscale HTTPS (default port 443) |
--no-tailscale |
Stop publishing over Tailscale |
--cloudflare <host> |
Hostname of a Cloudflare Tunnel you run; warns when Cloudflare Access is not in front of it |
--no-cloudflare |
Forget the Cloudflare hostname |
--proxy-client-header <name> |
Header a proxy sets to the client's address (default with --cloudflare: CF-Connecting-IP) |
--no-proxy-client-header |
Stop reading it |
--no-auth[=false] |
Disable basic authentication |
--mux <tmux|herdr|zellij|hc> |
Terminal backend (default: herdr when it runs, else tmux; zellij: Linux, macOS; hc: herdr-core) |
--allow-host <name> |
Allow an extra Host header value (repeatable; no wildcard, see security notes) |
--remove-host <name> |
Remove an allowed Host name (repeatable) |
--allow-local-user <name> |
Let another OS user of this machine connect, e.g. a reverse proxy (repeatable; Linux, Windows) |
--remove-local-user <name> |
Stop letting that user connect (repeatable) |
--allow-path <dir> |
Offer a folder in Files, under Places (repeatable) |
--remove-path <dir> |
Remove an allowed folder (repeatable) |
--allow-herdr-no-auth |
Required together with --mux herdr --no-auth |
--allow-hc-no-auth |
Required together with --mux hc --no-auth |
--user <name> |
Login username (default: admin; shared with the container) |
--fresh |
Set a new password |
With Tailscale HTTPS
Uses tailscale serve for automatic HTTPS (no manual cert management):
termote start --tailscale myhost.ts.net # Default port 443
termote start --tailscale myhost.ts.net:8765 # Custom port
termote container up --tailscale myhost.ts.net # Container mode
sudo tailscale set --operator=$USER # Linux, once: let Termote run tailscale serve
The mapping is applied each time the server starts. stop, start --no-tailscale and uninstall remove only Termote's own mapping.
Platform Support
| Platform | Container | Native | Installer |
|---|---|---|---|
| Linux | ✓ | ✓ | install.sh |
| macOS | ✓ | ✓ | install.sh |
| Windows | ✓ | ✓ | install.ps1 |
Windows Support: Container mode requires Docker Desktop or Podman Desktop; native mode requires psmux (tmux-compatible terminal multiplexer for Windows), installed with
winget install psmux, or a running Herdr server.
Mobile Usage
| Action | Gesture |
|---|---|
| Cancel/interrupt | Swipe left (Ctrl+C) |
| Tab completion | Swipe right |
| Scroll down | Swipe up |
| Scroll up | Swipe down |
| Paste | Long press |
| Font size | Pinch in/out |
Virtual toolbar provides: Tab, Esc, Ctrl, Shift, Arrow keys, and common key combos. Supports Ctrl+Shift combinations (paste, copy). Toggle between minimal and expanded mode for additional keys (Home, End, Delete, etc.).
Project Structure
termote/
├── Makefile # Build/test/run commands
├── Dockerfile # Container image (Termote + tmux + herdr + zellij)
├── docker-compose.yml # Development from a checkout only
├── entrypoint.sh # Container entrypoint
├── docs/ # Documentation
│ └── images/screenshots/ # App screenshots
├── desktop/ # Desktop app (Wails v3), reaches the server through `termote desktop-link`
├── pwa/ # React PWA
│ └── src/
│ ├── components/
│ ├── contexts/
│ ├── hooks/
│ ├── types/
│ └── utils/
├── server/ # Go server + CLI (single binary)
│ ├── main.go # Entry point (no args = menu, `serve` = server, else CLI)
│ ├── serve.go # Server (PWA, auth, guards)
│ ├── mux.go # Mux interface + /api/mux/* routes
│ ├── mux_tmux.go # tmux/psmux backend
│ ├── mux_herdr.go # Herdr backend
│ ├── mux_zellij*.go # Zellij backend (commands, Chat view and Files)
│ ├── zellij_*.go # Termote's Zellij clients, view-only stream, a pane's shell
│ ├── mux_hc*.go, hc_*.go # herdr-core backend (hc connect client, herdr-app document)
│ ├── stream.go # Terminal WebSocket (xterm.js stream)
│ ├── agent_*.go # Chat view, session history, tokens and cost (Claude Code, Codex, OpenCode)
│ ├── job_*.go, ask_*.go # The orchestrator's job ledger and its questions for the user
│ ├── skills/ # The orchestrator skill (`termote skills install`, termote-plugins)
│ ├── cli*.go # start/stop/update/container/logs/menu subcommands
│ └── webui/ # PWA embedded in the binary (filled by make build)
├── scripts/
│ ├── install.sh # Unix online installer (curl | sh)
│ ├── install.ps1 # Windows online installer (irm | iex)
│ ├── termote.sh # Unix shim: builds and runs a checkout
│ ├── termote.ps1 # Windows PowerShell shim: builds and runs a checkout
│ ├── termote-plugins.sh # Writes the termote-plugins marketplace at each stable release
│ └── package-desktop.sh # Builds and packages the desktop app for one platform
├── tests/ # Test suite
│ ├── test-termote.sh # Unix shim tests
│ ├── test-termote.ps1 # Windows shim tests
│ ├── test-install.sh # Unix installer tests
│ ├── test-install.ps1 # Windows installer tests
│ └── test-entrypoints.sh # Container entrypoint tests
├── herdr-plugin/ # Herdr plugin (open a pane in Termote, QR code, start/stop)
├── video/ # Remotion intro video
└── website/ # Astro Starlight docs site
└── src/content/docs/ # MDX documentation
Development
make build # Build the PWA and embed it in server/termote
make test # Run all tests
make health # Check service health
make clean # Stop containers
make build-desktop # The desktop app (needs the system libraries in desktop/README.md)
make test-desktop # Its tests (not part of make test, same libraries)
# E2E tests (requires running server)
./scripts/termote.sh start # Start server first
pnpm --filter termote test:e2e # Run Playwright tests
pnpm --filter termote test:e2e:ui # Run with UI debugger
Manual Testing: See Self-Test Checklist
Troubleshooting
Session not persisting
- Check tmux:
tmux ls - Termote attaches with
tmux new-session -A(attach-or-create)
WebSocket errors
- Check termote logs:
termote container logs(container) ortermote logs server(native) - The terminal WebSocket is
/api/mux/stream, served by Termote itself — there is no separate terminal process to check
Mobile keyboard issues
- Ensure viewport meta tag is present
- Test on real device, not emulator
Native mode: server not starting
termote status # What the running server reports
termote logs server # Or: termote logs follow
lsof -i :7680 # Check what holds the port
termote start --fresh # If the saved password can no longer be read
Security Notes
- Default: localhost only - not exposed to LAN unless
--lanflag used - Basic auth enabled by default - use
--no-authto disable for local dev; the password is created by the firsttermote startand saved encrypted - Host allowlist: requests with an unrecognised
Hostheader are rejected (DNS-rebinding protection); add trusted names with--allow-host, there is no wildcard to turn the check off - Origin/CSRF guards: state-changing
/api/mux/*requests and the/api/mux/streamWebSocket reject cross-siteSec-Fetch-Site/Originand require a same-origin, single-use stream token - Built-in brute-force protection - rate limiting (5 failed attempts/min per IP, 20/min per IPv6 /64)
- Herdr backend: exposes every Herdr workspace on the host, so
--mux herdr --no-authis refused unless--allow-herdr-no-authis also given - Zellij backend: exposes every running Zellij session of the user, as tmux does (no extra
--no-authguard); keys and Chat messages reach a pane only through a Termote Zellij client's terminal, never through process arguments other local users could read - herdr-core backend: herdr-core has no login of its own, so
--mux hc --no-authis refused unless--allow-hc-no-authis also given, andcontainer up --mux hcis refused - Service files hold no secrets: the systemd unit, launchd agent and Scheduled Task never contain the password
- Use HTTPS (Tailscale) for production
- Restrict to trusted networks/VPN
- What a signed-in or paired device can do, and what to do when one is lost: Security model
Other Projects
| Project | Description |
|---|---|
| GitHub Flex | A cross-browser extension (Chrome & Firefox) that enhances GitHub's interface with productivity features |
| TabRest | Chrome extension that automatically unloads inactive tabs to free memory |
| Specpin | Pin living, Git-versioned business specs onto the elements of your running web UI (browser extension + Go sidecar) |
License
MIT
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…
