Mili
Mili is an open source tool for auto login hotspot pages! (MacOS + Linux)
Install / Use
/learn @SadeghHayeri/MiliREADME
Overview
Mili is an open-source tool that automatically logs you into MikroTik captive portal pages every time you connect to a WiFi network — no more opening a browser just to hit "Login".
<p align="center"> <img src="images/notify.png" alt="Mili notification example"> </p>Features
- Auto-detect MikroTik captive portals on every WiFi connect
- Multiple credentials — store as many username/password pairs as you like
- Weighted random selection — control how often each credential is used via a
sharevalue - Desktop notifications on success or failure
- macOS (Intel & Apple Silicon) and Linux support
Requirements
| Platform | Dependencies |
|----------|-------------|
| macOS | Homebrew (auto-installed), jq, terminal-notifier |
| Linux | curl, jq, notify-send |
Installation
git clone https://github.com/SadeghHayeri/Mili.git
cd Mili/scripts
./install.sh
mili config
The installer will:
- Install required dependencies
- Copy Mili scripts to
~/.mili/bin/ - Register a system service that triggers on WiFi changes
- Add
milito your PATH with shell auto-completion
macOS: Disable captive portal popup (optional)
By default, macOS opens a mini-browser when it detects a captive portal. You can disable this so Mili handles logins silently. Note: this requires temporarily disabling SIP — re-enable it immediately after.
- Reboot and hold Command-R until the Apple logo appears (Recovery Mode)
- Open Utilities > Terminal
- Run:
csrutil disable - Reboot normally
- Go to Finder > Go > Go To Folder →
/System/Library/CoreServices - Rename
Captive Network Assistantto something else (e.g.Captive Network Assistant Disabled) - Reboot into Recovery Mode again and run:
csrutil enable
Usage
| Command | Description |
|---------|-------------|
| mili | Check for captive portal and auto-login |
| mili login | Force a login attempt |
| mili login <username> | Login with a specific saved user |
| mili status | Show current login status |
| mili logout | Logout from the portal |
| mili config | Add or update credentials |
Configuration
Credentials are stored in ~/.mili/config.json. Run mili config to set them interactively, or edit the file directly:
{
"base_url": "http://your-mikrotik-url",
"login_information": [
{
"username": "user1",
"password": "pass1",
"share": 5
},
{
"username": "user2",
"password": "pass2",
"share": 1
}
]
}
The share value is a weight — in the example above, user1 is selected roughly 5× more often than user2.
How It Works
- On WiFi connect, Mili checks
captive.apple.comfor a captive portal response - If a MikroTik portal is detected, it picks a random credential based on share weights
- If the random login fails, it tries all credentials in order
- A desktop notification reports the outcome
License
MIT — made with ♥ by Sadegh Hayeri
