cli-testing
FreeNo executable scriptsNot checked后端代码修改后,通过 CLI 测试验证功能正确性。使用场景:修改了 electron/services/ 下的代码需要测试、准备提交代码前跑回归、用户要求"跑测试"/"验证一下"。
by ysyx2008★ 26 GitHub starsAbout this skill
CLI 测试
项目提供了 CLI 模式(npm run sailfish,sft/cli 为别名),可在纯 Node.js 下运行所有后端服务。
修改后端代码后,必须利用 CLI 验证功能正确性,不能只靠"能编译"就认为没问题。
数据隔离:从仓库跑 npm run sailfish / node electron/cli/main.js 默认写沙箱,不会进桌面真实历史。回归脚本另用一次性临时目录。不要用 --share-desktop 做验证。装机后的 sailfish 命令跟桌面共用数据,测装机命令时加 --sandbox。
何时使用本技能
- 修改了
electron/services/下的任何服务 - 准备提交后端行为、共享接口或基础设施改动前
- 用户要求"跑测试"、"验证"、"测一下"
完整回归测试(后端行为及公共基础设施改动提交前运行)
纯文档、注释或样式改动不要求 CLI 回归:检查文档引用与规则一致性,或验证受影响界面。测试范围以 AGENTS.md 为准;数据迁移、权限及公共接口还需覆盖失败路径和兼容性。
bash electron/cli/test-cli.sh --no-ai # 无需 AI API Key,~10秒
bash electron/cli/test-cli.sh # 有 API Key 时跑全量
针对性验证(改了哪个服务就测哪个)
| 改动范围 | 验证命令 |
|---|---|
| config.service.ts | sailfish config:get language && sailfish config:set theme '"test"' && sailfish config:get theme |
| ai.service.ts | sailfish ai:models / sailfish ai:chat "测试" |
| agent/ 目录 | sailfish agent:run "列出当前目录文件" --mode free |
| knowledge/ 目录 | sailfish knowledge:list && sailfish knowledge:search "测试" |
| history.service.ts | sailfish history:list && sailfish history:stats |
| host-profile.service.ts | sailfish host:list && sailfish host:get local |
| ssh.service.ts | sailfish ssh:list |
| pty.service.ts | sailfish pty:exec "echo ok" && sailfish pty:shells |
| scheduler.service.ts | sailfish scheduler:list && sailfish scheduler:history |
| mcp.service.ts | sailfish mcp:list |
| local-fs.service.ts | sailfish fs:list /tmp && sailfish fs:info |
| document-parser.service.ts | sailfish doc:parse README.md && sailfish doc:types |
| user-skill.service.ts | sailfish skill:list |
| watch/ 目录 | sailfish watch:list && sailfish watch:history && sailfish watch:templates && sailfish watch:state |
| sensor/ 目录 | sailfish sensor:status && sailfish sensor:heartbeat |
替我审批评审员(真模型评测)
只在改了评审员的规则说明、裁决表、它看的证据,或换评审模型时跑(花真 token,别的改动不跑):node scripts/eval-auto-review.cjs [--profile=模型] [场景名片段]。「必须交给用户」的放行一条即失败;新发现的漏判先补成场景再修。
优先用
npm run sailfish --或node electron/cli/main.js(开发态默认沙箱)。PATH 里的sailfish若来自正式装机,会写桌面真实数据,须加--sandbox。npm run sft仍为别名。
新增服务或命令时
- 在
electron/cli/index.ts中添加对应的 CLI 命令 - 在
test-cli.sh中添加对应的测试用例(包括正常场景和错误场景) - 运行测试套件确认全部通过
- 更新
docs/architecture.md中的架构描述
测试失败怎么办
- 先确认是自己的改动导致的还是已有问题
- 修复后重跑测试,确保全部通过再提交
- 如果是测试脚本本身需要更新(如服务接口变了),同步更新
test-cli.sh
Install cli-testing in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the cli-testing skill do?
后端代码修改后,通过 CLI 测试验证功能正确性。使用场景:修改了 electron/services/ 下的代码需要测试、准备提交代码前跑回归、用户要求"跑测试"/"验证一下"。
How do I install the cli-testing skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the cli-testing skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic