本文同步自影刀社区 RPA 板块(文章),作者 【耐家军】DC:原文链接
基于 shadowbot.shell-cli.exe 编写,整理全部命令、使用场景、实操示例、故障排查与环境要求,适用于 Windows 平台下通过 PowerShell 对 ShadowBot 进行命令行管理、自动化运维、应用开发与任务调度。CLI 支持单条指令执行、批量操作以及脚本自动化运行,摆脱图形界面限制,大幅提升运维与开发效率。
一、基础说明
1.1 命令通用格式
所有指令统一遵循以下书写规则:
powershell
shadowbot.shell-cli.exe <命令> [子命令] [参数]1.2 全局通用参数
所有命令均可搭配以下全局参数使用:
--timeout <时长>:设置 HTTP 超时时间,例如10s,默认超时时间为15s-h/--help:查看当前命令的帮助文档
1.3 输出格式
CLI 执行后统一返回 JSON 格式数据,固定字段如下:
ok:布尔值,标记操作是否执行成功command:当前执行的命令内容timestamp:操作执行时间戳data:命令返回的业务数据message:操作状态描述、提示或报错信息
1.4 环境要求
- 操作系统:Windows 10 / Windows 11
- 前置软件:已安装 ShadowBot 客户端
- 运行终端:PowerShell 5.1 及以上版本
- 基础条件:设备网络连接正常
二、认证与登录管理
账号登录是所有操作的前置步骤,CLI 支持账号密码登录、免密登录以及账号信息查询。
2.1 账号登录
powershell
# 完整账号密码登录shadowbot.shell-cli.exe auth login --username <用户名> --password <密码>
# 免密登录(使用本地已记忆的账号密码)shadowbot.shell-cli.exe auth login --username <用户名>2.2 账号信息管理
powershell
# 查看当前已登录账号shadowbot.shell-cli.exe auth current
# 列出本地所有已记忆的账号shadowbot.shell-cli.exe auth account list三、应用全生命周期管理
涵盖应用查询、详情查看、版本管理、发布、回收、分组、协作者等全套操作。
3.1 应用查询
powershell
# 列出个人已开发应用(默认类型)shadowbot.shell-cli.exe console app
# 列出已订阅的应用shadowbot.shell-cli.exe console app --app-type subscribed
# 根据关键词搜索应用shadowbot.shell-cli.exe console app --search <关键词>
# 分页查询应用(页码+单页条数)shadowbot.shell-cli.exe console app --page 1 --page-size 203.2 应用详情与版本
powershell
# 查看指定应用详情shadowbot.shell-cli.exe console app detail --app-id <应用ID>
# 查看应用版本历史记录shadowbot.shell-cli.exe console app versions --app-id <应用ID>3.3 应用基础操作
powershell
# 发布指定应用shadowbot.shell-cli.exe console app publish --app-id <应用ID>
# 将应用移入回收站shadowbot.shell-cli.exe console app recycle --app-id <应用ID>
# 查看回收站中的应用列表shadowbot.shell-cli.exe console app recycle list3.4 应用分组管理
powershell
# 查看全部应用分组shadowbot.shell-cli.exe console app group list
# 新建应用分组shadowbot.shell-cli.exe console app group create --name <分组名称>
# 将应用移动至指定分组shadowbot.shell-cli.exe console app group move --app-id <应用ID> --group-id <分组ID>
# 将应用从当前分组中移除shadowbot.shell-cli.exe console app group remove --app-id <应用ID>3.5 协作者管理
powershell
# 应用协作者配置与管理shadowbot.shell-cli.exe console app collaborator四、任务控制与运维
负责应用任务启动、停止、状态查询、日志查看以及历史记录追溯。
4.1 启动任务
powershell
# 运行指定应用,启动任务shadowbot.shell-cli.exe console task run --app-id <应用ID>4.2 任务实时管理
powershell
# 停止正在运行的任务shadowbot.shell-cli.exe console task stop --task-id <任务ID>
# 查询任务当前运行状态shadowbot.shell-cli.exe console task status --task-id <任务ID>
# 查看任务执行日志(用于故障排查)shadowbot.shell-cli.exe console task logs --task-id <任务ID>4.3 任务历史记录
powershell
# 分页查看所有任务执行历史shadowbot.shell-cli.exe console task history --page 1 --page-size 20五、触发器管理
触发器是实现自动化触发的核心,包含通用操作、文件、热键、邮件、计划五大类触发器。
5.1 通用触发器操作
适用于所有类型触发器,统一管理启停、查询、删除。
powershell
# 列出系统内全部触发器shadowbot.shell-cli.exe console trigger list
# 查看单个触发器详情shadowbot.shell-cli.exe console trigger get --id <触发器ID>
# 启用指定触发器shadowbot.shell-cli.exe console trigger enable --id <触发器ID>
# 禁用指定触发器shadowbot.shell-cli.exe console trigger disable --id <触发器ID>
# 删除指定触发器shadowbot.shell-cli.exe console trigger delete --id <触发器ID>5.2 文件触发器
powershell
# 新增文件触发器shadowbot.shell-cli.exe console trigger file add
# 更新文件触发器配置shadowbot.shell-cli.exe console trigger file update
# 列出所有文件触发器shadowbot.shell-cli.exe console trigger file list5.3 热键触发器
powershell
# 新增热键触发器shadowbot.shell-cli.exe console trigger hotkey add
# 更新热键触发器配置shadowbot.shell-cli.exe console trigger hotkey update
# 列出所有热键触发器shadowbot.shell-cli.exe console trigger hotkey list5.4 邮件触发器
powershell
# 新增邮件触发器shadowbot.shell-cli.exe console trigger email add
# 更新邮件触发器配置shadowbot.shell-cli.exe console trigger email update
# 列出所有邮件触发器shadowbot.shell-cli.exe console trigger email list5.5 计划触发器(定时任务)
powershell
# 新增定时计划触发器shadowbot.shell-cli.exe console trigger schedule add
# 更新定时计划触发器配置shadowbot.shell-cli.exe console trigger schedule update
# 列出所有计划触发器shadowbot.shell-cli.exe console trigger schedule list六、消息中心管理
用于查看消息、区分已读 / 未读状态,支持单条或批量标记已读。
6.1 消息查询
powershell
# 查看全部消息(含已读、未读)shadowbot.shell-cli.exe console message list --status all
# 仅查看未读消息shadowbot.shell-cli.exe console message list --status unread
# 仅查看已读消息shadowbot.shell-cli.exe console message list --status read6.2 消息状态操作
powershell
# 将单条消息标记为已读shadowbot.shell-cli.exe console message read --id <消息UUID>
# 批量将所有消息标记为已读shadowbot.shell-cli.exe console message read-all七、界面与页面操作
支持主题切换、功能页面跳转、外部链接快速打开,适配个性化使用需求。
7.1 主题切换
powershell
# 切换为亮色主题shadowbot.shell-cli.exe console theme switch --target light
# 切换为暗色主题shadowbot.shell-cli.exe console theme switch --target dark
# 恢复默认主题shadowbot.shell-cli.exe console theme switch --target default7.2 功能页面切换
powershell
# 跳转至应用页面shadowbot.shell-cli.exe console page switch --target app
# 跳转至触发器页面shadowbot.shell-cli.exe console page switch --target trigger
# 跳转至市场页面shadowbot.shell-cli.exe console page switch --target market
# 跳转至教程页面shadowbot.shell-cli.exe console page switch --target tutorial
# 跳转至优秀案例页面shadowbot.shell-cli.exe console page switch --target excellence7.3 外部链接打开
powershell
# 打开社区页面shadowbot.shell-cli.exe console link open --target community
# 打开漫画页面shadowbot.shell-cli.exe console link open --target comic
# 打开网页控制台shadowbot.shell-cli.exe console link open --target web-console
# 打开成就页面shadowbot.shell-cli.exe console link open --target achievement
# 打开开发者反馈页面shadowbot.shell-cli.exe console link open --target dev-feedback八、扩展管理
管理客户端各类插件扩展,支持状态查询、安装操作。
支持扩展类型:chrome、edge、device、screen-unlock、background-wakeup
8.1 扩展状态查询
powershell
# 查看所有扩展运行状态shadowbot.shell-cli.exe console extension list
# 查看指定类型扩展状态shadowbot.shell-cli.exe console extension get --type <类型>8.2 扩展安装
powershell
# 安装指定类型扩展shadowbot.shell-cli.exe console extension install --type <类型>
# 安装扩展并等待安装流程完成shadowbot.shell-cli.exe console extension install --type <类型> --wait九、Studio 开发操作
面向开发者,实现应用创建、打开、保存、同步等开发流程。
9.1 应用创建与打开
powershell
# 创建新应用,创建完成后关闭 Studioshadowbot.shell-cli.exe studio create --name <应用名称>
# 创建新应用并保持 Studio 窗口打开shadowbot.shell-cli.exe studio open --name <应用名称>
# 在 Studio 中打开已有应用shadowbot.shell-cli.exe studio open-app --app-id <应用ID>9.2 当前应用编辑操作
powershell
# 获取 Studio 中当前打开的应用信息shadowbot.shell-cli.exe studio current get
# 更新当前应用基础信息shadowbot.shell-cli.exe studio current update-info
# 手动保存当前应用shadowbot.shell-cli.exe studio current save
# 同步数据并关闭当前应用shadowbot.shell-cli.exe studio current sync十、系统级操作
包含运行模式切换、服务健康检测、版本查看等底层运维功能。
10.1 运行模式切换
powershell
# 切换至控制台模式shadowbot.shell-cli.exe mode switch --to console
# 切换至助手模式shadowbot.shell-cli.exe mode switch --to assistant
# 强制切换模式(存在运行任务时也可切换)shadowbot.shell-cli.exe mode switch --to console --force10.2 系统状态检测
powershell
# 检测 API 服务健康状态shadowbot.shell-cli.exe system health
# 获取客户端完整运行时状态shadowbot.shell-cli.exe system state
# 查看 CLI 工具版本号shadowbot.shell-cli.exe system version十一、实战示例
11.1 完整常规工作流
适用于日常使用:登录 → 查询应用 → 运行任务 → 查看状态 → 界面设置
powershell
# 1. 免密登录账号shadowbot.shell-cli.exe auth login --username [email protected]
# 2. 确认当前登录账号shadowbot.shell-cli.exe auth current
# 3. 搜索指定名称应用shadowbot.shell-cli.exe console app --search "发票"
# 4. 运行目标应用shadowbot.shell-cli.exe console task run --app-id 01234567-89ab-cdef-0123-456789abcdef
# 5. 查看任务运行状态shadowbot.shell-cli.exe console task status --task-id 98765432-10fe-dcba-9876-543210fedcba
# 6. 切换为暗色主题shadowbot.shell-cli.exe console theme switch --target dark11.2 自动化运维脚本
适用于定时执行的批量运维操作
powershell
# 检查系统健康状态shadowbot.shell-cli.exe system health
# 获取系统运行状态shadowbot.shell-cli.exe system state
# 查看所有未读消息shadowbot.shell-cli.exe console message list --status unread
# 一键标记所有消息为已读shadowbot.shell-cli.exe console message read-all11.3 应用开发发布流程
开发者标准流程:创建 → 打开 → 保存 → 发布
powershell
# 1. 创建新应用shadowbot.shell-cli.exe studio create --name "自动发票处理"
# 2. 在 Studio 中打开应用shadowbot.shell-cli.exe studio open-app --app-id <应用ID>
# 3. 保存编辑后的应用shadowbot.shell-cli.exe studio current save
# 4. 正式发布应用shadowbot.shell-cli.exe console app publish --app-id <应用ID>十二、故障排除
12.1 常见错误及解决办法
- 找不到命令:检查命令拼写,使用
-h查看对应命令帮助 - 登录失败:核对用户名与密码,优先使用免密登录重试
- 连接超时:检查 ShadowBot 客户端是否正常启动、网络是否通畅
- 权限不足:以管理员身份启动 PowerShell 后重新执行命令
12.2 标准诊断步骤
出现异常时,按以下顺序逐项排查:
powershell
# 1. 查看 CLI 版本,确认工具完整性shadowbot.shell-cli.exe system version
# 2. 检测后端 API 服务健康状态shadowbot.shell-cli.exe system health
# 3. 查看客户端整体运行状态shadowbot.shell-cli.exe system state
# 4. 验证账号登录状态与权限shadowbot.shell-cli.exe auth current十三、附录:关键字段说明
- 应用 ID:应用唯一标识,格式为 UUID
- 任务 ID:运行任务的唯一标识,格式为 UUID
- 触发器 ID:触发器唯一标识,格式为 UUID
- 消息 UUID:单条消息的唯一标识,格式为 UUID
注意事项:
Beta版现已在企业版开启试用,个人版预计将在 V6.3 版本上线,敬请期待。
参考地址