Open Source CLI Tool

Control-Terminal

Run local AI agents with a web terminal using tmux + ttyd. Control Claude, Codex, or any CLI agent from your mobile phone.

Session Persistence
Mobile Access
Cloudflare Tunnel

How It Works

Three proven tools combined into one smooth workflow for AI-agent sessions.

tmux

Session Persistence

Your agent keeps running on your machine even if your phone disconnects, screen locks, or the network changes. Reconnect anytime.

ttyd

Browser Access

Turns your terminal into a web UI you can open from any device. Interact with the exact tmux session, not a separate shell.

cloudflared

Remote Access

Gives you a shareable public URL instantly without manual router or NAT setup. Access your agent from anywhere.

AI Agenttmux sessionttyd web UIcloudflared tunnelYour Phone

Step-by-Step Walkthrough

From install to controlling an AI agent on your phone in under a minute.

1

Install Control-Terminal

Run the one-line install command. It downloads the script, installs dependencies (tmux, ttyd), and adds control-terminal to your PATH. You are ready to go in seconds.

Terminal showing the install process: curl command, dependency checks, and installation complete message
2

Choose Your Agent and Launch

Run control-terminal, pick an agent (Codex, Claude, or custom), and optionally enable the Cloudflare tunnel for remote access. The tool starts a tmux session, launches ttyd, and prints your local and public URLs.

Terminal showing agent selection menu, Cloudflare tunnel activation, public URL, and ttyd launch logs
3

Access from Desktop Browser

Open the generated Cloudflare tunnel URL in any desktop browser. You get a full interactive terminal session with your AI agent running live. Give it tasks, approve commands, and watch it work.

Desktop browser showing Codex agent running through a Cloudflare tunnel URL, creating a Python file
4

Control from Your Phone

Open the same URL on your mobile phone. The terminal is fully interactive: type prompts, approve actions, and manage your agent from anywhere. If your connection drops, reconnect without losing progress.

Mobile phone browser showing full Codex interaction: creating files, running Python scripts, and getting output
5

Real Results on Your Machine

Everything the agent does happens on your local machine. Files are created, code is executed, and changes persist. Here the agent created a Python file that is visible in the local file explorer.

Windows file explorer showing the test_1.py Python file created by the Codex agent in the projects folder
6

Control from Your Telegram

Open the chat on your telegram. It is fully interactive:type prompts, approve actions, and manage your agent from anywhere. If your connection drops, reconnect without losing progress.

Control-Terminal now supports running prompts from Telegram directly into the selected local agent session (Codex / Claude / custom).

Quick Start

Two commands to get up and running.

Install
curl -fsSL https://raw.githubusercontent.com/kumar045/Control-PC-Terminal/main/install.sh | bash
Run
control-terminal

Agent Selection

After running the command, you will be prompted to choose an agent:

Choose which agent to run:

1) codex

2) claude

3) other

After selecting, Control-Terminal starts the agent in a tmux session, exposes it via ttyd at http://localhost:7681, and optionally creates a Cloudflare tunnel for remote access.


Authentication

Protect your web terminal with browser-level login. Set a username and password so only you can access your agent session.

Browser Login Enforced

When authentication is enabled, the browser will prompt for credentials before granting access to the terminal.

How to Enable

During setup, Control-Terminal will prompt you to set a username and password. These credentials are used by ttyd to enforce HTTP Basic Authentication on the web terminal.

Set authentication for web terminal:

Username: your_username

Password: ********

Authentication enabled. Browser login required.

Once set, anyone opening the terminal URL (local or via Cloudflare tunnel) will see a browser login dialog. Only users with the correct credentials can access the session.

Secure Remote Access

Even when exposed via a public Cloudflare tunnel URL, your terminal is protected behind a login wall.

User-Defined Credentials

You choose your own username and password during setup. No third-party accounts or tokens required.


OS Support

Control-Terminal runs on Linux natively and on Windows through WSL.

Linux

Supported directly. Install and run Control-Terminal on any Linux distribution — no extra setup required.

Fully supported

Windows

Use WSL (Windows Subsystem for Linux) and run Control-Terminal inside your WSL distro.

Via WSL