Skip to content

cumulus13/WiFiManager

Repository files navigation

πŸ“‘ WiFi Manager CLI (wifimgr)

A powerful command-line WiFi manager for Windows with colorful UI, emoji support, and multi-platform notifications (Windows Toast & Growl).

Version .NET Platform License

✨ Features

  • πŸ” Network Scanning - Scan available WiFi networks with signal strength
  • πŸ”Œ Smart Connect - Auto-save credentials and quick reconnect
  • πŸ“‹ Profile Management - List, create, and delete WiFi profiles
  • β›” Quick Disconnect - Disconnect from current network
  • πŸ“Š Status Monitor - Real-time connection status with signal quality
  • πŸ‘οΈ Live Monitoring - Monitor WiFi with change notifications
  • πŸ†• New AP Detection - Automatic notification for new networks
  • πŸ”” Dual Notifications - Windows Toast & Growl support
  • πŸ“Ά Signal Tracking - Track signal strength changes
  • πŸ–₯️ Multi-Interface - Support multiple WiFi adapters
  • 🎨 Colorful UI - Rich console colors with emoji icons

πŸ“‹ Table of Contents

πŸš€ Installation

Prerequisites

  • Windows 10/11 (64-bit)
  • .NET 8.0 Runtime or SDK
  • WiFi Adapter enabled
  • Optional: Growl for Windows (for Growl notifications)

Download

Option 1: Download Pre-built Binary

# Download from releases page
https://github.com/cumulus13/wifimanager/releases

# Extract and run
wifimgr.exe --help

Option 2: Build from Source

# Clone repository
git clone https://github.com/cumulus13/wifimanager.git
cd wifimanager

# Build
dotnet build -c Release

# Or publish as single executable
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true

# Executable will be in:
# bin\Release\net8.0\win-x64\publish\wifimgr.exe

Add to PATH (Recommended)

Windows 10/11:

  1. Copy wifimgr.exe to C:\Tools\ (or any folder)
  2. Press Win + X β†’ System β†’ Advanced system settings
  3. Environment Variables β†’ System variables β†’ Path β†’ Edit β†’ New
  4. Add C:\Tools\
  5. Click OK β†’ OK β†’ OK
  6. Restart terminal
  7. Run wifimgr from anywhere!

PowerShell Quick Setup:

# Create tools directory
New-Item -ItemType Directory -Force -Path "C:\Tools"

# Copy executable
Copy-Item "wifimgr.exe" -Destination "C:\Tools\"

# Add to PATH (requires admin)
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Tools", [System.EnvironmentVariableTarget]::Machine)

βš™οΈ Configuration

Config File Locations

wifimgr searches for wifimgr.json or config.json in these locations (priority order):

  1. %USERPROFILE%\.wifimgr\wifimgr.json
  2. %USERPROFILE%\.wifimgr\config.json
  3. %APPDATA%\.wifimgr\wifimgr.json
  4. %APPDATA%\.wifimgr\config.json
  5. {ExeDirectory}\wifimgr.json
  6. {ExeDirectory}\config.json
  7. {ExeDirectory}\.wifimgr\wifimgr.json
  8. {ExeDirectory}\config\wifimgr.json

Configuration Format

Full Config Example (wifimgr.json):

{
  "enableWindowsToast": true,
  "enableGrowl": true,
  "growlHosts": [
    {
      "host": "127.0.0.1",
      "port": 23053,
      "enabled": true,
      "name": "Local Growl"
    },
    {
      "host": "192.168.1.100",
      "port": 23053,
      "enabled": true,
      "name": "Remote PC"
    },
    {
      "host": "laptop.local",
      "port": 23053,
      "enabled": false,
      "name": "Laptop (Disabled)"
    }
  ],
  "iconPath": "C:\\path\\to\\custom\\icon.png",
  "connectionTimeout": 1000,
  "notificationPriorities": {
    "WiFi Connected": 0,
    "WiFi Disconnected": 2,
    "WiFi Changed": 0,
    "New WiFi Network": 0,
    "Signal Changed": -1
  },
  "stickyNotifications": {
    "WiFi Connected": false,
    "WiFi Disconnected": true,
    "WiFi Changed": false,
    "New WiFi Network": true,
    "Signal Changed": false
  },
  "defaultSticky": false
}

Configuration Options

Option Type Default Description
enableWindowsToast boolean true Enable Windows Toast notifications
enableGrowl boolean true Enable Growl notifications
growlHosts array [{"host":"127.0.0.1","port":23053}] List of Growl hosts
iconPath string null Custom icon path for notifications
connectionTimeout number 1000 Growl connection timeout (ms)
notificationPriorities object see example Priority per notification type (-2 to 2)
stickyNotifications object see example Sticky setting per notification type
defaultSticky boolean false Default sticky if type not configured

