Introduction

Stop context-switching to the UniFi web dashboard. Unifly puts your entire network at your fingertips from the terminal you're already in.

  • unifly <command>: CLI for scripting, automation, and quick lookups
  • unifly tui: real-time terminal dashboard for monitoring

Both are powered by a shared async engine that speaks every UniFi API dialect, so you never have to think about which endpoint to hit.

🔗The Problem

UniFi infrastructure speaks three completely different APIs:

graph LR
subgraph "Integration API"
I["REST + API Key"]
I1["Networks, WiFi, Firewall"]
I2["DNS, ACL, Traffic Lists"]
end

    subgraph "Session API"
        S["Cookie + CSRF"]
        S1["Events, Stats, DPI, NAT"]
        S2["Device Commands, Admin"]
    end

    subgraph "Site Manager"
        M["api.ui.com + API Key"]
        M1["Fleet: Consoles, Sites"]
        M2["Cloud Connector"]
    end

    subgraph unifly
        U["Unified Interface"]
    end

    I --> U
    S --> U
    M --> U
    U --> CLI["CLI Output"]
    U --> TUI["TUI Dashboard"]
  • Integration API: RESTful, API-key authenticated, covers CRUD for most resources
  • Session API: Session-based with cookie/CSRF, required for events, statistics, and device commands
  • Site Manager API: Ubiquiti’s cloud fleet API, for multi-console queries and connector-routed access without a VPN to the controller

Most tools speak one dialect, maybe two. The web dashboard is slow and can’t be scripted. Unifly handles the routing, authentication, and data merging across all three automatically.

🔗What You Can Do

CapabilityDescription
Device ManagementList, inspect, restart, upgrade, and provision devices
Client MonitoringSee connected clients with signal, traffic, and VLAN info
Network ConfigurationManage VLANs, subnets, DHCP, and IPv6 settings
WiFi ManagementCreate and modify SSIDs, scan neighbors, analyze channels, track client roams and WiFi experience
FirewallManage policies, zones, groups, and ACL rules
NATMasquerade, source NAT, and destination NAT rules (via Session v2 API)
VPNSite-to-site, remote-access, WireGuard peers, client VPNs, and OpenVPN config export
Switch PortsPort profiles as reviewable JSONC files: export, edit, apply, diff
Site SettingsRead and write every site-level settings section from the terminal
Cloud FleetQuery consoles, sites, and devices across your whole fleet via Site Manager
Events & AlarmsStream live events, acknowledge and archive alarms
StatisticsQuery bandwidth, client counts, and DPI data over time
Raw API AccessHit any controller endpoint directly with unifly api
Real-Time DashboardMonitor everything with live octant charts and status bars

🔗Architecture at a Glance

graph TD
UNIFLY["unifly
CLI + TUI (single binary)"] API["unifly-api
Library crate on crates.io"] UNIFLY --> API API --> INT["Integration Client
REST + API Key"] API --> SES["Session Client
Cookie + CSRF"] API --> WS["WebSocket
Live Events"] API --> DS["DataStore
DashMap + watch channels"]

Two crates with a clean dependency chain. The library is published independently for Rust developers building custom integrations. See the Architecture section for the full picture.

🔗Next Steps