{"id":43957482,"url":"https://github.com/mapika/portview","last_synced_at":"2026-04-04T12:07:32.460Z","repository":{"id":336964516,"uuid":"1151843967","full_name":"Mapika/portview","owner":"Mapika","description":"See what's on your ports, then act on it. Diagnostic-first port viewer for Linux, MacOS and Windows.","archived":false,"fork":false,"pushed_at":"2026-02-10T12:37:55.000Z","size":16496,"stargazers_count":26,"open_issues_count":4,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-12T01:34:59.063Z","etag":null,"topics":["cli","devtools","linux","port","process","rust","terminal"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mapika.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-07T01:10:42.000Z","updated_at":"2026-02-11T15:57:31.000Z","dependencies_parsed_at":"2026-02-10T18:01:11.719Z","dependency_job_id":null,"html_url":"https://github.com/Mapika/portview","commit_stats":null,"previous_names":["mapika/portview"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Mapika/portview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mapika%2Fportview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mapika%2Fportview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mapika%2Fportview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mapika%2Fportview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mapika","download_url":"https://codeload.github.com/Mapika/portview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mapika%2Fportview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29379659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T19:05:20.189Z","status":"ssl_error","status_checked_at":"2026-02-12T19:01:44.216Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","devtools","linux","port","process","rust","terminal"],"created_at":"2026-02-07T05:02:21.205Z","updated_at":"2026-04-04T12:07:32.446Z","avatar_url":"https://github.com/Mapika.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# portview\n\n[![CI](https://github.com/mapika/portview/actions/workflows/ci.yml/badge.svg)](https://github.com/mapika/portview/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/portview)](https://crates.io/crates/portview)\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n**See what's on your ports, then act on it.**\n\n`lsof -i` is slow and cryptic. `ss -tlnp` is unreadable. `netstat` is deprecated. You just want to know what's on port 3000 and kill it.\n\n```bash\nportview\n```\n\nOne command. Every listening port, the process behind it, memory usage, uptime, and the full command — in a colored table. Then inspect, kill, or watch it live.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"demo.gif\" alt=\"portview demo\" width=\"100%\" loop=infinite\u003e\n\u003c/p\u003e\n\n~1 MB single binary. Zero runtime dependencies. Linux, macOS, and Windows.\n\n## Install\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/mapika/portview/main/install.sh | sh   # Linux/macOS\nirm https://raw.githubusercontent.com/mapika/portview/main/install.ps1 | iex         # Windows\nbrew install mapika/tap/portview                                                      # Homebrew\ncargo install portview                                                                # Cargo\n```\n\nOr grab a binary from [Releases](https://github.com/mapika/portview/releases).\n\n## What it does\n\n```bash\nportview                          # list all listening ports\nportview 3000                     # inspect port 3000 in detail\nportview node                     # find ports by process name\nportview watch                    # interactive TUI with live refresh\nportview watch --docker           # TUI with Docker containers as rows\nportview kill 3000 --force        # kill what's on port 3000\nportview doctor                   # diagnose port conflicts and issues\nportview ssh user@server          # inspect ports on a remote host\nportview ssh user@server watch    # remote TUI over SSH\n```\n\n## Features\n\n### Scan\n\n```\n$ portview\n╭──────┬───────┬───────┬──────┬──────────┬─────────┬────────┬─────────────────────────────────────╮\n│ PORT │ PROTO │ PID   │ USER │ PROCESS  │ UPTIME  │ MEM    │ COMMAND                             │\n├──────┼───────┼───────┼──────┼──────────┼─────────┼────────┼─────────────────────────────────────┤\n│ 3000 │ TCP   │ 48291 │ mark │ node     │ 3h 12m  │ 248 MB │ next dev                            │\n│ 5432 │ TCP   │ 1203  │ pg   │ postgres │ 14d 2h  │ 38 MB  │ /usr/lib/postgresql/16/bin/postgres │\n│ 6379 │ TCP   │ 1198  │ redis│ redis    │ 14d 2h  │ 12 MB  │ redis-server *:6379                 │\n│ 8080 │ TCP   │ 51002 │ mark │ python3  │ 22m     │ 45 MB  │ uvicorn main:app --port 8080        │\n╰──────┴───────┴───────┴──────┴──────────┴─────────┴────────┴─────────────────────────────────────╯\n```\n\n`--all` includes non-listening connections. `--wide` shows full commands. `--json` for scripting.\n\n### Watch mode (interactive TUI)\n\n```bash\nportview watch                    # live-refresh every 1s\nportview watch --docker           # Docker containers as first-class rows\nportview watch --sort mem         # sort by memory on launch\n```\n\n| Key | Action |\n|-----|--------|\n| `j`/`k`, `↑`/`↓` | Navigate rows |\n| `Enter` | Inspect port (full command, cwd, children, connections) |\n| `d`/`D` | Kill process or manage Docker container |\n| `/` | Filter across all columns |\n| `←`/`→`, `r` | Cycle sort column, reverse direction |\n| `t` | Toggle process tree view |\n| `a` | Toggle all/listening-only |\n| `q` | Quit |\n\n**Tree view** (`t`): Groups child processes under their parents with visual connectors. See which workers belong to which master process at a glance.\n\n**Detail view** (`Enter`): Shows the full unwrapped command, working directory, child process list with ports, and open connections (in `--all` mode).\n\n### Doctor\n\nDiagnose common port problems in one command:\n\n```\n$ portview doctor\n  ✓ No port conflicts\n  ✗ postgres (PID 1203) is listening on 0.0.0.0:5432 — consider binding to 127.0.0.1\n  ✓ No Docker-host conflicts\n  ✓ No stale connections\n  ✓ No high-resource listeners\n\n  1 warning found\n```\n\nChecks for: port conflicts (multiple PIDs on same port), wildcard exposure (databases on 0.0.0.0), Docker-host conflicts, stale TIME_WAIT/CLOSE_WAIT pileups, and high-memory listeners. Docker is auto-detected.\n\n`portview doctor --json` for CI integration (exit code 1 on errors).\n\n### SSH remote mode\n\nInspect ports on any machine you can SSH to:\n\n```bash\nportview ssh user@server              # one-shot scan\nportview ssh user@server watch        # full interactive TUI\nportview ssh user@server doctor       # remote diagnostics\nportview ssh user@server 3000         # inspect a remote port\nportview ssh user@server --ssh-opt \"-p 2222\"  # custom SSH port\n```\n\nRequires portview installed on the remote host. Kill actions in the remote TUI are forwarded over SSH.\n\n### Docker integration\n\nAdd `--docker` to any command. Docker-published ports appear as first-class rows:\n\n```\n$ portview --docker\n╭──────┬───────┬───────┬────────┬──────────┬────────┬────────┬───────────────────────────────────╮\n│ PORT │ PROTO │ PID   │ USER   │ PROCESS  │ UPTIME │ MEM    │ COMMAND                           │\n├──────┼───────┼───────┼────────┼──────────┼────────┼────────┼───────────────────────────────────┤\n│ 3000 │ TCP   │ 48291 │ mark   │ node     │ 3h 12m │ 248 MB │ next dev [docker:web]             │\n│ 8080 │ TCP   │ -     │ docker │ pv-nginx │      - │      - │ nginx:alpine :8080-\u003e80/tcp        │\n╰──────┴───────┴───────┴────────┴──────────┴────────┴────────┴───────────────────────────────────╯\n```\n\nPress `d` on a Docker row to **Stop**, **Restart**, or **tail Logs**.\n\n### JSON output\n\n```bash\nportview --json                   # pipe to jq, scripts, dashboards\nportview --docker --json          # includes Docker ownership data\nportview watch --json             # streaming JSON, one array per tick\nportview doctor --json            # machine-readable diagnostics\n```\n\n### Custom colors\n\n```bash\nPORTVIEW_COLORS=\"port=red,pid=magenta,command=bright_cyan\" portview\n```\n\nColumns: `port`, `proto`, `pid`, `user`, `process`, `uptime`, `mem`, `command`. Use `--no-color` to disable.\n\n## How it works\n\nAll data is read directly from the OS — no shelling out to `lsof`, `ss`, or `netstat`.\n\n| Field | Linux | macOS | Windows |\n|-------|-------|-------|---------|\n| Ports | `/proc/net/tcp{,6}`, `udp{,6}` | `proc_pidfdinfo` | `GetExtendedTcp/UdpTable` |\n| PID | inode→pid via `/proc/*/fd/` | `proc_listpids` | Included in socket table |\n| Process | `/proc/\u003cpid\u003e/comm` | `proc_pidpath` | `QueryFullProcessImageNameW` |\n| Memory | `/proc/\u003cpid\u003e/status` VmRSS | `proc_pidinfo` | `K32GetProcessMemoryInfo` |\n| Uptime | `/proc/\u003cpid\u003e/stat` | `proc_pidinfo` | `GetProcessTimes` |\n\nDocker integration queries `docker ps` when `--docker` is passed. SSH mode runs `portview --json` on the remote host via the system `ssh` binary.\n\n## Why not...\n\n| Tool | What's missing |\n|------|---------------|\n| `lsof -i :3000` | Different flags per OS, cryptic output, slow |\n| `ss -tlnp` | Unreadable, no uptime/memory/docker, no TUI |\n| `netstat` | Deprecated on modern Linux, limited info |\n| `fkill-cli` | Requires Node.js, kill-first not diagnostic-first |\n| `procs` | General process viewer, not port-centric |\n\nportview is **diagnostic-first**: understand what's on your ports, then act.\n\n## Building from source\n\n```bash\ngit clone https://github.com/mapika/portview\ncd portview\ncargo build --release\n```\n\nRequires Rust 1.85+ (edition 2024). Shell completions and man page are generated at build time.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.\n\n## Limitations\n\n- **Linux:** Other users' processes require `sudo` (needs `/proc/\u003cpid\u003e/fd/` access)\n- **macOS:** Other users' processes may require `sudo`\n- **Windows:** Some system processes not accessible. Kill always force-terminates. Run as Administrator for full visibility.\n- **Docker:** Requires `docker` CLI and daemon access\n- **SSH:** Requires portview installed on the remote host\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapika%2Fportview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapika%2Fportview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapika%2Fportview/lists"}