port-forward-manager (pfm)
Manage multiple kubectl port-forwards from a profile file, with auto-reconnect, per-forward logs, and an at-a-glance status view.
The perpetual daily annoyance, fixed.
$ pfm up
pfm: profile ./pfm.yaml
db: svc/postgres (ns data) on 5432:5432
redis: svc/redis (ns data) on 6379:6379
api: deploy/api (ns app) on 8080:80
pfm: 3 forward(s) started.
$ pfm status
● db UP localhost:5432:5432
● redis UP localhost:6379:6379
○ api DOWN localhost:8080:80 (reconnecting)Features
- One profile file drives many kubectl port-forward processes.
- Auto-reconnect when a forward drops (rollout, node drain, laptop sleep).
- Per-forward logs and a live status view.
Install
curl -fsSL https://raw.githubusercontent.com/fabiocicerchia/port-forward-manager/main/install.sh | bashOr from a local clone:
make install # or copy `pfm` onto your PATHOr grab the released script directly:
curl -fsSLO https://github.com/fabiocicerchia/port-forward-manager/releases/latest/download/pfm
install -m 0755 pfm /usr/local/bin/pfmDependencies: bash, kubectl, nc, awk — nothing else.
Usage
Per-project ./pfm.yaml or global ~/.config/pfm/default.yaml (see pfm.example.yaml):
forwards:
- name: db
target: svc/postgres
namespace: data
ports: "5432:5432"
- name: api
target: deploy/api
namespace: app
ports: "8080:80"
context: stagingpfm up [profile] # start all forwards
pfm status # show forwards and their health
pfm logs NAME # tail one forward's log
pfm down # stop everythingEach forward is supervised: when kubectl drops the connection, pfm reconnects after PFMRECONNECTDELAY (2s default).