Simple command-line tool to create and manage Wi-Fi hotspots using NetworkManager.
- Simple and fast hotspot creation with a single command
- NetworkManager integration using nmcli
- Configuration management with persistent settings
- Status monitoring for active hotspots
- Colored terminal output for better readability
- WPA2 password protection
- Support for both 2.4GHz and 5GHz bands
- Arch Linux (or any Linux distribution)
- NetworkManager
- A wireless network interface that supports AP mode
nm-hotspot-cli/
├── src/
│ └── nm-hotspot # Main executable script
├── scripts/
│ ├── install.sh # Installation script
│ └── uninstall.sh # Uninstallation script
├── docs/
│ ├── CONTRIBUTING.md # Contribution guidelines
│ ├── QUICKREF.md # Quick reference guide
│ └── HACKTOBERFEST_ISSUES.md # Issue templates
├── .github/
│ └── workflows/ # CI/CD workflows
├── Makefile # Build and install targets
├── PKGBUILD # Arch Linux package build file
├── .SRCINFO # AUR metadata
├── LICENSE # MIT License
└── README.md # This file
Coming soon - PKGBUILD included in repository.
git clone https://github.com/HiddenKeyDev/nm-hotspot-cli.git
cd nm-hotspot-cli
sudo make install
To uninstall:
sudo make uninstall
git clone https://github.com/HiddenKeyDev/nm-hotspot-cli.git
cd nm-hotspot-cli
chmod +x scripts/install.sh
./scripts/install.sh
For system-wide installation (requires sudo):
sudo ./scripts/install.sh
chmod +x src/nm-hotspot
cp src/nm-hotspot ~/.local/bin/nm-hotspot
# Or for system-wide: sudo cp src/nm-hotspot /usr/local/bin/nm-hotspot
sudo pacman -S networkmanager
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
# Show help
nm-hotspot help
# Create a hotspot with default settings
nm-hotspot create
# Create a hotspot with custom settings
nm-hotspot create -s MyNetwork -p MyPassword123
# Create and save configuration as default
nm-hotspot create -s MyNetwork -p MyPassword123 --save
# Start existing hotspot
nm-hotspot start
# Stop the hotspot
nm-hotspot stop
# Check hotspot status
nm-hotspot status
# List available wireless devices
nm-hotspot list
# Show current configuration
nm-hotspot config
# View logs
nm-hotspot log
# View last 50 log entries
nm-hotspot log --tail 50
# Clear log file
nm-hotspot log --clear
create - Create and start a new hotspot
-s, --ssid SSID
- Set hotspot name (default: MyHotspot)-p, --password PASS
- Set password (min 8 characters, default: 12345678)-b, --band BAND
- Set band:bg
(2.4GHz) ora
(5GHz) (default: bg)--save
- Save settings as default configuration
start - Start the existing hotspot connection
stop - Stop the active hotspot
status - Show current hotspot status and details
list - List all available wireless devices
config - Display saved configuration
log - Show log entries
--tail N
- Show last N log entries (default: 20)--clear
- Clear the log file
# Create a hotspot with default settings
nm-hotspot create
# SSID: MyHotspot, Password: 12345678
# Create a 5GHz hotspot with custom name and password
nm-hotspot create -s "Coffee-Shop-WiFi" -p "SecurePass2024" -b a
# Create and save as default
nm-hotspot create -s "MyHomeNetwork" -p "MySecurePassword" --save
# Later, just use:
nm-hotspot start
nm-hotspot status
Output:
=== Hotspot Status ===
Status: ACTIVE
SSID: MyHomeNetwork
Band: bg (2.4GHz)
Device: wlan0
Configuration is stored in ~/.config/nm-hotspot/hotspot.conf
Example configuration file:
# nm-hotspot configuration
SSID="MyHotspot"
PASSWORD="12345678"
BAND="bg"
# Logging settings
ENABLE_LOGGING=true
LOG_PRIVACY=false
The logging system helps you troubleshoot issues and maintain an audit trail of hotspot operations.
Enable logging:
Edit ~/.config/nm-hotspot/hotspot.conf
and add:
ENABLE_LOGGING=true
Log file location:
~/.config/nm-hotspot/nm-hotspot.log
Log entries include:
- Timestamp
- Action performed (create, start, stop)
- SSID used (unless privacy mode is enabled)
- Success/failure status
- Error messages if any
Example log output:
[2024-10-06 14:30:15] INFO: Creating hotspot - Band: bg - SSID: MyHotspot
[2024-10-06 14:30:16] SUCCESS: Hotspot created successfully - SSID: MyHotspot
[2024-10-06 14:35:22] INFO: Stopping hotspot
[2024-10-06 14:35:23] SUCCESS: Hotspot stopped
[2024-10-06 14:40:10] ERROR: Failed to create hotspot - No wireless device found
Privacy mode:
To avoid logging sensitive information like SSIDs, enable privacy mode:
LOG_PRIVACY=true
Log rotation:
The log file is automatically rotated when it exceeds 1MB. The old log is saved as nm-hotspot.log.old
.
- Check if your wireless adapter supports AP mode:
iw list | grep -A 10 "Supported interface modes"
Look for AP
in the output.
- Make sure NetworkManager is running:
systemctl status NetworkManager
- Check for conflicts with other network services:
nmcli device status
Ensure your wireless adapter is detected:
nm-hotspot list
Password must be at least 8 characters long for WPA2 security.
./scripts/uninstall.sh
This will remove the nm-hotspot
script and optionally remove configuration files.
Contributions are welcome. This project participates in Hacktoberfest.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License. See the LICENSE file for details.
HiddenKeyDev
If you encounter issues or have questions:
- Open an issue on GitHub
- Check existing issues for solutions
- Submit pull requests for improvements