Unifly: Rust TUI CLI for UniFi Networks

SSH into a server, need to tweak a firewall rule—browser? Nope. Enter Unifly, a Rust TUI that turns UniFi's API chaos into a sleek dashboard. Finally, a CLI that doesn't break on firmware updates.

Unifly: Rust CLI That Conquers UniFi's Fractured APIs — theAIcatchup

Key Takeaways

  • Unifly unifies UniFi's fractured APIs behind a smart Controller, enabling smoothly CLI/TUI management.
  • AI-assisted dev delivers 15k lines of high-quality Rust with pedantic tests—solo power redefined.
  • CLI production-ready now; TUI close—watch for polish on reconnects and screens.

You’re staring at a black terminal on a headless server, UniFi firewall screaming for a NAT tweak, and the web UI’s a browser away—impossible.

Unifly changes that. This Rust TUI for UniFi networks—CLI commands, real-time dashboards, the works—ships as one binary, wrapping 27 commands around devices, clients, firewalls, VPNs. Born eight weeks ago, 123 stars already, 15,000 lines of Rust screaming seriousness.

Here’s the thing.

Ubiquiti’s UniFi gear? Solid hardware. Management? A web UI fine for clicks, disastrous for scripts. No official CLI. APIs? Split. Modern Integration API (REST, API keys, UUIDs). Legacy Session API (cookies, CSRF, hex IDs, enveloped junk). Oh, and a Session v2 for NAT oddities. Firmware flips endpoints; scripts die.

Why UniFi’s APIs Feel Like a Bad Divorce

Unifly’s founder, Stefanie Jane (hyperb1iss), didn’t just bridge ‘em—she reconciled them. Picture a Controller facade, Arc-wrapped, routing your controller.execute(Command::CreateNatPolicy(...)) to the right API, auth, ID format. DataStore? Reactive, DashMap + tokio::watch for live updates. Two crates: unifly-api (crates.io-ready library) and unifly (clap CLI + ratatui TUI with 10 screens: health, topology, traffic charts).

The API exists but it’s split across two incompatible surfaces with different auth mechanisms, different response formats, and different ideas about what an entity ID should look like.

That’s the original pain, straight up. Unifly’s command router? Figures it out. Client Wi-Fi metrics? Session API. Firewall CRUD? Integration. NAT? v2. smoothly.

Aggressive dev pace—71 commits first eight days of April. Solo maintainer. AI-assisted (Claude Opus trailers everywhere). But not dumped slop: coherent architecture, thiserror/miette errors, 250+ tests (wiremock mocks, assert_cmd, insta snapshots), e2e against simulated controller.

Clippy pedantic at deny. Unwraps forbidden. Unsafe? No way. Cargo-deny for licenses/vulns. 30+ rule overrides, each justified. This ain’t cargo-cult config.

The AI Ghost in the Machine—And Why It Works

Every commit: Co-Authored-By: Claude Opus. Transparent. High quality anyway—iterative fixes, not prompt-vomit. Unique insight: This mirrors the 90s Linux kernel boom, solo hackers + tools (back then, vi; now, AI) bootstrapping infra empires. Prediction? Unifly heralds Rust+AI solo projects dominating niche DevOps, outpacing corporate neglect like Ubiquiti’s API rot. Their PR spin? ‘Ecosystem growing!’ Nah—users hack Python duct-tape weekly.

TUI? Ten screens, zero tests. Reconnect? Busted (CancellationToken suicides post-disconnect). Roadmap stale spots (features listed missing, already there). Fast solo sprint quirks.

Take NAT updates. Roadmap gap: No update subcommand—delete/recreate, retype everything for one toggle. Friction city for port forwards.

Fix? Eleven files. Library: UpdateNatPolicyRequest, new Command, apply_nat_update—fetches via Session v2, merges deltas, PUTs. CLI parses flags, diffs against existing. Boom.

Can You Bet Your Network on Unifly Today?

CLI? Yes. Replaces web clicking for 80% tasks. TUI? Monitoring gold—topology, traffic live. Library? Build atop it.

Worth it if UniFi’d. Stars climbing; contributor UX stellar (same-day replies, merges vary but land). Roadmap explicit: gaps named.

Rust why? Memory safety for network ops (no leaks mid-SSH). Async mastery (tokio). Binary bliss—no deps hell. Ratatui? Terminal candy without Electron bloat.

Ubiquiti, take notes: Ship a CLI. Or watch open source eat your lunch.

How Does Unifly’s Architecture Stack Up?

Workspace clean. unifly-api: HTTP/WS transports, Controller, DataStore. unifly: Commands, screens. Dual-API glue? Command enums dispatch smartly, ID resolvers cross-map hex-to-UUID.

Tests mock APIs perfectly; e2e spins fake controller—real flows, no cloud. Pedantic lints enforce discipline AI couldn’t fake alone.

Rough edges? TUI untested—crashy? Reconnects fail—downtime watcher? Polish next.

But pace! 15k lines, eight weeks. AI accelerates, human architects.


🧬 Related Insights

Frequently Asked Questions

What is Unifly for UniFi?

Unifly’s a Rust CLI and TUI dashboard managing UniFi networks—devices, clients, firewalls, more—unifying messy APIs into one binary.

Is Unifly ready for production UniFi use?

CLI yes for automation; TUI great for monitoring but needs TUI tests and reconnect fixes. Library solid for custom tools.

How does Unifly handle UniFi’s multiple APIs?

Single Controller routes commands to Integration/Session/v2 APIs, reconciles IDs/data—call once, it picks the path.

Marcus Rivera
Written by

Tech journalist covering AI business and enterprise adoption. 10 years in B2B media.

Frequently asked questions

What is Unifly for UniFi?
Unifly's a Rust CLI and TUI dashboard managing UniFi networks—devices, clients, firewalls, more—unifying messy APIs into one binary.
Is Unifly ready for production UniFi use?
CLI yes for automation; TUI great for monitoring but needs TUI tests and reconnect fixes. Library solid for custom tools.
How does Unifly handle UniFi's multiple APIs?
Single Controller routes commands to Integration/Session/v2 APIs, reconciles IDs/data—call once, it picks the path.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by Dev.to

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.