leftopen README

The project's README from github.com/SonghaiFan/leftopen. As one markdown file: README.md.

LeftOpen Logo

LeftOpen

Native macOS Menu Bar Port Manager & CLI

See what your tools left running on localhost, identify projects, and gently close them.

Website Release Homebrew Cask macOS 14+ Apple Notarized License: MIT

English · 中文


LeftOpen menu bar panel: closable ports first, apps and system services folded away

When I have several coding agents working in parallel, dev servers and test runners keep starting up on different ports. By the end of the day there are always a few still running.

Existing tools are either too much, or only tell you "port in use" without saying which process it is or which project it came from.

So I made LeftOpen. It sits quietly in the menu bar and shows you the listening ports, the processes behind them and the projects they probably belong to. Once you've had a look, you close the ones you no longer need.

Close the doors that were left ajar, gently.


Installation

brew install --cask songhaifan/tap/leftopen

Supports Apple Silicon and Intel Macs running macOS Sonoma (14.0+). The app and bundled CLI are universal binaries, signed with a Developer ID and notarized by Apple.

Manual download

Get LeftOpen-release.zip from GitHub Releases, unzip, and move LeftOpen.app to /Applications.


Design & Features


Fixed project addresses

Dev servers move between ports; their address doesn't have to. LeftOpen bundles Portless 0.15.7 and Node 24.14.0, so there's nothing extra to install.

  1. One-time setup: Turn on Settings → Projects → Fixed addresses. macOS asks for authorization to trust a local CA, install a loopback-only HTTPS service on the selected proxy port (443 by default), and manage exact /etc/hosts entries. Only explicit Settings actions ask; project actions and background scans never do.
  2. Per project: start the project as usual, then click Enable fixed address in its port details. It's reachable at https://myapp.localhost.

How it behaves:

Earlier HTTP addresses keep working; finish the HTTPS upgrade from the same Settings page. Portless (Apache-2.0) and Node ship with their licenses.

Address settings: Settings → Projects has a single fixed-address row, with no manual port configuration. Initial setup prefers 443, automatically trying 8443–8462 on conflict within the same authorization. Successful setup remembers the selected port and includes it in opened/copied URLs. Other listeners are never stopped; failures retain copyable diagnostics. Ports are not automatically migrated while LeftOpen-launched projects run. Turning off removes managed routes but preserves bindings, certificates and the proxy without stopping project servers; stop LeftOpen-launched projects first.


Why LeftOpen? (Common Use Cases)


CLI

Available in the terminal right after installing:

# List every listening port and its owner (or: leftopen list)
leftopen

# Explain one port
leftopen 3000

# Open http://localhost:3000 in the default browser
leftopen open 3000

# Print a project's verified fixed address (e.g. https://myapp.localhost)
leftopen url myapp

# Close the process on a port (SIGTERM, asks first)
leftopen close 3000

# Structured JSON output
leftopen --json

Sample output:

LEFT OPEN
26 listening ports · 17 processes · 1 projects · 8 LAN-visible

MY PROJECTS (2)
PORT    PID      OWNER          PROCESS    AGE      SCOPE
5173    76344    visdelta       node       2h       LOCAL
         ↳ ~/Documents/visdelta
5511    4999     visdelta       node       27m      LOCAL
         ↳ ~/Documents/visdelta

APPLICATIONS (16)
PORT    PID      OWNER          PROCESS    AGE      SCOPE
5000    696      ControlCenter  Control    3d       LAN
9222    36824    Google Chrome  Chrome     5h       LOCAL

SERVICES (3)
PORT    PID      OWNER          PROCESS    AGE      SCOPE
11434   911      Ollama         ollama     1d       LOCAL

LOCAL = this Mac only · LAN = may be reachable from your local network

Development

Maintainers: one-click releases.

# Tests
swift test

# Build the app locally
LEFTOPEN_OUTPUT_DIR=dist/dev Scripts/build-app.sh

License

MIT License

leftopen (SonghaiFan/leftopen)

Searching Database…

这是什么?LeftOpen 是一个原生 macOS 菜单栏应用和 CLI,显示 localhost 上有哪些端口在监听,识别每个端口属于哪个项目或进程,并让你温和地关闭它们。
它只是个图形界面,还是也附带命令行工具?两者都有:一个 SwiftUI 菜单栏应用(MenuBarExtra,无 Dock 图标),以及一个内置的 「leftopen」 CLI,两者遵循相同的推断和安全规则。
试用之前需要 Homebrew 或别的东西吗?它要求 Apple Silicon 或 Intel 上的 macOS Sonoma(14.0+);推荐用 Homebrew 安装,但手动下载 zip 也可以。
它如何决定何时强制结束进程?它总是先尝试 SIGTERM 并重新核对进程身份;如果 5 秒后进程仍在监听,在两分钟内再次关闭会作为刻意的第二步操作升级为 SIGKILL。
它在 Intel Mac 上也能用吗,还是只支持 Apple Silicon?可以,它是通用二进制,在 Apple Silicon 和 Intel Mac 上都能运行,只要系统是 macOS Sonoma 或更高版本。
它会偷偷联网回传或跟踪什么吗?默认没有遥测,也没有后台服务;唯一的外发请求是每天检查一次最新的 GitHub release,可以在设置中关闭。
它如何判断某个端口属于哪个项目?它会从进程的工作目录逐级向上查找 .git、package.json、pyproject.toml、Cargo.toml 或 go.mod,或者解析出所属的 .app;它还能认出全局 npm/python 模块以及 Redis、Postgres、Ollama 这类独立服务。
它和 lsof 或 kill-port 有什么不同?那些工具只能报告原始 PID 或含义模糊的进程名,而 LeftOpen 会追踪工作目录和项目根目录来展示完整上下文,并采用带身份复核的优雅 SIGTERM,而不是简单粗暴的 kill -9。
固定项目地址功能是什么?它由内置的 Portless 驱动,为开发服务器提供一个稳定的本地 HTTPS URL,即使底层端口在多次重启之间发生变化,URL 也保持不变。
它能判断某个端口是否暴露给局域网吗?可以,它能区分仅绑定 127.0.0.1(仅本机)的端口和绑定 0.0.0.0 或局域网地址的端口,帮你发现意外的网络暴露。
Creator
SonghaiFan
Size
3.3 MB
Stars
129
Age
1mo
Commits · 90 Days