Port Forward Manager (PFM)
PFM allows quick and easy management of ports forwarded over SSH (local or remote).
Installation
# Install tmux
brew install tmux
# Install python poetry https://python-poetry.org/docs/
brew install poetry
or
curl -sSL https://install.python-poetry.org | python3 -
# Install PFM
pip install --upgrade port-forward-manager
# If you get the error "This environment is externally managed" then you can do:
# find /opt/homebrew -name EXTERNALLY-MANAGED
#
# With the file that was found you just have to delete it or change the name like:
# sudo mv /opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/EXTERNALLY-MANAGED /opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/EXTERNALLY-MANAGED.old
Settings file is stored in ~/.ssh/pfm.settings.yaml
Configure autocomplete
Add to end of ~/.zshrc
fpath+=~/.zfunc
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
Generate autocomplete configuration
pfm --install-completion
# If gives error: ModuleNotFoundError: No module named 'pkg_resources'
# Run: pip3 install setuptools
source .zshrc
About
Settings
PFM will automatically generate a default configuration file and update new settings to their default values.
show_schema_link
Toggle the ability to show/hide the schema when showing the list of schemas.
wait_after_start
How long, in seconds, to wait after starting sessions.
table_border
Toggle the table border
show_pid
Toggle the screen PID
Example settings file:
schemas:
local_proxy:
- hostname: some.proxy.host
remote_port: 8888
type: local
remote-server:
- hostname: example.host
local_port: 1234
remote_port: 8080
type: local
- hostname: example.host
local_port: 8888
remote_port: 8888
type: local
show_pid: 'false'
show_schema_link: 'false'
table_border: 'true'
wait_after_start: '0.5'
wait_after_stop: 0.5
Commands
config
Show active sessions
forward
Start a forwarding session
schemas
List configured schemas
shutdown
Stop all active sessions
start
Start a schema of forwarding sessions
status
Show active sessions
stop
Stop sessions from active schema, host or port ###version Show installed version
Development
Setup development environment
git clone git@github.com:kxiros/port-forward-manager.git
cd port-forward-manager
poetry shell
poetry install
Building python package
python -m build
To Install development version:
pip install -e cloned_directory_path
Release
#Example to github
gh release create 1.3 dist/port-forward-manager-1.3.tar.gz -t "Minor fixes" --generate-notes
#Publish on Pypi
# Configure pypi token
# poetry config pypi-token.pypi <token>
poetry publish
Metadata
Release files for port-forward-manager 4.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| port_forward_manager-4.0.7.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| port_forward_manager-4.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.8 kB
Release files / port_forward_manager-4.0.7.tar.gz
| Download URL | port_forward_manager-4.0.7.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7890a0ca7c0a9ccafdfcf85baf8323f54a631ba8076e0266802d56ad49e89e40
|
|
BLAKE2b-256 checksum How to use checksums |
d48cb7bef37885ffdf6406c1fd2cd73058d1a06827a61f9461d2b74806c21e06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0
|
Release files / port_forward_manager-4.0.7-py3-none-any.whl
| Download URL | port_forward_manager-4.0.7-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b2ce402574bf7893badd12d4e826e3e9474f1684678d80a91a977d54423956d
|
|
BLAKE2b-256 checksum How to use checksums |
840cc9b43a01db966a634ae28bd2f7b484beb07130237423ed12c9d4aad602cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0
|