Overview
The Remote CLI Server lets you use AI coding assistants like Claude Code and Codex directly from your web browser, from anywhere. Instead of being tied to a local terminal, you run a lightweight server on your computer and connect to it through a secure Cloudflare Tunnel.
This system is perfect for working on the go, using a tablet or phone to monitor long-running AI tasks, or sharing your coding environment across devices without any complex setup.
The system has three components that work together:
- CLI Server — Runs on your computer and manages terminal sessions for Claude Code and Codex.
- Tunnel Manager — Creates secure public URLs so you can access your server from anywhere.
- Terminal Client — A web page that connects to your server and gives you a full terminal in the browser.
How It Works
Here is how the three pieces connect together:
Terminal Client
Browser-based interface on any device
Your BrowserCloudflare Tunnel
Secure encrypted connection to your machine
The InternetCLI Server
Runs Claude Code & Codex in real terminals
Your ComputerData flows in real-time through the encrypted tunnel. Your keystrokes go in, terminal output comes back.
The CLI Server uses node-pty to spawn real pseudo-terminal processes, which means Claude Code and Codex behave exactly as they would in a native terminal — full color support, interactive prompts, and all.
The Tunnel Manager wraps the Cloudflare cloudflared tool and gives you an easy web UI for starting and stopping tunnels. Each time you start a tunnel, you get a fresh public URL.
The Terminal Client is a single HTML page powered by xterm.js that renders the terminal in your browser. It connects over WebSocket and sends keystrokes in real-time.
Prerequisites
Before starting, make sure you have the following installed on the computer that will run the server:
-
Node.js (version 16 or later) — Download from nodejs.org
-
Claude Code and/or Codex CLI installed and available in your system PATH.
-
Cloudflare
cloudflared(for remote access) — Install with:winget install Cloudflare.cloudflared -
A modern web browser (Chrome, Edge, Firefox, or Safari)
Download
Download the components you need. Each download is a zip file containing everything required for that piece.
Download All
Complete package with all three components
8 filesCLI Server
Terminal backend for your computer
4 filesTunnel Manager
Remote access via Cloudflare Tunnels
3 filesTerminal Client
Browser-based terminal interface
1 fileSetup: CLI Server
The CLI Server runs on your computer and manages terminal sessions. It listens on port 3600 and communicates with the Terminal Client over WebSocket.
Create a folder (e.g. CLIServer) and extract the downloaded files into it. You should have:
CLIServer/
├── cli-server.js
├── package.json
├── password.txt
└── Start CLI Server.bat
Open password.txt in any text editor and replace the default password with something secure. This password protects your terminal from unauthorized access.
Double-click Start CLI Server.bat. On the first run, it will automatically install the required Node.js packages (node-pty and ws).
Checking for Node.js...
Installing dependencies...
Terminal backend: node-pty (full PTY support)
Password loaded
========================================
CLI Server (password protected)
========================================
UI: http://localhost:3600
Press Ctrl+C to stop
========================================
node-pty fails to install, you may need Visual Studio Build Tools. Run: npm install --global windows-build-toolsSetup: Tunnel Manager
The Tunnel Manager creates secure public URLs using Cloudflare Tunnels, allowing you to access your CLI Server from anywhere on the internet. Skip this section if you only need local access.
Open a command prompt and run:
winget install Cloudflare.cloudflared
This installs cloudflared which creates encrypted tunnels to your local services.
Create a folder (e.g. TunnelManager) and extract the downloaded files:
TunnelManager/
├── tunnel-manager.js
├── index.html
└── Start Tunnel Manager.bat
Double-click Start Tunnel Manager.bat. The web UI will open at http://localhost:3500.
In the Tunnel Manager UI:
- Click "+ New Tunnel"
- Enter name:
CLI Server - Enter port:
3600 - Click "Add", then click "Start"
After a few seconds, a public URL will appear (e.g. https://random-words.trycloudflare.com). Copy this URL — you will use it in the Terminal Client.
Connecting Everything
Here is the complete startup workflow, from scratch to coding:
Double-click Start CLI Server.bat. Confirm you see "UI: http://localhost:3600" in the console.
Double-click Start Tunnel Manager.bat. Add a tunnel for port 3600 and start it. Copy the public URL when it appears.
Open the CLI Server Terminal tool. Enter the tunnel URL (or http://localhost:3600) and your password, then click Connect.
Use the directory browser to navigate to your project folder. Choose either Claude Code or Codex, then click "Start". The AI assistant will launch in a full terminal right in your browser.
Features
The Remote CLI Server includes everything you need for a productive remote coding experience:
Multiple Sessions
Run multiple Claude Code or Codex instances in parallel tabs on the same page.
Persistent Sessions
Sessions survive page refreshes and reconnections. Close your browser and come back later — your session is still running.
Tab Management
Rename tabs with a double-click and drag-and-drop to reorder them.
Directory Browser
Browse your server's filesystem with quick-access shortcuts to Desktop, Documents, and Downloads.
Batch Input Mode
Toggle batch mode to buffer keystrokes and send them every 500ms, ideal for slow connections.
Password Protected
Simple password authentication keeps your terminal sessions private and secure.
Full Terminal
Powered by xterm.js with 256-color support, cursor positioning, and all ANSI escape codes.
Mobile Friendly
Responsive design works on phones and tablets for monitoring on the go.
Troubleshooting
Common issues and their solutions:
This means the CLI tool (Claude Code or Codex) is not installed or not in your system PATH. Make sure you can run claude --version or codex --version in a regular command prompt. If the command is not found, reinstall the CLI tool and ensure it is added to your PATH.
Check that password.txt does not have trailing spaces or extra lines. The server reads only the first line and trims whitespace. Try restarting the CLI Server after editing the password file.
Verify that the CLI Server is running and the tunnel is active. Check the Tunnel Manager UI for the current URL — tunnel URLs change each time you restart. Also make sure you are using https:// for the tunnel URL (not http://).
node-pty requires native compilation tools on Windows. Install them with:
npm install --global windows-build-tools
Then delete the node_modules folder in the CLI Server directory and run Start CLI Server.bat again.
Try refreshing the page. The terminal will reconnect and replay the last 100KB of buffered output. If the issue persists, try a different browser. Chrome and Edge generally have the best xterm.js compatibility.
Make sure cloudflared is installed correctly. Try running it manually in a command prompt:
cloudflared tunnel --url http://localhost:3600
If cloudflared is not found, check that it is in your PATH. The default install location on Windows is C:\Program Files (x86)\cloudflared\.