skillfed

nmcli

A python wrapper library for the network-manager cli client

nmcli v1.8.0 74.3K downloads/30d#14,848 on PyPI104
Permissive license MIT Active released

What it is and what it does

nmcli wraps the NetworkManager command-line interface to let Python code query and control network connections, devices, and Wi-Fi operations directly. It exposes methods to list connections and devices, connect or disconnect from networks, modify connection profiles (IP addresses, gateways, DNS), and scan or join Wi-Fi networks. The library parses nmcli output into structured Python objects, removing the need to parse shell command results manually.

The package is designed for Linux systems running NetworkManager and requires either sudo access with NOPASSWD configuration or root privileges. It supports a broad subset of nmcli functionality—connection lifecycle (up, down, delete, reload), device management (connect, disconnect, status), and Wi-Fi operations (scan, connect, hotspot)—though some advanced features like agent configuration and connection editing are not yet wrapped.

Use it for:

  • Automate Wi-Fi connection and disconnection in headless Linux applications or IoT devices
  • Programmatically configure static IP addresses and network settings without manual nmcli calls
  • Monitor device and connection status in network management or system administration tools
  • Build network provisioning scripts that query available Wi-Fi networks and connect to them
  • Manage multiple network profiles and switch between them in containerized or embedded environments

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

nmcli is a Python wrapper for the NetworkManager command-line client, allowing programmatic control of network connections, devices, and Wi-Fi operations on Linux systems.

Yes, if you need programmatic control of NetworkManager on Linux and can meet the sudo/root requirement. The package has low install friction, no external Python dependencies, active maintenance, and no known vulnerabilities. MIT licensing poses no restriction. Install only if your use case requires direct network management automation; it is not a general networking library.

Install

nmcli on PyPI

pip

pip install nmcli

uv

uv add nmcli

poetry

poetry add nmcli

Installing nmcli

Before you install

Low install friction with no runtime dependencies beyond NetworkManager itself. Active maintenance with recent commits and steady development.

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.

Quickstart

import nmcli

# List connections and devices
connections = nmcli.connection()
devices = nmcli.device()

# Connect to Wi-Fi
nmcli.device.wifi_connect('SSID', 'password')

# Modify connection settings
nmcli.connection.modify('SSID', {'ipv4.method': 'manual'})

Requires NetworkManager installed (e.g., `sudo apt install network-manager` on Debian) and a user account with sudo access to execute nmcli commands, or root privileges if `disable_use_sudo` is set.

Verify before relying

  • Whether the package works on non-Linux systems or only POSIX Linux as classifiers suggest
  • Current test coverage and stability guarantees for production network management tasks
  • Performance characteristics when managing many connections or frequent state changes

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 62 days since the last release
Last repo commit
First released
Downloads 74,346/month — #14,848 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nmcli-1.8.0-py3-none-any.whl

Operating System :: POSIX :: LinuxProgramming Language :: Python :: 3

Tags

network manager python wrapperlinux network configuration apiwifi connection management pythonnmcli python interfacenetwork device controlconnection management librarylinux networking automation
network-managementlinux-onlysystem-administration

More Networking packages