nordvpn-tui

October 8, 2024 ยท View on GitHub

nordvpn-tui is a terminal-based user interface (TUI) tool built in Rust that provides a simple and interactive way to manage NordVPN connections. The tool allows users to browse, search, and select countries and cities for VPN connection directly from the terminal using keyboard navigation.

screenshot

Features

  • Scrollable country and city list: Navigate through a list of all available countries and cities using arrow keys.
  • Search functionality: Quickly search for countries and cities.
  • Vim-like key bindings: Supports familiar keybindings such as gg to jump to the top and G to jump to the bottom of lists.
  • Keyboard-driven: Navigate and select VPN servers entirely with your keyboard.
  • Connect with ease: Instantly connect to the selected server using NordVPN's CLI.

Installation

Prerequisites

Before installing, make sure you have the following installed:

  • Rust

  • NordVPN CLI

    Ensure you have access to the NordVPN command-line tool by verifying it is installed and accessible from the terminal:

    nordvpn --version
    

Build from source

Clone the repository and build the project:

git clone https://github.com/Degra02/nordvpn-tui.git
cd nordvpn-tui
cargo build --release

To run the tool:

cargo run --release

or alternatively

./target/release/nordvpn-tui

Custom Configuration

The file config.toml contains the configuration for the tool. You can customize the following settings:

  • colors: Customize the colors of the interface.

An example file is found in the repository as config-example.toml which you can copy to $HOME/.config/nordvpn-tui/config.toml and modify as needed.

Usage

Once you start nordvpn-tui, you will be presented with a list of countries where NordVPN servers are available. You can navigate and connect using keyboard commands.

Keyboard Shortcuts

In normal mode (default):

KeyAction
K or Arrow UpMove selection up
J or Arrow DownMove selection down
EnterSelect a country/city and connect to the VPN
DDisconnect from the VPN
i or /Enter Search mode
g gJump to the top of the list
GJump to the bottom of the list
qQuit the application

In search mode:

KeyAction
<char>Add char to search query
EnterSearch with current query
BackspaceDelete last query char

Once you've selected a country (or city if available), pressing Enter will automatically connect to the selected location using NordVPN.

Contributing

Feel free to submit issues or pull requests to contribute to the development of nordvpn-tui. Contributions are welcome!

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.