Skip to main content

Web-based terminal accessible from phone via Cloudflare Tunnel

Project description

Porterminal - Vibe Code From Anywhere

PyPI Python Downloads License CI

1. uvx ptn
2. Scan the QR
3. Access your terminal from your phone

Porterminal demo

Why

I wanted to vibe code from bed.

ngrok requires registration and the free tier sucks. Cloudflare Quick Tunnel works great but is hard to use directly on the phone. Termius requires complicated setup: port forwarding, firewall rules, key management... Tried Claude Code web, but it can't access my local hardware and environment. Also tried Happy, but it's too bulky and updates lag behind.

So I built something simpler: run a command, scan a QR, start typing.

Features

  • One command, instant access - No SSH, no port forwarding, no config files. Cloudflare tunnel + QR code.
  • Actually usable on mobile - Essential buttons and gestures for everyday terminal use.
  • Multi-tab shared sessions - Run builds in one tab, tail logs in another. Sessions and tabs persist across reconnects.
  • Cross-platform - Windows (PowerShell, CMD, WSL), Linux/macOS (Bash, Zsh, Fish). Auto-detects your shells.

Install

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

One-line install (uv + ptn):

OS Command
Windows powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/lyehe/porterminal/master/install.ps1 | iex"
macOS/Linux curl -LsSf https://raw.githubusercontent.com/lyehe/porterminal/master/install.sh | sh

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
ptn -b                 # Run in background
ptn -p                 # Enable password protection
ptn -dp                # Toggle default password requirement in config
ptn -v                 # Verbose startup logs
ptn --init             # Create .ptn/ptn.yaml config
ptn -V                 # Show version
ptn -U                 # Update to latest version
ptn --check-update     # Check if update available

Configuration

Run ptn --init to create a starter config, or create ptn.yaml manually:

# Custom buttons (appear in toolbar)
buttons:
  - label: "claude"
    send:
      - "claude"
      - 100        # delay in ms
      - "\r"
  - label: "tmux"
    send: "tmux\r"

# Update checker settings
update:
  notify_on_startup: true   # Show update notification
  check_interval: 86400     # Seconds between checks (default: 24h)

# Security settings
security:
  require_password: true    # Always prompt for password at startup
  max_auth_attempts: 5      # Max failed attempts before disconnect

Config is searched in order: $PORTERMINAL_CONFIG_PATH, ./ptn.yaml, ./.ptn/ptn.yaml, ~/.ptn/ptn.yaml.

Security

Use password if your screen can be exposed to others:

ptn -p                 # Prompt for password this session
ptn -dp                # Enable password by default (toggle)

Password is per-session (never saved to disk). See docs/security.md for details.

Troubleshooting

Connection fails? Cloudflare tunnel sometimes blocks connections. Restart the server (Ctrl+C, then ptn) to get a fresh tunnel URL.

Contributing

Issues and PRs welcome.

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.3.0.tar.gz (522.7 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.3.0-py3-none-any.whl (559.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ptn-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b11c1630e645767f7a400a9b39a45e4ce530f7950731dd16e40d36765d7d3ed5
MD5 63f3e925829617a48283e54c2a916d31
BLAKE2b-256 feddfc2efa3876765879241cfc8fc0f11c733e00fe724f15aec21365a2b814a1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ptn-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 559.2 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b9fa41f9fc765f38c0e53c70556eb9766e3eb0170367a2f2758892bbd0014b0
MD5 4a1d6f8437b69df6936888f8fe207bea
BLAKE2b-256 99c7eac21d94d0c8da527bdcf96ef63dccf7789f79a656aa82f098843e98bff0

See more details on using hashes here.

Provenance

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