Skip to content

invisible1988/kfwd

Repository files navigation

kfwd

Kubernetes port-forward manager with multi-cluster support, automatic reconnection, and a TUI dashboard.

Note: Only tested on macOS. Linux should work but is untested.

Installation

From source

go install github.com/invisible1988/kfwd/cmd/kfwd@latest

From GitHub Releases (no Go required)

curl -sL "https://github.com/invisible1988/kfwd/releases/latest/download/kfwd_$(curl -sI https://github.com/invisible1988/kfwd/releases/latest | grep -i location | sed 's/.*tag\/v//;s/\r//')_$(uname -s | tr A-Z a-z)_$(uname -m | sed 's/x86_64/amd64/').tar.gz" | sudo tar xz -C /usr/local/bin kfwd

Or download manually from Releases.

Shell completion (zsh)

mkdir -p ~/.zsh/completions
kfwd completion zsh > ~/.zsh/completions/_kfwd

# add to .zshrc (before compinit) if not already present:
#   fpath=(~/.zsh/completions $fpath)

# Other systems — write to any directory in your $fpath:
#   kfwd completion zsh > /path/in/fpath/_kfwd

Quick start

# Interactive setup — register a cluster from your kubeconfig
kfwd setup

# Start a port-forward
kfwd run svc/my-service 8080:80

# Open the TUI dashboard
kfwd

Commands

kfwd (dashboard)

Opens the TUI dashboard showing Active, Saved, and Recent forwards. Start/stop forwards, view status, and manage bookmarks interactively.

kfwd run

Quick ephemeral port-forward (not saved as a bookmark).

kfwd run svc/my-service 8080:80
kfwd run -n my-namespace deploy/my-app 3000:3000
kfwd run -c my-cluster pod/my-pod 9090:9090

kfwd setup

Interactive wizard to register a cluster from your kubeconfig.

kfwd cluster

kfwd cluster add <name> --kubeconfig ~/.kube/config --context my-context
kfwd cluster list
kfwd cluster remove <id>

kfwd add / kfwd list / kfwd start / kfwd stop / kfwd remove

Manage saved forward bookmarks.

kfwd add          # interactive wizard
kfwd list
kfwd start <id>
kfwd stop <id>
kfwd remove <id>

kfwd status

Show daemon status and active forwards.

kfwd daemon

kfwd daemon start
kfwd daemon stop
kfwd daemon status

kfwd export / kfwd import

Export and import clusters and forward configs as JSON.

kfwd export > backup.json
kfwd import < backup.json

Architecture

kfwd runs as a background daemon communicating over a Unix socket (~/.kube-forwarder/daemon.sock). CLI commands talk to the daemon via ConnectRPC. State is stored in a local SQLite database (~/.kube-forwarder/kfwd.db).

License

MIT

About

Kubernetes port-forward manager

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages