CLI 参考
opensquilla CLI 是配置、运行、查看和自动化 OpenSquilla 最快的方式。
运行:
opensquilla --help
opensquilla <command> --help
主要命令
| 命令 | 用途 |
|---|---|
opensquilla init | 初始化一个工作区。 |
opensquilla doctor | 诊断就绪状态并打印恢复步骤。 |
opensquilla onboard | 运行或查看首次运行设置。 |
opensquilla configure | 重新配置 provider、router、channels、search、image generation 或 memory embedding。 |
opensquilla gateway | 运行和管理 gateway 服务器。 |
opensquilla chat | 启动交互式终端聊天。 |
opensquilla agent | 运行单次面向自动化的 agent turn。 |
opensquilla code-task | 通过 Coding 模式的宿主工作流运行受控的编码任务。 |
opensquilla sessions | 列出、查看、恢复、中止、删除或导出 sessions。 |
opensquilla skills | 列出、搜索、查看、安装、更新、发布和检查 skills。 |
opensquilla memory | 查看和维护记忆。 |
opensquilla channels | 配置和查看消息 channels。 |
opensquilla providers | 配置和查看 LLM provider。 |
opensquilla search | 配置和使用 Web 搜索。 |
opensquilla sandbox | 查看或更改默认 sandbox 策略。 |
opensquilla cron | 管理已调度的 OpenSquilla 运行。 |
opensquilla cost | 查看用量和预估成本。 |
opensquilla diagnostics | 启用或禁用运行时诊断日志。 |
opensquilla replay | 从决策日志中 replay 已记录的 turn。 |
opensquilla migrate | 从外部 agent 运行时迁移状态。 |
opensquilla models | 查看可用 model。 |
opensquilla agents | 管理持久化 agent。 |
opensquilla mcp-server | 运行 OpenSquilla MCP server 桥接器。 |
opensquilla swebench | 运行可选的 SWE-bench 求解/评测工作流。 |
opensquilla dist | 生成可复现的工作区状态清单。 |
opensquilla reset | 重置 session 并同步刷新记忆。 |
运行入口
Web UI 和 gateway:
opensquilla gateway run
opensquilla gateway start --json
opensquilla gateway status
opensquilla gateway restart
opensquilla gateway stop
终端聊天:
opensquilla chat
opensquilla chat --model gpt-5.4-mini
opensquilla chat --session <session-key>
opensquilla chat --standalone --workspace /path/to/project
OPENSQUILLA_TUI_BACKEND=opentui opensquilla chat
终端聊天默认使用稳定的 Python 原生终端后端。OpenTUI 是一个预览后端,仅在评估该后端时通过 OPENSQUILLA_TUI_BACKEND=opentui 显式选择。普通终端聊天不需要 Bun 或 OpenTUI 的 node 模块。旧版后端取值会在启动前被拒绝。关于流式平面、插件槽位、Router HUD 和 replay 基准工作流,请阅读 features/tui-frontend.md。
Web 聊天和 CLI gateway TUI 支持用 /meta 手动启动 MetaSkill:/meta 列出可用的工作流,/meta <name> 运行其中一个。Channel 入口和独立的 CLI 聊天可以用 /meta 列出 MetaSkill,但它们不能直接启动 MetaSkill 运行。
一次性自动化:
opensquilla agent -m "Review the current directory"
opensquilla agent --json -m "Return a short machine-readable summary"
opensquilla agent --workspace /path/to/project --workspace-strict -m "Inspect this repo"
opensquilla agent --timeout 600 --max-iterations 30 -m "Run a bounded investigation"
实用的自动化参数:
| 参数 | 用途 |
|---|---|
--workspace | 设置工作区根目录。 |
--workspace-strict | 将读类文件工具限制在工作区内。 |
--workspace-lockdown | 将写操作限制在工作区或 scratch 目录中。 |
--scratch-dir | 将临时脚本、日志和候选补丁放在已知目录中。 |
--timeout | 设置 agent 总挂钟超时。 |
--max-iterations | 限制 model/工具循环次数。 |
--max-provider-retries | 限制临时性的 provider 重试次数。 |
--length-capped-continuations | 限制 provider 输出因长度受限后的自动续写次数。 |
--thinking | 覆盖 reasoning 等级。 |
--permissions | 选择 restricted、bypass 或 full 权限策略。 |
--transcript-path | 写入用于自动化的 JSONL transcript。 |
--usage-path | 写入用量 JSON。 |
--session-db-path | 跨调用持久化 session replay。 |
Coding 模式与 Code-Task
Coding 模式通过 code-task 工作流来处理代码修改工作。它面向受信任的代码仓库:code-task 在宿主上运行一个 OpenSquilla agent,可能会安装依赖,并且不是一个 OS 沙箱。
opensquilla code-task solve --repo /path/to/repo --task-file task.md --yes
opensquilla code-task solve --repo https://github.com/org/project.git --issue 123
opensquilla code-task solve --verification-mode scratch --task "Create a small CLI parser" --yes
opensquilla code-task solve --repo /path/to/app --task-file task.md --verification-mode build --yes
只能使用一个任务来源:--issue、--task 或 --task-file。非交互式调用方必须传入 --yes 以确认受信任宿主边界。工作发生在 OpenSquilla 状态树下的隔离运行目录中;只有在工作流收集并验证出有效更改之后,源仓库才会被更新。
--verification-mode red-green 是已有仓库的默认值。--verification-mode build 用于应用或产物交付检查。--verification-mode scratch 会创建一个空的一次性仓库,且不能与 --repo 组合使用。
SWE-Bench
opensquilla swebench 是一个可选的评测入口,不属于常规安装路径。它需要 Docker 以及 swebench 额外依赖。
uv tool install --python 3.12 "opensquilla[recommended,swebench] @ https://github.com/opensquilla/opensquilla/releases/download/v0.4.0/opensquilla-0.4.0-py3-none-any.whl"
opensquilla swebench pull django__django-16429 --dataset verified
opensquilla swebench solve django__django-16429 --dataset verified --json
opensquilla swebench eval predictions.jsonl --dataset verified
当你不需要基于 Docker 的 SWE-bench 测评框架时,对于受信任的真实仓库编码任务,请使用 opensquilla code-task。
配置命令
provider 和 router:
opensquilla onboard
opensquilla onboard status
opensquilla configure provider --provider openrouter --api-key-env OPENROUTER_API_KEY
opensquilla configure router --router recommended
opensquilla providers list
opensquilla providers configure openrouter
opensquilla providers status
搜索:
opensquilla search list
opensquilla search configure duckduckgo
opensquilla search query "latest OpenSquilla release"
opensquilla configure search --search-provider duckduckgo
channels:
opensquilla channels types
opensquilla channels describe telegram
opensquilla channels add telegram --name personal
opensquilla channels list
opensquilla channels status
opensquilla channels enable personal
opensquilla channels disable personal
opensquilla channels restart personal
opensquilla channels remove personal
原始配置:
opensquilla config get llm.provider
opensquilla config set gateway.port 18791
更多细节:
Skill 和 MetaSkill
opensquilla skills list
opensquilla skills search pdf
opensquilla skills view pdf-toolkit
opensquilla skills install <skill-name>
opensquilla skills update --all
opensquilla skills uninstall <skill-name>
opensquilla skills inspect meta-skill-creator
opensquilla skills meta proposals list
opensquilla skills meta runs list
opensquilla skills meta runs show <run-id>
opensquilla skills meta runs steps <run-id>
opensquilla skills meta runs replay <run-id> --dry-run
当你希望在调用 MetaSkill 之前查看其编译后的步骤计划时,使用 skills inspect。
MetaSkill 默认仅限手动触发。在 Web 聊天和 CLI gateway TUI 中,运行 /meta 列出工作流,运行 /meta <name> 启动其中一个。除非在配置中设置 meta_skill.auto_trigger = true 以兼容旧有行为,否则自然语言自动触发是被禁用的。
阅读:
features/skills.mdfeatures/meta-skills.mdfeatures/meta-skill-user-guide.mdauthoring/meta-skills.md
sessions 和历史
opensquilla sessions list
opensquilla sessions show <session-key>
opensquilla sessions resume <session-key>
opensquilla sessions abort <session-key>
opensquilla sessions export <session-key>
opensquilla sessions delete <session-key>
阅读:sessions.md
记忆
opensquilla memory status
opensquilla memory index
opensquilla memory list
opensquilla memory search "preference"
opensquilla memory show <path>
opensquilla memory dream
opensquilla memory flush-session <session-key>
opensquilla memory repair list
opensquilla memory raw-fallbacks list
持久化 agent 与调度
opensquilla agents list
opensquilla agents add research --name Research --workspace /path/to/research
opensquilla agents delete research
opensquilla cron list
opensquilla cron add --every 1h --text "Summarize important updates" --name hourly-summary
opensquilla cron status <job-id>
opensquilla cron runs <job-id>
阅读:
成本、诊断与 replay
opensquilla cost
opensquilla diagnostics status
opensquilla diagnostics on
opensquilla diagnostics off
opensquilla replay --session <session-key> --turn <turn-id>
当你需要理解某个 turn 为何如此表现时,请使用诊断和 replay。
阅读:
MCP server 桥接器
opensquilla mcp-server run
opensquilla mcp-server run --gateway ws://localhost:18792/ws