npx skills add https://github.com/dl-alexandre/skills --skill usm-cli此技能为 usm CLI 工具提供指导,这是一个用于 UniFi Site Manager API 的命令行界面。
usm 通过位于 api.ui.com 的官方 Site Manager API 提供基于云的 UniFi 站点管理。对于本地控制器 API(Network, Protect),请参阅单独的 unifi CLI。
brew tap dl-alexandre/tap
brew install usm
从 GitHub Releases 下载:
# macOS (Apple Silicon)
curl -L https://github.com/dl-alexandre/UniFi-Site-Manager-CLI/releases/latest/download/usm-darwin-arm64 -o usm
chmod +x usm
sudo mv usm /usr/local/bin/
从 unifi.ui.com → 设置 → 控制平面 → 集成 → API 密钥 获取 API 密钥
配置:
This skill provides guidance for the usm CLI tool, a command-line interface for the UniFi Site Manager API.
usm provides cloud-based management of UniFi sites via the official Site Manager API at api.ui.com. For local controller APIs (Network, Protect), see the separate unifi CLI.
brew tap dl-alexandre/tap
brew install usm
Download from GitHub Releases:
# macOS (Apple Silicon)
curl -L https://github.com/dl-alexandre/UniFi-Site-Manager-CLI/releases/latest/download/usm-darwin-arm64 -o usm
chmod +x usm
sudo mv usm /usr/local/bin/
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
usm init
# 或者:export USM_API_KEY="your-api-key"
3. 验证:
usm whoami
4. 列出站点:
usm sites list
交互式配置设置。创建 ~/.config/usm/config.yaml。
使用场景:
标志:
--force - 覆盖现有配置列出所有站点,支持分页和筛选。
使用场景:
标志:
--page-size=N - 每页站点数(默认:50,0 = 获取全部)--search=<term> - 按名称/描述筛选--output=json|table - 输出格式--no-headers - 表格不显示标题(用于脚本)示例:
usm sites list # 默认:50 个站点
usm sites list --page-size 0 # 获取所有站点
usm sites list --search "office" # 按名称筛选
usm sites list --output json # JSON 输出
usm sites list --no-headers # 用于管道传输到其他工具
获取特定站点的详细信息。
使用场景:
示例:
usm sites get 60abcdef1234567890abcdef
usm sites get 60abcdef1234567890abcdef --output json
显示已认证的用户账户信息。
使用场景:
示例:
usm whoami
usm whoami --output json
显示版本信息。
使用场景:
--check)标志:
--check - 检查 GitHub 上的最新版本配置文件:~/.config/usm/config.yaml
注意: API 密钥不存储在配置文件中。请使用环境变量或标志。
api:
base_url: https://api.ui.com
timeout: 30
output:
format: table # table, json
color: auto # auto, always, never
no_headers: false
| 变量 | 描述 |
|---|---|
USM_API_KEY | 用于认证的 API 密钥(必需) |
USM_BASE_URL | API 基础 URL(默认:https://api.ui.com) |
USM_TIMEOUT | 请求超时时间(秒) |
USM_FORMAT | 默认输出格式 |
USM_COLOR | 颜色模式 |
USM_NO_HEADERS | 禁用表格标题 |
USM_CONFIG | 配置文件路径 |
| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 1 | 一般错误 |
| 2 | 认证失败 |
| 3 | 权限被拒绝 |
| 4 | 验证错误 |
| 5 | 速率受限 |
| 6 | 网络错误 |
unifi CLI - 用于本地 UniFi Network 和 Protect APIusm sites list --page-size 0 --output json > sites.json
SITE_ID=$(usm sites list --search "Office" --output json | jq -r '.[0]._id')
usm sites get "$SITE_ID"
usm whoami || exit 1
usm sites list --no-headers | column -t
每周安装数
1
仓库
首次出现
1 天前
安全审计
安装于
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1
Get API Key from unifi.ui.com → Settings → Control Plane → Integrations → API Keys
Configure:
usm init
# Or: export USM_API_KEY="your-api-key"
3. Verify:
usm whoami
4. List sites:
usm sites list
Interactive configuration setup. Creates ~/.config/usm/config.yaml.
Use when:
Flags:
--force - Overwrite existing configList all sites with pagination and filtering.
Use when:
Flags:
--page-size=N - Number of sites per page (default: 50, 0 = fetch all)--search=<term> - Filter by name/description--output=json|table - Output format--no-headers - Table without headers (for scripts)Examples:
usm sites list # Default: 50 sites
usm sites list --page-size 0 # Fetch all sites
usm sites list --search "office" # Filter by name
usm sites list --output json # JSON output
usm sites list --no-headers # For piping to other tools
Get detailed information about a specific site.
Use when:
Examples:
usm sites get 60abcdef1234567890abcdef
usm sites get 60abcdef1234567890abcdef --output json
Show authenticated user account information.
Use when:
Examples:
usm whoami
usm whoami --output json
Show version information.
Use when:
--check)Flags:
--check - Check GitHub for latest releaseConfig file: ~/.config/usm/config.yaml
Note: API keys are NOT stored in config. Use environment variables or flags.
api:
base_url: https://api.ui.com
timeout: 30
output:
format: table # table, json
color: auto # auto, always, never
no_headers: false
| Variable | Description |
|---|---|
USM_API_KEY | API key for authentication (required) |
USM_BASE_URL | API base URL (default: https://api.ui.com) |
USM_TIMEOUT | Request timeout in seconds |
USM_FORMAT | Default output format |
USM_COLOR | Color mode |
USM_NO_HEADERS | Disable table headers |
USM_CONFIG | Path to config file |
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication failure |
| 3 | Permission denied |
| 4 | Validation error |
| 5 | Rate limited |
| 6 | Network error |
unifi CLI - For local UniFi Network and Protect APIsusm sites list --page-size 0 --output json > sites.json
SITE_ID=$(usm sites list --search "Office" --output json | jq -r '.[0]._id')
usm sites get "$SITE_ID"
usm whoami || exit 1
usm sites list --no-headers | column -t
Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
mcpjam1
claude-code1
replit1
junie1
windsurf1
zencoder1
Supabase Postgres 最佳实践指南 - 8大类别性能优化规则与SQL示例
78,800 周安装