Skip to main content

Web-based terminal accessible from phone via Cloudflare Tunnel

Project description

Porterminal - Vibe Code From Anywhere

PyPI Python Downloads License

Access your terminal from your phone. No setup. Just scan.

uvx ptn

Scan the QR code. Start typing. That's it.


Why I Built This

I wanted to continue vibe coding after bed. I tried ngrok, but it requires registration. I tried Cloudflare Tunnel, but it doesn't provide a usable terminal UI. I tried Termius, but it comes with apps, accounts, and too much setup. I just wanted something simpler: open a browser, get a terminal, start typing.

So I built Porterminal. A mobile-first web terminal with secure tunneling, no registration, no installation on your phone, and a touch-friendly UI optimized for vibe coding with whatever AI app you want.

Features

  • One command, instant access - No SSH, no port forwarding, no config files. Cloudflare tunnel + QR code.
  • Actually usable on mobile - Virtual modifier keys (Ctrl, Alt, Tab, arrows), swipe gestures, copy/paste that works.
  • Multi-tab sessions - Run builds in one tab, tail logs in another. Sessions persist across reconnects.
  • Cross-platform - Windows (PowerShell, CMD, WSL), Linux/macOS (Bash, Zsh, Fish). Auto-detects your shells.

Installation

Method Install Update
uvx (no install) uvx ptn uvx --refresh ptn
uv tool uv tool install ptn uv tool upgrade ptn
pipx pipx install ptn pipx upgrade ptn
pip pip install ptn pip install -U ptn

Requires Python 3.12+ and cloudflared (auto-installed if missing).

Usage

ptn                    # Start in current directory
ptn ~/projects/myapp   # Start in specific folder
ptn --no-tunnel        # Local network only (no Cloudflare)
ptn -b                 # Run in background
All options
Option Description
path Starting directory (default: current)
--no-tunnel Local network only
-b, --background Run in background
-v, --verbose Detailed logs
-U, --update Update to latest
--check-update Check for updates
-V, --version Show version

Configuration

Create config.yaml in your working directory (optional):

terminal:
  default_shell: bash
  cols: 120
  rows: 30

buttons:
  - label: "git"
    send: "git status\r"
  - label: "build"
    send: "npm run build\r"
Full config options
server:
  host: "127.0.0.1"
  port: 8000

terminal:
  cols: 120
  rows: 30
  default_shell: powershell

  # Custom shells (auto-detected if not specified)
  shells:
    - id: powershell
      name: PowerShell
      command: powershell.exe
      args: ["-NoLogo"]
    - id: wsl
      name: WSL
      command: wsl.exe

buttons:
  - label: "git"
    send: "git status\r"
  - label: "ls"
    send: "ls -la\r"

Security

Warning: The URL is the only authentication. Anyone with the link has full terminal access.

Best practices:

  • Don't share the URL
  • Stop the server when not in use (Ctrl+C)
  • Use --no-tunnel for local network only

Built-in protections:

  • Environment variables sanitized (API keys, tokens stripped)
  • Rate limiting on input
  • Cloudflare Access integration for teams

Contributing

Issues and PRs welcome. This project uses uv for development:

git clone https://github.com/lyehe/porterminal
cd porterminal
uv sync
uv run ptn

License

AGPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ptn-0.1.7.tar.gz (176.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ptn-0.1.7-py3-none-any.whl (203.4 kB view details)

Uploaded Python 3

File details

Details for the file ptn-0.1.7.tar.gz.

File metadata

  • Download URL: ptn-0.1.7.tar.gz
  • Upload date:
  • Size: 176.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ptn-0.1.7.tar.gz
Algorithm Hash digest
SHA256 555eb1bae909ae08fc51a1113fccedf03b19a7c9f08405a18a74eccf418336df
MD5 bc92bd2aba605b82417c6bdcf8c566be
BLAKE2b-256 dc94c21696700776fa784c555041212328ef1bde9b471a33ea646975757f5b80

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptn-0.1.7.tar.gz:

Publisher: publish.yml on lyehe/porterminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ptn-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ptn-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 203.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ptn-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1c08c4e0c37f4778fa5dbfc66b18b24c35da6845525a872a5c93a143980141
MD5 cf428073e1783914a384d3a383624b91
BLAKE2b-256 1c9173aedc9dd1ba5c73f2129abbd56011d6ff3cd95c3426d377f0e70ca08b0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptn-0.1.7-py3-none-any.whl:

Publisher: publish.yml on lyehe/porterminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page