Cybrave CLI 命令行工具
通过终端、脚本或 AI 智能体管理运行 Cybrave OS 的防火墙。
Cybrave CLI 是面向 AI 智能体的防火墙命令行工具。它以单个可执行程序 cybrave-cli 运行在你的电脑上,可通过终端、脚本或 AI 智能体管理一台或多台运行 Cybrave OS 的防火墙。
示例:添加拒绝规则
智能体为一个地址添加拒绝规则:先预览变更,经你批准后才保存。
智能体会话
- youBlock traffic from 203.0.113.7 on the edge firewall.
- $cybrave-cli capability get policy security-rule create
- $cybrave-cli policy security-rule create --data @rule.json --insert first --dry-run
- agentOn https://10.0.0.1, I will add an IP address object for 203.0.113.7 and a deny rule at the top with it as the source. Saving publishes the change. Proceed?
- youYes.
- $cybrave-cli object ip-address create --data @address.json --yes
- $cybrave-cli policy security-rule create --data @rule.json --insert first --yes
- $cybrave-cli config change-states --resource container=security-policy
- agentDone. The deny rule is published and applied.
你只需指定变更并批准,命令由智能体执行。
you Block traffic from 203.0.113.7 on the edge firewall.
$ cybrave-cli capability get policy security-rule create
$ cybrave-cli policy security-rule create --data @rule.json --insert first --dry-run
agent On https://10.0.0.1, I will add an IP address object for 203.0.113.7 and a deny rule at the top with it as the source. Saving publishes the change. Proceed?
you Yes.
$ cybrave-cli object ip-address create --data @address.json --yes
$ cybrave-cli policy security-rule create --data @rule.json --insert first --yes
$ cybrave-cli config change-states --resource container=security-policy
agent Done. The deny rule is published and applied.主要特性
- 一次安装,管理多台防火墙。 每台设备一个 profile(连接配置)。
- 先批准,后变更。 智能体先展示每项变更,经你批准后才保存。
- 有版本,可回退。 每项已发布的变更都记录作者,并可撤销。
- 内置安全保护。 变更必须明确确认,CLI 不会作用到你没有指明的设备。
- 为 AI 智能体而设计。 CLI 自带智能体技能,支持 Claude Code、Codex、Cursor、GitHub Copilot、Gemini CLI 和 OpenCode。
- 便于自动化。 每条命令都能说明自身用法,并返回便于脚本处理的结构化输出。
安装
见快速开始。
配合 AI 智能体使用
CLI 连接设备后,向智能体提供以下提示词:
Run `cybrave-cli doctor --format json` and tell me what it reports.
Do not change any configuration until I ask you to.核心概念
| 概念 | 说明 |
|---|---|
| Profile(连接配置) | 保存的某台设备的连接设置。每台设备一个 profile。 |
| 访问令牌 | CLI 登录设备所用的凭据,在设备 Web 界面中创建。参见我的账户。 |
| 配置发布模式 | 决定保存的变更何时生效。保存即发布(默认):保存后立即生效。手动发布:变更保留,直到管理员提交。参见发布方式。 |
| 确认 | 会改变设备的命令必须经过明确确认才会执行。提交变更和重启等操作还需要你指明设备。 |
兼容性
CLI 与设备的版本不必一致,只要设备提供命令所调用的操作即可。升级后运行 cybrave-cli doctor,可列出缺失的操作。