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 ptn@latest
uv tool uv tool install ptn ptn -U
pipx pipx install ptn ptn -U
pip pip install ptn ptn -U

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.6.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.6-py3-none-any.whl (203.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ptn-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 e3bf785cb190b6ae5a0b745e7ca1d1745e28399a9f34a6746dce74746e228ae3
MD5 f1938a5fe5f92ee69f972ae9c373718b
BLAKE2b-256 d26912e4ef4548bd041d2f538b45796af5a6fcbbb3ec2ae4393b3d3a9aebbc69

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptn-0.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: ptn-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f1784276c0c2a8dcc1b2ee14bde3746ab8e36f7eff987aca161761b3f2f5f9cf
MD5 ed0ceae0fe990f6f04ca64ee9e214bd0
BLAKE2b-256 24aba85c03e065b1c9553e75ff9afcbbd5c2f582d915ab38cac8e2abd76bcf6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptn-0.1.6-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