360 Secure SkillHub
360 安全技能中心

Unraid CLI

这是Unraid服务器的TypeScript CLI工具,基于GraphQL API,提供12组命令(系统、容器、VM、磁盘等),支持查询状态、管理资源等操作。典型场景含系统健康巡检、容器生命周期管理。输入为带参数的CLI指令,推荐用--output json输出机器可读内容,内置安全防护规则,适配人类与AI代理使用。

ingodibella
ingodibella
热度 44.82
最近更新 2026-05-11 17:38:47
分类:开发依赖:代码执行应用场景:API 集成 / 自动化脚本 / DevOps / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add unraid-cli
Metadata
name
unraid-cli
description
TypeScript CLI for Unraid Server GraphQL API. 12 command groups for system, arrays, disks, containers, VMs, shares, logs, and diagnostics. Built for humans and AI agents.
version
0.4.0
homepage
https://github.com/Ingodibella/unraid-cli
metadata
{"openclaw":{"emoji":"🖥️","requires":{"bins":["ucli"],"env":["UNRAID_HOST","UNRAID_API_KEY"]},"install":[{"id":"npm","kind":"node","package":"unraid-cli","bins":["ucli"],"label":"Install unraid-cli (npm)"}]},"author":"Ingodibella","license":"MIT"}

ucli agent guide

CLI: ucli [global flags] <group> <command> [args...]

Recommended defaults

ucli --output json --quiet <group> <command>
  • --output json for machine-readable output
  • --quiet to suppress decorative text
  • --fields to shrink payloads
  • --filter and --sort to shape data before it hits your context

Guardrails

  • Prefer read-only commands first. Inspect before acting.
  • Use --yes only in deliberate automation paths, never speculatively.
  • Pair destructive actions with explicit identifiers. No fuzzy matching in the shell.
  • Re-fetch state after any mutation. Do not trust a prior cache.
  • Treat exit code 0 as success. Non-zero: capture stderr, retry only on transient failures.

Command groups

Group Typical use
system info, health, status, resources, uptime
array status, devices, parity, parity-check actions
disks Inventory, SMART, temp, usage, mount
containers list, inspect, logs, stats, lifecycle actions
notifications list, latest, get, create, archive
vms list, inspect, lifecycle actions
shares list, get, usage
logs list, get, system, tail, search
services list, get, status
network Interfaces, status
schema API introspection
diagnostics ping, latency, env, doctor

Workflow: health check

ucli system info --output json --quiet
ucli system health --output json --quiet
ucli array status --output json --quiet
ucli services status --output json --quiet
  1. Fetch each separately. Fail fast on non-zero exits.
  2. Summarize array state, service state, resource pressure, warnings.
  3. Only pull logs if the snapshot shows trouble.

Workflow: container management

# list running
ucli containers list --output json --quiet --fields id,names,state,status --sort names:asc

# inspect one
ucli containers inspect <id> --output json --quiet

# restart
ucli containers restart <id> --yes --output json --quiet
  1. Resolve target by id or names.
  2. Inspect current state.
  3. Execute with --yes when confirmation would block automation.
  4. Re-read status after mutation.

Anti-patterns

  • Don't parse human-readable output. Always use --output json.
  • Don't assume partial success from human-readable text. Check exit codes.
  • Don't retry on non-transient errors (auth, bad arguments, missing resources).
  • Don't skip --fields on large result sets. Token waste adds up fast.
  • Don't chain mutations without re-fetching state between them.
  • Don't use --force unless you understand exactly what it skips.

Configuration

Default config path: ~/.config/ucli/config.yaml

default_profile: lab
profiles:
  lab:
    host: http://192.168.1.10:7777
    apiKey: YOUR_API_KEY
    output: json
    timeout: 30

Prefer --host and --api-key explicitly for isolated jobs, --profile <name> for stable environments.

ucli agent guide

CLI: ucli [global flags] <group> <command> [args...]

Recommended defaults

ucli --output json --quiet <group> <command>
  • --output json for machine-readable output
  • --quiet to suppress decorative text
  • --fields to shrink payloads
  • --filter and --sort to shape data before it hits your context

Guardrails

  • Prefer read-only commands first. Inspect before acting.
  • Use --yes only in deliberate automation paths, never speculatively.
  • Pair destructive actions with explicit identifiers. No fuzzy matching in the shell.
  • Re-fetch state after any mutation. Do not trust a prior cache.
  • Treat exit code 0 as success. Non-zero: capture stderr, retry only on transient failures.

Command groups

Group Typical use
system info, health, status, resources, uptime
array status, devices, parity, parity-check actions
disks Inventory, SMART, temp, usage, mount
containers list, inspect, logs, stats, lifecycle actions
notifications list, latest, get, create, archive
vms list, inspect, lifecycle actions
shares list, get, usage
logs list, get, system, tail, search
services list, get, status
network Interfaces, status
schema API introspection
diagnostics ping, latency, env, doctor

Workflow: health check

ucli system info --output json --quiet
ucli system health --output json --quiet
ucli array status --output json --quiet
ucli services status --output json --quiet
  1. Fetch each separately. Fail fast on non-zero exits.
  2. Summarize array state, service state, resource pressure, warnings.
  3. Only pull logs if the snapshot shows trouble.

Workflow: container management

# list running
ucli containers list --output json --quiet --fields id,names,state,status --sort names:asc

# inspect one
ucli containers inspect <id> --output json --quiet

# restart
ucli containers restart <id> --yes --output json --quiet
  1. Resolve target by id or names.
  2. Inspect current state.
  3. Execute with --yes when confirmation would block automation.
  4. Re-read status after mutation.

Anti-patterns

  • Don't parse human-readable output. Always use --output json.
  • Don't assume partial success from human-readable text. Check exit codes.
  • Don't retry on non-transient errors (auth, bad arguments, missing resources).
  • Don't skip --fields on large result sets. Token waste adds up fast.
  • Don't chain mutations without re-fetching state between them.
  • Don't use --force unless you understand exactly what it skips.

Configuration

Default config path: ~/.config/ucli/config.yaml

default_profile: lab
profiles:
  lab:
    host: http://192.168.1.10:7777
    apiKey: YOUR_API_KEY
    output: json
    timeout: 30

Prefer --host and --api-key explicitly for isolated jobs, --profile <name> for stable environments.