unifi-cli

A command-line tool for querying a local UniFi network, including its gateway, access points, switches, and connected devices.

In plain words
What is it for?
Use it to list UniFi hardware, inspect a device's status and resource use, find wired or wireless clients, view sites, or check the network application version.
Why use it?
It provides network information from the local UniFi gateway without manually searching through its web interface.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/baileywickham/unifi-cli/unifi-cli
Any agent
npx skills add baileywickham/unifi-cli --skill unifi-cli
Clone the repo
git clone --depth 1 https://github.com/baileywickham/unifi-cli

Made for: Claude Code, Codex.

Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 493 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00049 $0.00493
Opus 5 $0.00024 $0.00246
Sonnet 5 $0.00010 $0.00099
Haiku 4.5 $0.00005 $0.00049

Measured yesterday against content hash 440184a066c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unifi-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/unifi-cli/SKILL.md · 46 lines

What it actually says

unifi-cli

CLI for the UniFi Network Integrations API on a local UniFi gateway (Cloud Gateway Ultra, UDM, UDR, etc.).

Prerequisites

  • unifi is on PATH. bun link installs it to ~/.bun/bin, which may not be on PATH in every shell — try ~/.bun/bin/unifi before assuming it's missing. If it isn't installed, install it (requires Bun):

    git clone https://github.com/baileywickham/unifi-cli
    cd unifi-cli && bun install && bun link
    
  • API key in UNIFI_API_KEY or ~/.config/unifi-cli/config.json. If missing, the CLI prints setup instructions — relay them to the user instead of guessing. (Keys must be created in the gateway's local web UI, not unifi.ui.com — the CLI's error output and the repo README explain this.)

Commands

Prefer --json when you need to parse the output.

unifi devices --json                 # all UniFi hardware: model, IP, state
unifi device <name|id>               # one device: detail + uptime/cpu/memory
unifi clients [--wired|--wireless]   # connected clients
unifi sites                          # sites (usually just "default")
unifi info                           # network application version

Typical questions this answers: "what APs do I have?" → unifi devices; "is the living room AP up?" → unifi device living-room; "what's on my network?" → unifi clients.

Write actions — ask the user first

unifi device restart <name> and unifi device power-cycle <name> <port> disrupt the network. NEVER run them unless the user explicitly asked for that action in this conversation. These commands prompt interactively, so when running them from Claude pass --yes — but only after the user has explicitly confirmed the action in the conversation.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 46 lines · 49 tokens per session scan A 440184a066c8

Subscribe to this mod's changes

unifi-cli is a skill published in the GitHub repository baileywickham/unifi-cli (1 stars, last pushed 1mo ago), licensed MIT. It adds 49 tokens to every session and 493 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

build-mcp-server

This skill should be used when the user asks to "build an MCP server", "create an MCP", "make an MCP integration", "wrap an API for Claude", "expose tools to Claude", "make an MCP app", or discusses building something with the Model Context Protocol. It is the entry point for MCP server development — it interrogates…

pproenca/unifi-mcp · 111 tokens

implementation-strategy

Decide how to implement runtime and API changes before editing code. Use when a task changes exported APIs, MCP tool definitions, runtime behavior, or configuration, and you need to choose the compatibility boundary and implementation shape.

pproenca/unifi-mcp · 47 tokens

docs-sync

Audit documentation coverage by comparing implementation against docs/. Use when asked to check doc coverage, sync docs with code, or after significant API surface changes. Produce a report and ask for approval before editing.

pproenca/unifi-mcp · 42 tokens

pr-draft-summary

Generate a PR-ready summary block with branch suggestion, title, and description. Use in the final handoff after moderate-or-larger code changes; skip for trivial or conversation-only tasks.

pproenca/unifi-mcp · 42 tokens

code-change-verification

Run the verification stack (format, lint, typecheck, test) when changes affect runtime code, tests, or build config.

pproenca/unifi-mcp · 31 tokens

typescript

This skill should be used when the user asks to "optimize TypeScript performance", "speed up tsc compilation", "configure tsconfig.json", "fix type errors", "improve async patterns", or encounters TS errors (TS2322, TS2339, "is not assignable to"). Also triggers on .ts, .tsx, .d.ts file work involving type…

pproenca/unifi-mcp · 102 tokens