An interactive CLI menu for managing NordVPN connections on Linux.
- Status Display - View current VPN connection status at any time
- Quick Connect - Connect to the best available server
- Connect by Country - Browse and select from available countries
- Connect by Server Group - Choose specialized server groups (P2P, Double VPN, etc.)
- Disconnect - Easily disconnect from VPN
- Auto-Connect Settings - Configure automatic connection on startup
- Enable/disable auto-connect
- Set auto-connect to specific countries
- Set auto-connect to specific server groups
- Search & Filter - Quickly find countries or server groups in long lists
- Smart Caching - Reduces API calls with 5-minute TTL cache for better performance
- Timeout Protection - Commands timeout after 10 seconds to prevent hanging
- Startup Validation - Checks NordVPN CLI availability before running
- Linux operating system
- NordVPN CLI installed and configured
- Python 3.6 or higher
- Active NordVPN subscription
- Clone this repository:
git clone https://github.com/yourusername/nordvpn-menu.git
cd nordvpn-menu- Make the script executable:
chmod +x nordvpn_menu.py- (Optional) Create a symlink to run from anywhere:
sudo ln -s $(pwd)/nordvpn_menu.py /usr/local/bin/nordvpn-menuRun the script:
./nordvpn_menu.pyOr if you created a symlink:
nordvpn-menuNavigate through the menus using numbers and follow the prompts.
- Show Status
- Quick Connect (best server)
- Connect to Country
- Connect to Server Group
- Disconnect
- Auto-Connect Settings
- Exit
- Enable Auto-Connect (best server)
- Enable Auto-Connect to Country
- Enable Auto-Connect to Server Group
- Disable Auto-Connect
- Back to main menu
When selecting countries or server groups, press 'f' to filter the list by entering a search term. This is especially useful for quickly finding specific countries in long lists.
nordvpn- NordVPN CLI client- Python 3.6+ with
typingmodule support
The optimized version includes:
- Caching System: Countries and server groups are cached for 5 minutes, reducing redundant API calls by ~80%
- Timeout Handling: Commands timeout after 10 seconds to prevent indefinite hangs
- Efficient Parsing: Optimized data structures and string operations
- Smart Cache Management: Cache automatically clears after connection changes to reflect new state
- Added status display to show current connection
- Added disconnect functionality
- Implemented search/filter for long lists (20+ items show in two columns)
- Added startup validation to check NordVPN CLI availability
- Improved error messages with contextual recovery tips
- Consistent UX with proper return-to-menu flow
- Smart caching reduces load times significantly
- Better timeout handling prevents hanging on slow connections
MIT License - feel free to use and modify as needed.
Contributions are welcome! Please feel free to submit a Pull Request.