Skip to content

ttasc/gonmtui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gonmtui 🌐

Go Version Platform License: MIT

A modern, fast, and statically-compiled Text User Interface (TUI) for NetworkManager.

gonmtui is a reimagined alternative to the classic nmtui, built from the ground up using Go and the Charm (Bubbletea) ecosystem. Instead of relying on heavy C-bindings (libnm) and ncurses, gonmtui acts as a robust wrapper around the nmcli executable, delivering a beautiful, bloat-free, and real-time experience.

gonmtui demo

✨ Features

  • Modern & Responsive UI: Built with Elm Architecture (TEA) for smooth scrolling, collapsible sections, and zero UI-blocking.
  • 100% Statically Linked: No glibc, ncurses, or CGO dependencies. Just a single binary that works on any Linux distribution (Alpine, Arch, Ubuntu, etc.) as long as nmcli is present.
  • Suckless Design: Stripped away rarely-used enterprise features (VLAN, Bridge, Bond, MACsec) to focus purely on what 99% of personal users need: Wi-Fi, Ethernet, and IPv4/IPv6.
  • Real-time Monitoring: Automatically updates connection states, signal strength, and active interfaces when cables are plugged or Wi-Fi drops, without manual refreshing.
  • Smart Dual-Mode List: Press t to seamlessly toggle between Scan Mode (nearby Wi-Fi APs) and Manage Mode (saved connection profiles).
  • Accent-Agnostic Search: Search for network names without worrying about Vietnamese/Unicode accents (e.g., typing "tram" matches "Trâm").
  • Centralized Popup System: Clean error handling and password prompting via modal overlays—no more terminal crashes.

🤔 Why gonmtui?

The original nmtui is a fantastic tool, but it has some drawbacks for modern minimal systems:

  1. It is dynamically linked to several C libraries, making it hard to drop into minimal containers or immutable OS environments.
  2. The UI feels a bit dated and lacks real-time responsiveness without manual intervention.

gonmtui solves this by leveraging nmcli's standard output with a custom, ultra-safe parser (handling nmcli's escape characters flawlessly) and bringing a highly reactive UI.

🚀 Installation

Pre-compiled Binaries

Check the Releases page for ready-to-use static binaries for amd64 and arm64.

Build from Source

Ensure you have Go installed (1.21+ recommended), then run:

git clone https://github.com/ttasc/gonmtui.git
cd gonmtui
make build

This will generate a statically linked binary in the build/ directory. You can move it to your PATH:

sudo mv build/gonmtui /usr/local/bin/

⌨️ Keybindings

gonmtui is designed for keyboard-centric workflows.

Keybinding Context Action
Tab Global Switch focus between List, Properties, and Global Info panels.
t List Focused Toggle between Scan Mode (Wi-Fi) and Manage Mode (Saved Profiles).
r List Focused Force reload / Rescan Wi-Fi networks.
/ List Focused Open the search/filter bar.
Enter List Focused Scan Mode: Connect to Wi-Fi.
Manage Mode: Activate/Deactivate network.
Ctrl + A Global Add a new connection profile (Wi-Fi / Ethernet).
Ctrl + E Manage Mode Open the Connection Editor for the selected profile.
Ctrl + D Manage Mode Delete the selected profile.
Ctrl + C Global Quit application gracefully.

In the Connection Editor:

  • Up / Down (or Ctrl+K / Ctrl+J): Move between fields.
  • Left / Right (or Ctrl+H / Ctrl+L): Change values in < Dropdown > fields.
  • Space: Toggle checkboxes [x] or Collapse/Expand [-] sections.

🏗️ Architecture

  • Backend: internal/nmcli acts as an asynchronous execution engine. It strictly runs nmcli in terse (-t) and tabular/multiline (-m) modes, utilizing a custom rune-by-rune state machine to safely parse escaped characters (e.g., \: in MAC addresses).
  • UI: internal/ui follows The Elm Architecture using Bubbletea. UI elements are completely decoupled from network logic, relying on Go Channels and tea.Cmd to communicate.

📝 Requirements

  • Linux operating system.
  • NetworkManager installed and running.
  • nmcli available in the system PATH.
  • (Optional) sudo privileges for modifying profiles or setting the system hostname.

📄 License

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

About

A modern, fast, and statically-compiled Text User Interface (TUI) for NetworkManager.

Topics

Resources

License

Stars

Watchers

Forks

Contributors