Icon Setup

Place icon file in one of these locations (auto-detected):

  • {ExeDirectory}\icon.png
  • {ExeDirectory}\wifi.png
  • {ExeDirectory}\wifimgr.png
  • {ExeDirectory}\app.ico
  • {ExeDirectory}\assets\icon.png
  • {ExeDirectory}\resources\icon.png

Or specify custom path in config:

{
  "iconPath": "C:\\MyIcons\\custom.png"
}

Supported formats: PNG, JPG, ICO, GIF, BMP (PNG recommended, max 100KB)

πŸ“– Usage

Basic Commands

# Show help
wifimgr help

# List WiFi interfaces
wifimgr interfaces

# Switch to interface
wifimgr interface 0

# Scan networks
wifimgr scan

# Connect to network
wifimgr connect MyWiFi

# Disconnect
wifimgr disconnect

# Show status
wifimgr status

# List profiles
wifimgr list

# Delete profile
wifimgr delete OldNetwork

# Monitor mode
wifimgr monitor

# Test notifications
wifimgr test-notif

πŸ“š Commands

interfaces - List WiFi Interfaces

List all available WiFi adapters with their status.

wifimgr interfaces

Output:

πŸ“‘ WiFi Interfaces

Found 2 interface(s):

βœ… [0] 🟒 Intel(R) Wi-Fi 6 AX201 160MHz (connected)
   [1] βšͺ Realtek RTL8822CE 802.11ac (disconnected)

πŸ’‘ Use 'wifimgr interface <index>' to switch

Icons:

  • βœ… = Active interface
  • 🟒 = Connected
  • βšͺ = Disconnected

interface <N> - Switch Interface

Switch to a specific WiFi interface.

wifimgr interface 1

Output:

βœ… Switched to interface: Realtek RTL8822CE 802.11ac

scan - Scan Networks

Scan for available WiFi networks with signal strength.

wifimgr scan

Output:

πŸ” Scanning on: Intel(R) Wi-Fi 6 AX201 160MHz

Found 8 network(s):

βœ… πŸ“Ά πŸ”’ MyHomeWiFi (95%)
    πŸ“Ά πŸ”’ NeighborWiFi (82%)
    πŸ“Ά πŸ”“ FreeWiFi (75%)
    πŸ“Ά πŸ”’ CoffeeShop (68%)
    πŸ“‘ πŸ”’ Mobile_AP (45%)
    πŸ“‘ πŸ”’ OfficeGuest (38%)
    πŸ“‘ πŸ”’ Hotel_WiFi (25%)
    πŸ“‘ πŸ”“ PublicWiFi (18%)

Icons:

  • βœ… = Currently connected
  • πŸ“Ά = Strong signal (β‰₯50%)
  • πŸ“‘ = Weak signal (<50%)
  • πŸ”’ = Secured (password required)
  • πŸ”“ = Open (no password)

connect <SSID> - Connect to Network

Connect to a WiFi network. If profile doesn't exist, you'll be prompted for password.

# Connect to saved network
wifimgr connect MyHomeWiFi

# Connect to new secured network
wifimgr connect NewNetwork
# πŸ”‘ Enter password: ********
# πŸ’Ύ Creating profile...
# βœ… Profile created
# βœ… Connected to 'NewNetwork'

# Connect to open network
wifimgr connect FreeWiFi
# βœ… Connected to 'FreeWiFi'

disconnect - Disconnect

Disconnect from current WiFi network.

wifimgr disconnect

Output:

β›” Disconnecting...
βœ… Disconnected

status - Connection Status

Show current WiFi connection status with details.

wifimgr status

Output:

πŸ“Š WiFi Status

Interface: Intel(R) Wi-Fi 6 AX201 160MHz (connected)
Status:    βœ… Connected
Network:   MyHomeWiFi
Signal:    πŸ“Ά 95%
Security:  πŸ”’ Secured

When disconnected:

πŸ“Š WiFi Status

Interface: Intel(R) Wi-Fi 6 AX201 160MHz (disconnected)
⚠️  Not connected on active interface

πŸ’‘ Found connection on: Realtek RTL8822CE 802.11ac
   Use 'wifimgr interface 1' to switch

list - List Profiles

List all saved WiFi profiles.

wifimgr list

Output:

πŸ“‹ Saved WiFi Profiles

