terminal ui to control wifi
  • Go 93.8%
  • Nix 3.4%
  • Shell 2%
  • Makefile 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-04 01:02:20 +05:30
.github/workflows Fix GitHub Actions versions in release workflow 2026-09-04 00:58:27 +05:30
internal Optimize splitTerse and preserve trailing backslashes 2026-09-04 00:58:31 +05:30
.envrc Add direnv integration for the dev shell 2026-08-31 23:23:09 +05:30
.gitignore Ignore nmt in .gitignore 2026-09-04 00:34:02 +05:30
.SRCINFO Bump version to 0.2.0 2026-09-04 01:02:20 +05:30
flake.lock Add nix flake for reproducible builds 2026-08-31 23:23:08 +05:30
flake.nix Bump version to 0.2.0 2026-09-04 01:02:20 +05:30
go.mod Scaffold Go module and nmcli wrapper with terse-mode parser 2026-08-31 22:12:12 +05:30
go.sum Scaffold Go module and nmcli wrapper with terse-mode parser 2026-08-31 22:12:12 +05:30
LICENSE Add MIT license 2026-08-31 22:12:41 +05:30
main.go Bump version to 0.2.0 2026-09-04 01:02:20 +05:30
Makefile Add Makefile with build and check targets 2026-08-31 23:23:08 +05:30
PKGBUILD Bump version to 0.2.0 2026-09-04 01:02:20 +05:30
README.md Document CLI flags and Esc clear filter keybinding in README 2026-09-04 00:58:32 +05:30

nmtui

A terminal UI for managing Wi-Fi with NetworkManager, built with bubbletea.

Features

  • List nearby networks with signal strength, security, and channel
  • Scan on demand (r)
  • Connect to networks — reuses saved profiles automatically, only prompts for a password when the network has no saved profile yet
  • Disconnect (d), forget saved networks (f)
  • Toggle Wi-Fi radio on/off (t)
  • Live status bar: radio state, active connection, and IP address
  • Filter the network list (/)

Requirements

  • Linux with NetworkManager (networkmanager package on Arch)
  • nmcli in $PATH
  • An active session (polkit grants Wi-Fi management without root on desktop sessions like KDE)

Build

go build -o nmtui .

Reproducible build with Nix

flake.nix pins nixpkgs and the Go toolchain through flake.lock, so every build uses an identical dependency set regardless of the host system:

nix build             # binary at ./result/bin/nmtui
nix flake check       # builds the package and runs the test suite in the sandbox
nix run .             # run the TUI straight from the flake

If you use direnv, direnv allow once — every shell in this directory then automatically uses the pinned dev shell (Go 1.27, gopls, make) via nix-direnv:

direnv allow
go version            # reports the toolchain from the flake, not the system
make build            # or: make check (vet + tests), make run, make install

Usage

./nmtui [flags]

Flags

Flag Description
-i, --interface <name> Wi-Fi interface to manage (e.g. wlan0)
-v, --version Print version information and exit
-h, --help Show help information and exit

Keybindings

Key Action
↑/k ↓/j navigate networks
enter connect
r rescan
t toggle Wi-Fi on/off
d disconnect current network
f forget selected network's saved profile
/ filter networks
esc clear active filter / dismiss message
q / ctrl+c quit

Notes

  • If a saved profile has a stale password, connect will fail — press f to forget the network, then enter to reconnect with the correct password.
  • Hidden networks appear as (hidden network) and cannot be joined from the list; create a profile for them once via nmcli and they will show up normally afterwards.

Layout

main.go              entry point
internal/nm/         nmcli wrapper (exec, terse-mode parsing, actions)
internal/ui/         bubbletea model, keybindings, styles