A small interactive CLI wrapper for VPN command-line tools.
Originally built for ProtonVPN Free, but designed to be easily adaptable to other VPN providers by swapping backend commands.
- Features
- Example: Country Selection
- Requirements
- Setup after cloning
- Installation
- Uninstall
- ProtonVPN Setup (Reference Provider)
- Usage
- Provider Configuration
- Supported VPN Providers
- Repository Structure
- Design Philosophy
- License
- Interactive country selection (arrow keys + Enter via
fzf) - Direct connect via country code
- Simple alias-free CLI (
vpn connect) - Provider-based design (ProtonVPN as reference)
- Install / Uninstall scripts with interactive dependency checks
Use β / β to navigate, type to filter, Enter to select.
- Bash (must be available on the system)
fzf(interactive selector) β if not installed,install.shcan install it for you- A supported VPN CLI tool (e.g.,
protonvpn-cli) β if not installed,install.shcan install it for you
π‘ Note: You normally do not need to install these manually. Running
install.shwill check for missing dependencies and offer to install them automatically.
You can clone directly into ~/.config/vpn-cli to simplify provider management:
mkdir -p ~/.config/vpn-cli
git clone https://github.com/alxmtzr/vpn-cli.git ~/.config/vpn-cliMake all scripts executable:
chmod +x ~/.config/vpn-cli/vpn \
~/.config/vpn-cli/install.sh \
~/.config/vpn-cli/uninstall.sh \
~/.config/vpn-cli/providers/*.shOptional: create a config file:
echo 'PROVIDER="protonvpn"' > ~/.config/vpn-cli/config~/.config/vpn-cli/install.sh- Checks for dependencies (
fzf,protonvpn-cli) individually - Prompts to install missing dependencies
- Installs
vpnglobally to/usr/local/bin
sudo cp ~/.config/vpn-cli/vpn /usr/local/bin/vpnAfter installation, the vpn command is available globally. No alias required.
Run the uninstall script:
~/.config/vpn-cli/uninstall.sh- Removes the
vpncommand - Checks if
fzforprotonvpn-cliare installed and prompts to uninstall each - Supports zypper / apt / pacman
Or manually:
sudo rm /usr/local/bin/vpnTo use the ProtonVPN provider, you must have a ProtonVPN Free account.
Login once with your ProtonVPN credentials:
vpn login
β οΈ Note: Without a ProtonVPN account, the ProtonVPN provider will not work.
vpn --helpvpn connect- Use β / β to navigate
- Type to filter
- Press Enter to connect
- Press Esc to cancel
vpn connect US
vpn connect NLvpn disconnectvpn statusThe VPN backend is abstracted via provider scripts.
Default provider:
~/.config/vpn-cli/providers/protonvpn.shTo support another VPN provider:
- Copy an existing provider script (e.g.,
protonvpn.sh) to a new file (e.g.,mullvad.sh) - Replace connect / disconnect / status commands
- Adjust available countries if needed
Example:
vpn_provider_connect() {
nordvpn connect "$1"
}| Provider | Status |
|---|---|
| ProtonVPN | β Reference implementation |
| Mullvad | β Example only |
| NordVPN | β Example only |
| OpenVPN | β Example only |
vpn-cli/ # Root of the project
βββ vpn # Main CLI script (global executable)
βββ install.sh # Installation script
βββ uninstall.sh # Uninstallation script
βββ README.md # Project README
βββ LICENSE # MIT License
βββ providers/ # Folder containing provider scripts
β βββ protonvpn.sh
βββ assets/ # Images for README
β βββ protonvpn-logo.png
β βββ country-selection.png
βββ config/ # Optional user config (created by user)
βββ config # e.g., PROVIDER="protonvpn"
Cloning directly into
~/.config/vpn-clisimplifies usage and provider management.
- Simple Bash
- No heavy frameworks
- Interactive but scriptable
- One command, predictable behavior
- Provider-based for easy extension
MIT