About ikuai-cli
ikuai-cli is a Go command-line tool for managing iKuai routers through the local v4.0 HTTP API, aimed at operators and agents. It covers network, security, user, and system operations, with output formats for scripts and agents plus a dry-run preview.
Key features
- 01Inspect router status and traffic
- 02Manage DNS, DHCP, VLAN, NAT, and VPN
- 03Manage online users and auth accounts
- 04Configure access controls and filters
- 05Use JSON, YAML, and dry-run modes
Use cases
- 01Check router resources and network traffic
- 02Configure network and VPN settings
- 03Manage online sessions and access controls
- 04Preview or run batch operations through scripts
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ ikuaidev/ ikuai-cli --skill ikuai-cliAfter installing, type/ikuai-cliin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
.gitignore.golangci.ymlREADME.mdCONTRIBUTING.mdCODE_OF_CONDUCT.md.goreleaser.ymlMakefileSECURITY.mdLICENSEREADME_CN.md.github/dependabot.ymlpull_request_template.md.github/ISSUE_TEMPLATE/feature_request.mdbug_report.mdconfig.yml.github/workflows/codeql.ymlci.ymlrelease.ymlcmd/ikuai-cli/main.godocs/cli-reference.mdcompatibility.mdinstall.mddocs/commands/output.mddocs/examples/auth-status.pretty.jsonauth-status.compact.jsonmonitor-system.pretty.jsonREADME.mdversion.compact.jsonusers-accounts-list.compact.jsonsystem-set-response.compact.jsonDetails
From the project READMEikuai-cli — AI Agent Skill
Go CLI for managing iKuai routers through the local v4.0 HTTP API.
When to Use
- Router status, CPU, memory, uptime, traffic
- Network: DNS, DHCP, VLAN, NAT, PPPoE, VPN
- Users: online sessions, kick, auth accounts
- Security: ACL, MAC filter, URL filter, domain blacklist
- System: logs, schedules, remote access, VRRP
Prerequisites
# Session (persistent)
ikuai-cli auth set-url https://192.168.1.1
ikuai-cli auth set-token <TOKEN>
# OR environment variables (ephemeral)
export IKUAI_CLI_BASE_URL=https://192.168.1.1
export IKUAI_CLI_TOKEN=<TOKEN>
# Verify
ikuai-cli auth status --format json
Priority: Session file > Environment variables > None.
Output Modes
| Flag | Mode | Use case |
|---|---|---|
| (default) | table (TTY) / JSON (pipe) | human / script auto-detect |
--format json | compact JSON | agent parsing, pipe to jq |
--format yaml | YAML | token-efficient for LLM |
--raw | full API envelope | debug |
--human-time | timestamp → local time | log reading |
--dry-run | preview, no execute | safety check |
Domain Skills
| Skill | File | Scope |
|---|---|---|
| Monitor | monitor.md | CPU, memory, traffic, clients |
| Network | network.md | DNS, DHCP, VLAN, NAT, WAN/LAN, PPPoE |
| Security | security.md | ACL, MAC, L7, URL, domain blacklist, peerconn |
| VPN | vpn.md | PPTP, L2TP, OpenVPN, IKEv2, IPSec, WireGuard |
| Users | users.md | Online users, accounts, packages |
| System | system.md | Config, schedules, remote access, VRRP, ALG, kernel |
| Auth | auth.md | Login, PPPoE auth accounts |
| Auth Server | auth-server.md | Web portal auth config |
| Log | log.md | System/DHCP/PPPoE/auth/ARP logs |
| Objects | objects.md | IP/IPv6/MAC/port/protocol/domain/time objects |
| QoS | qos.md | IP/MAC bandwidth control |
| Routing | routing.md | Static routes, stream shunting |
| Wireless | wireless.md | Blacklist, VLAN, AC management |
| Advanced | advanced.md | FTP, HTTP, Samba, SNMPD |
| Batch | batch.md | Multi-command workflows |
Command Shape
ikuai-cli <resource> <action> [args] [flags]
- Read:
ikuai-cli monitor system --format json - List:
ikuai-cli network dhcp list --page 1 --page-size 50 - Write:
ikuai-cli network dhcp create --name "Office" --interface lan1 --addr-pool 192.168.1.100-200 - Write (escape hatch):
ikuai-cli network dns set --data '{"key":"value"}' - REPL:
ikuai-cli(interactive shell)
Error Handling
{"code": 3007, "message": "Invalid token"}
| Code | Meaning | Fix |
|---|---|---|
| 3007 | Invalid/expired token | auth set-token <TOKEN> |
| 1008 | Session expired | auth set-token <TOKEN> |
| 10014 | Permission denied | Check user permissions |
Comments
Markdown supported