--- id: nmcli version: "1.8.0" license: MIT license_treatment: permissive maintenance: active --- # nmcli — A python wrapper library for the network-manager cli client License: permissive · Maintenance: active · Downloads: 74.3K/mo ## 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 above — 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 pip install nmcli uv add nmcli 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_current - Install friction: low - Maintenance: active - Downloads: 74.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags network manager python wrapper, linux network configuration api, wifi connection management python, nmcli python interface, network device control, connection management library, linux networking automation, network-management, linux-only, system-administration [View on SkillFed](https://skillfed.io/packages/nmcli) · [View on PyPI](https://pypi.org/project/nmcli/)