Found 5 profile(s):

  πŸ”Ή MyHomeWiFi
  πŸ”Ή OfficeWiFi
  πŸ”Ή CafeWiFi
  πŸ”Ή AirportWiFi
  πŸ”Ή HotelGuest

delete <SSID> - Delete Profile

Delete a saved WiFi profile.

wifimgr delete OldNetwork

Output:

πŸ—‘οΈ  Deleting profile 'OldNetwork'...
βœ… Profile 'OldNetwork' deleted

monitor - Monitor Mode

Start real-time WiFi monitoring with notifications.

wifimgr monitor

Features:

  • βœ… Connection/disconnection detection
  • πŸ†• New network discovery
  • πŸ“ˆπŸ“‰ Signal strength changes
  • πŸ”” Desktop notifications
  • πŸ”„ Network switching detection

Output:

πŸ‘οΈ  WiFi Monitoring Mode
Monitoring: 🟒 Intel(R) Wi-Fi 6 AX201 160MHz

Press Ctrl+C to stop...

βœ… Currently connected to 'MyHomeWiFi' (95%)

πŸ” Scanning for networks...

Found 8 network(s):
  πŸ“Ά πŸ”’ MyHomeWiFi (95%)
  πŸ“Ά πŸ”’ NeighborWiFi (82%)
  πŸ“Ά πŸ”“ FreeWiFi (75%)
  ...

[Events will appear here in real-time]

πŸ“‰ Signal: 95% β†’ 88% (MyHomeWiFi)
πŸ†• New network: 'MobileHotspot' (67%)
πŸ”„ Switched from 'MyHomeWiFi' to 'OfficeWiFi'
β›” Disconnected from 'OfficeWiFi'
βœ… Connected to 'MyHomeWiFi' (92%)

Press Ctrl+C to stop monitoring


test-notif - Test Notifications

Test notification systems (Windows Toast & Growl).

wifimgr test-notif

Output:

πŸ”” Testing Notifications

Testing Windows Toast...
Testing Growl (2 host(s))...
βœ… Growl test sent to 127.0.0.1:23053 (Local Growl)
βœ… Growl test sent to 192.168.1.100:23053 (Remote PC)

βœ… Notification test completed

πŸ“ Icon: C:\Tools\wifimgr.png

If Growl is not available:

⚠️  Growl is not available
πŸ’‘ To enable Growl:
   1. Install Growl for Windows
   2. Make sure it's running
   3. Enable GNTP in Growl settings (default port 23053)
   4. Configure in wifimgr.json

πŸ”” Notifications

Windows Toast Notifications

Automatic - Shows for:

  • WiFi Connected
  • WiFi Disconnected
  • WiFi Network Changed
  • New WiFi Network Detected
  • Signal Strength Changes (β‰₯10%)

Requirements:

  • Windows 10/11
  • Notifications enabled in Settings β†’ System β†’ Notifications

Features:

  • Native Windows 10/11 style
  • Action Center integration
  • Custom icon support
  • Auto-dismiss or sticky

Growl Notifications

Multiple Hosts Support - Send to:

  • Local Growl (127.0.0.1)
  • Remote PCs over network
  • Multiple Growl instances

Configuration:

{
  "growlHosts": [
    {
      "host": "127.0.0.1",
      "port": 23053,
      "enabled": true,
      "name": "Local"
    },
    {
      "host": "192.168.1.100",
      "port": 23053,
      "enabled": true,
      "name": "Desktop PC"
    }
  ]
}

Priority Levels:

  • -2 = Very Low
  • -1 = Low
  • 0 = Normal
  • 1 = High
  • 2 = Emergency

Sticky Notifications:

{
  "stickyNotifications": {
    "WiFi Disconnected": true,    // Stays until dismissed
    "WiFi Connected": false,       // Auto-dismiss
    "New WiFi Network": true       // Stays until dismissed
  }
}

πŸ› Troubleshooting

Common Issues

1. "Failed to open WLAN handle"

Cause: WiFi adapter not detected or disabled

Solutions:

  • βœ… Enable WiFi adapter in Device Manager
  • βœ… Run as Administrator
  • βœ… Restart Windows WLAN service:
    net stop wlansvc
    net start wlansvc
  • βœ… Check if WiFi drivers are installed

2. Notifications Not Appearing

Windows Toast:

  • βœ… Check Settings β†’ System β†’ Notifications β†’ Enable notifications
  • βœ… Enable notifications for "WiFiManager" app
  • βœ… Disable Focus Assist / Do Not Disturb
  • βœ… Run as Administrator

Growl:

  • βœ… Install Growl for Windows
  • βœ… Make sure Growl is running (check system tray)
  • βœ… Enable GNTP in Growl Settings
  • βœ… Set port to 23053 (default)
  • βœ… Check firewall (allow port 23053)
  • βœ… For remote: Enable network listener in Growl

3. Scan Returns No Networks

Solutions:

  • βœ… Disable Airplane Mode
  • βœ… Wait 5-10 seconds after enabling WiFi
  • βœ… Try wifimgr scan multiple times
  • βœ… Move closer to access point
  • βœ… Check if other devices can see networks
  • βœ… Restart WiFi adapter:
    netsh interface set interface "Wi-Fi" disabled
    netsh interface set interface "Wi-Fi" enabled

4. "Failed to connect"

Solutions:

  • βœ… Check password is correct
  • βœ… Delete old profile: wifimgr delete NetworkName
  • βœ… Try connecting again
  • βœ… Check network security type (WPA2/WPA3)
  • βœ… Network might be hidden (try SSID exactly as shown)
  • βœ… Router might have MAC filtering enabled

5. Icon Not Showing in Notifications

Solutions:

  • βœ… Place icon file in exe directory
  • βœ… Use PNG format (recommended)
  • βœ… Keep file size < 100KB
  • βœ… Check icon path in config
  • βœ… Verify file permissions

6. Multiple Interfaces Confusion

Solutions:

  • βœ… Use wifimgr interfaces to see all adapters
  • βœ… Switch to connected interface: wifimgr interface 0
  • βœ… The active interface is marked with βœ…

Debug Tips

Enable Verbose Logging:

# Set environment variable
set WIFIMGR_DEBUG=1
wifimgr monitor

Check Windows Event Viewer:

eventvwr.msc β†’ Windows Logs β†’ System
Filter by: WLAN-AutoConfig

Test WiFi Adapter:

# PowerShell
Get-NetAdapter | Where-Object {$_.InterfaceDescription -like "*Wi-Fi*"}

πŸ”§ Development

Project Structure

WiFiManager/
β”œβ”€β”€ Program.cs                 # Entry point & CLI routing
β”œβ”€β”€ WiFiManagerCLI.cs          # CLI commands implementation
β”œβ”€β”€ WiFiService.cs             # Native WiFi API wrapper
β”œβ”€β”€ NotificationService.cs     # Toast & Growl notifications
β”œβ”€β”€ NotificationConfig.cs      # Configuration management
β”œβ”€β”€ ColorConsole.cs            # Console color utilities
β”œβ”€β”€ WiFiManager.csproj         # Project configuration
└── README.md                  # Documentation

Building

Debug Build:

dotnet build

Release Build:

dotnet build -c Release

Single File Executable:

dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true

Self-Contained (no .NET required):

dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true

Technology Stack

  • .NET 8.0 - Modern .NET runtime
  • C# 12 - Latest C# features
  • Native WiFi API - Windows wlanapi.dll
  • P/Invoke - Interop with Windows APIs
  • Windows.UI.Notifications - Toast notifications
  • GNTP Protocol - Growl notifications
  • TCP Sockets - Network communication

Code Architecture

WiFiService.cs - Low-level WiFi operations

  • P/Invoke declarations
  • WLAN API wrappers
  • Interface management
  • Network scanning
  • Profile CRUD operations

NotificationService.cs - Notification handling

  • Windows Toast via PowerShell
  • Growl GNTP protocol
  • Multiple host support
  • Icon embedding (base64 & file path)

NotificationConfig.cs - Configuration

  • JSON deserialization
  • Multi-location search
  • Priority & sticky settings
  • Auto-save location tracking

🀝 Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Contribution Guidelines

  • βœ… Follow existing code style
  • βœ… Add comments for complex logic
  • βœ… Test on Windows 10 & 11
  • βœ… Update README if needed
  • βœ… Keep commits clean and descriptive

Reporting Bugs

Create an issue with:

  • Windows version
  • .NET version
  • WiFi adapter model
  • Steps to reproduce
  • Error messages / screenshots
  • Expected vs actual behavior

πŸ“„ License

MIT License

Copyright (c) 2024 Hadi Cahyadi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

πŸ’– Support

If you find this project helpful, consider supporting:

Buy Me a Coffee Ko-fi Patreon

πŸ“ž Contact

Hadi Cahyadi


Made with ❀️ and β˜• by Hadi Cahyadi

Star ⭐ this repo if you find it useful!

About

A powerful command-line WiFi manager for Windows with colorful UI, emoji support, and multi-platform notifications (Windows Toast & Growl).

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages