Command reference / 命令参考

August 28, 2026 · View on GitHub

This file has two halves. The inventory below is generated by ops/ci/generate_tool_reference.py from the clawock distribution's two command registries (clawock.cli.PACKAGED_UTILITIES and the root [project.scripts]) and the classification in config/information-layers.json, so a command that is added, renamed or removed changes it without anyone editing this page. Everything after it is hand-written, and covers what a registry cannot hold: flag tables, SEC's rate limit, which key each provider needs, and how the cron harness fits together.

上半部分是生成的完整清单(新增/删除命令自动反映,禁止手改);下半部分是手写细节, 从根目录 TOOLS.md 外移(TOOLS.md 受 openclaw 16K bootstrap 注入上限约束), TOOLS.md 只留精简索引 + 路由。

Installed commands / 已安装命令

66 commands are installed by the single clawock distribution: 54 CLI subcommands and 12 standalone scripts. 41 of them collect or compute information and appear under the layer they feed; the remaining 25 publish, gate, record or schedule, and are listed with the reason they are not collection.

本节由生成器从两份 registry 与 config/information-layers.json 推导,不手写;新增或删除一条命令,这张表自己会变。

Layer 1 · Market / 行情

Sources: Tencent · Yahoo · Eastmoney · Polygon

CommandModuleWhat it collects or computes
clawock analyze-hkclawock.market_data.hk_analysisHK holdings: Tencent + Eastmoney dual-source reconciliation, stooq/yfinance fallback
clawock analyze-usclawock.market_data.us_analysisUS holdings: price refresh plus RSI/MA and news-derived signals
clawock us-quotesclawock.market_data.us_quotesmulti-provider US quote fetcher, seven-route fallback
clawock fetch-peersclawock.market_data.peer_quotescurrent price and 5-day P&L for peer tickers
clawock daily-barsclawock.market_data.barscanonical unadjusted daily OHLC store the ledger settles against
clawock benchmarkclawock.market_data.benchmarksSPY / HSI / HSTECH daily-close history for the equity-curve overlay
clawock-gold-fetchclawock.market_data.gold.fetchdaily NAV for the 000217 gold DCA position from the Eastmoney fund API

Layer 2 · Fundamentals & filings / 基本面/申报

Sources: SEC EDGAR · Eastmoney datacenter · HKEX

CommandModuleWhat it collects or computes
clawock filingsclawock.market_data.filings10-K/10-Q/8-K, XBRL concepts, Form 4, 13F-HR
clawock fundamentalsclawock.market_data.fundamentalsEastmoney datacenter fundamentals for US and HK names
clawock earningsclawock.decision.earningsprimary-source earnings review and earnings-quality math

Layer 3 · Capital flow / 资金面

Sources: Eastmoney push2his

CommandModuleWhat it collects or computes
clawock fundflowclawock.market_data.fund_flowsdaily fund-flow series for US and HK names

Layer 4 · News & catalysts (bilingual) / 消息面与催化剂(双语)

Sources: Eastmoney · Finnhub · Google News · exchange filings

CommandModuleWhat it collects or computes
clawock em-newsclawock.market_data.eastmoney_newsChinese-language Eastmoney news for active HK holdings
clawock catalystsclawock.market_data.calendarnext 14 days of earnings, FOMC and macro events
clawock mover-evidenceclawock.market_data.mover_evidencefiling-first catalyst probe, fired only for names that already moved
clawock news-evidenceclawock.evidence.news_evidence_graphdeduplicates news and filings into an expiring evidence graph with confirmation gates
clawock-news-digestclawock.automation.news_digestUS 21:00 digest; Finnhub with a Google News RSS fallback per ticker

Layer 5 · Macro & sentiment / 宏观/情绪

Sources: Yahoo · Reddit · CNN · social feeds

CommandModuleWhat it collects or computes
clawock macroclawock.market_data.macroVIX, 10Y, DXY, Fear & Greed, Federal Reserve releases
clawock sentimentclawock.market_data.sentimentReddit, Google News and Yahoo RSS scan per active holding
clawock-influencer-scanclawock.automation.influencermarket-moving statements from high-impact figures, read from primary feeds

Layer 6 · Quant & risk / 量化与风险

Sources: deterministic math over price history

CommandModuleWhat it collects or computes
clawock quantclawock.decision.signalsstandard factor layer over held names, zero LLM opinion
clawock quant-reviewclawock.decision.signal_reviewmeasures each factor's own hit rate before it may be quoted
clawock cross-factorclawock.market_data.factorspoint-in-time, sector-neutral cross-sectional ranking over a curated universe
clawock peer-residualclawock.market_data.peer_residualscurated-peer residual alpha, leadership and diffusion
clawock t0clawock.decision.setupsT+0 setup grading — card quality, not a buy signal
clawock t0-reviewclawock.decision.setup_reviewedge self-check that decides whether the grading may be used
clawock portfolio-riskclawock.portfolio.riskbeta, volatility, drawdown and concentration per book
clawock regimeclawock.decision.regimethe leverage dial: 200-day trend × volatility
clawock watch-listclawock.decision.watch_listnon-held AI watch names price scan — opportunities only, never an add

Layer 7 · Book & FX integrity / 账本/汇率校验

Sources: Frankfurter · the reconciliation ledger · local invariants

CommandModuleWhat it collects or computes
clawock fxclawock.portfolio.fxUSDHKD with three-route fallback; HK and US totals may not be summed without it
clawock integrityclawock.portfolio.integritythe data-health gate that turns past numeric bugs into an automatic door
clawock reconcileclawock.portfolio.reconcilerecompute every derived money field, then run the integrity gate
clawock aggregatesclawock.portfolio.aggregatesrebuild each derived portfolio field from ledger leaves
clawock cashclawock.portfolio.cashderive each book's cash from its reconciliation ledger
clawock realizedclawock.portfolio.realizedsingle source of truth for realized P&L, summed from trades

Layer 8 · Backtest & calibration / 回测/自省

Sources: local snapshots + canonical bars

CommandModuleWhat it collects or computes
clawock evaluate-hstech-regimeclawock.evaluation.hstech_regimethe regime de-risking thesis, tested on real HSTECH data
clawock evaluate-us-leverageclawock.evaluation.us_leveragethe same regime backtest for the US 2x sleeve
clawock evaluate-combined-regimeclawock.evaluation.combined_regimethe whole book at current USD weights
clawock validate-regime-dialclawock.evaluation.regime_validationout-of-sample and circular-shift null for the dial's timing
clawock shadowclawock.decision.shadowreplays triggered calls against buy-and-hold to measure simulated timing alpha
clawock audit-resettleclawock.decision.settlementdry-run bar-based re-settle that reports every verdict it would change
clawock evaluate-add-alphaclawock.evaluation.add_alpha_walkforwardpoint-in-time diagnostic replay of price-relative and information interaction adds

Not information collection / 不属于信息收集

These are installed commands too. They are listed here so the catalog is the whole installation rather than the interesting part of it.

CommandModuleWhy it is not collection
clawock dashboard-buildclawock.publish.dashboardpublishes the dashboard projection from data the layers already produced
clawock dashboard-outputsclawock.publish.outputspublication ownership and semantic diffs for generated write sets
clawock validate-sidecarclawock.publish.artifactsbehavioral validation of a publication artifact
clawock evidenceclawock.evidence.build_evidencerenders the public evidence page from artifacts; it collects nothing
clawock run-cardclawock.evidence.run_cardrecords that a backtest ran and against what — provenance, not a measurement
clawock claim-provenanceclawock.evidence.claim_provenancegate: a quoted backtest number must still be in the card it cites
clawock signal-panelclawock.evaluation.signal_panelmeasures registered signal histories that other layers already collected, and never feeds a decision — evaluation, not collection
clawock scorecard-provenanceclawock.evidence.scorecard_verifynames the ledger slice and code a published scorecard number came from — provenance, not a measurement
clawock provenanceclawock.provenancegate: a published research figure needs two independent sources
clawock mark-followedclawock.decision.executionwrites execution ground truth into the decision ledger
clawock recordclawock.decision.recordappends a conversation verdict to the decision-mind ledger — it records a decision that was already made, and collects nothing
clawock riskclawock.decision.riskdurable governance ledger for breaches — a record of decisions, not an input to one
clawock thesisclawock.decision.thesesregistry the model writes and reads back; its content is authored, not fetched
clawock entry-gateclawock.decision.entrypre-investment gate applied to a candidate, after the information exists
clawock plan-contextclawock.decision.plansrelays what the 08:00 brief already decided to the crons that run after it
clawock researchclawock.evidence.research_surfacethe brief does read it, but as a work queue — reviews due, overdue promises, ungated positions — not as a measurement of the market or the book
clawock-gold-updateclawock.market_data.gold.updateoperator command that amends the gold DCA baseline; it carries human input into the book rather than measuring it
clawock-weekly-reviewclawock.automation.weekly_reviewassembles a weekly review artifact out of records the layers already produced
clawock-workflow-outcomesclawock.automation.workflow_outcomesdurable per-slot outcome state for the harness; operational, not market or book
clawock-cron-heartbeatclawock.automation.cron_heartbeatpublishes the intraday heartbeat ledger — liveness, not evidence
clawock-brief-fallbackclawock.automation.brief_fallbackoff-host delivery path for the brief when the runtime cannot produce it
clawock-intraday-deltaclawock.harness.intraday_deltapre-model trigger state: it decides whether a run happens, and the scheduler is its only reader
clawock-brief-watchdogclawock.harness.brief_watchdogdelivery watchdog for the 08:00 brief: it checks that a run produced and sent something
clawock-report-watchdogclawock.harness.report_watchdogdelivery watchdog for the session reports, on the same footing
clawock-intraday-watchdogclawock.harness.intraday_watchdogdelivery watchdog for the intraday slots, on the same footing

手写细节 / Hand-written detail

核心(当前在用)

  • clawock us-quotes:美股多 provider 抓取(7 路 fallback),自动写回 portfolio.json;prev_close 由 Polygon /prev 独立获取(带日期戳)
  • clawock analyze-us:美股完整分析 = 刷价格 + RSI-14/MA20/50 + Finnhub 新闻 + 信号
  • clawock filings:SEC EDGAR 对接 — 10-K/10-Q/8-K filings、XBRL 财务概念、Form 4 insider、13F-HR;无需 API key;Mode 3 fundamental 深挖时用。完整用法(2026-06-10 自 TOOLS.md 移入控 16K):
数据用法
最近 filings (10-K/10-Q/8-K)clawock filings RKLB--filings 10-K,10-Q 指定表型)
XBRL 关键财务概念(营收/净利/现金/EPS 等 13 项)--financials
Insider Form 4 / 13F-HR--form4 / --13f
机器可读任一模式加 --json

注意:速率限制 10 req/sec(脚本默认 8/sec)超量 403;SEC_USER_AGENT 可放 .api_keys;ticker→CIK 本地缓存 7 天;非美股票返回 "CIK not found"

  • clawock fx:公开包内的 USDHKD 汇率 provider(Frankfurter → exchangerate.host → Yahoo HKD=X 三路 fallback);4h 工作区缓存;--convert AMT FROM TO 直接换算。HK + US 算 book total 必须先调它
  • clawock analyze-hk:港股完整分析 = Tencent + Eastmoney HK 双源对账 → stooq → yfinance 兜底 + 恒指/恒科 + Finnhub 新闻 + 信号;c/pc 偏差 > 1% 写入 _divergence
  • clawock analyze-hk + clawock analyze-us:刷新并查看两本持仓;不再保留根级 wrapper

Cron harness 脚本(preflight + postflight 三明治)

所有 stock cron 都用同一套"preflight (确定性) → LLM (创造性) → postflight (校验)"模式。 确定性活强制脚本化执行;LLM 只做合成;postflight 自验证 + commit。 生产入口是安装后的 clawock CLI;生命周期实现由根 wheel 直接持有, CLAWOCK_PROFILE 只选择声明式配置和资源,不加载第二个 Python distribution。 旧的 scripts/harness/ 回滚别名已在 installed-command 切换验证后删除。

Daily deep brief(08:00 HKT cron)

  • clawock brief preflight:刷 US/HK 价 + FX + portfolio snapshot + HHI 算法 + SEC EDGAR (仅 is_leveraged_etf=false) + retrospective vs 上次 plan.json。输出 memory/.tmp/brief-context-{date}.json
  • clawock brief postflight:校验 memory/{date}-pre-open.md + memory/{date}-plan.json(段标记 / plan schema / HHI / FX / HKD+USD bug pattern);pass/warn 自动 commit

Mode 6 briefing(HK 开/午/午后/收盘 + US 开/收盘 — 6 个 cron 共享)

  • clawock report preflight --market {hk|us} --phase {open|mid|pm|close}:跑 analyze_*.py + 抽信号 (WATCH/STOP/TRIM 计数) + 异动 (≥3% 涨跌) + 指数方向;写 memory/.tmp/report-context-{market}-{phase}-{date}.json{date} = 跑批当天)并清掉该 market+phase 其它日期的残留;stdout 与文件是同一份 JSON(含 context_id,末行 context_path:),靠 peer_scan 在源头裁剪保持小体积。raw_wechat_block 不再经模型手 —— postflight 自己拼进消息
  • clawock report postflight --market {hk|us} --phase {phase} --context-id ID --text-file PATH:拼 title + raw_wechat_block + 模型散文,校验三段标记 / 异动票必须被提及 / 长度 / 敷衍词;--context-id 不匹配或散文文件 >30min 未更新则拒发。fail-closed:pass/warn 发全文 + scoped commit/push,fail 只发数据块(绝不发被拒散文)且不 commit,休市/缺 context 不发。失败过的 slot 之后可被合格报告补发一次。主发 WeChat + 镜像 Telegram。
  • clawock-report-watchdog --market {hk|us} --phase {phase} --job-name "{cron名}":系统 crontab 的 LLM-free Telegram-only backstop。覆盖 HK 4 班 + US 开/收 2 班;读取 postflight delivery marker,只有 Telegram 未确认时才补投,绝不重发 WeChat。

Mode 7 intraday(HK + US 盘中盯盘 — 3 个 cron job 共享同一套脚本;季节化 slot 数和精确时间只看生成调度表,隔夜始终最晚 02:30 HKT)

  • clawock intraday preflight --market {hk|us}:跑 analyze_*.py + 异动检测 + should_alert 决策;输出 memory/.tmp/intraday-context-{market}-latest.json
  • clawock intraday postflight --market {hk|us} --context-id {preflight 的 context_id} --text-file memory/.tmp/intraday-prose-{hk|us}.md先写文件再调用,禁 heredoc/<<<;空输入/超 20 分钟的旧文件判 status: input_error 并拒投):模型只写 ▎我的看法 散文,assemble_message() 在发送时把 raw_wechat_block 拼在前面 —— 数据块不再经模型往返,也就不会被重排版打坏。--context-id 不匹配 = 散文与数据不同代,拒绝拼装只发数据块。校验 ▎我的看法 / should_alert 异动票提及只针对模型写的那段(长度算拼装后的整条);不提交 portfolio.json,dashboard 仅在语义变化时 commit + push;无论有无 dashboard diff 都更新本地 slot heartbeat,交 single publisher 发布。省略 --context-id 回落到 legacy 整报告模式(保留 verbatim 校验),供未迁移的 payload 过渡。

共通设计点

  • raw_wechat_blockMode 6 报告(report_postflight)由 harness 自己拼进消息,LLM 只写散文、不碰数据块;intraday 仍是 LLM verbatim 拷贝 + postflight 首行验证
  • preflight 输出 anomalies 字段,LLM 必须在报告里至少提一个 anomaly 票(report 按模型散文校验,数据块里的票代码不算数)
  • wechat_prefix(pass=空串,warn=黄 banner,fail=红 banner):report_postflight 自己发,不再回给 LLM 拼;intraday 仍回给 LLM
  • 所有 context.json 都放 memory/.tmp/(gitignore 排除)

辅助

  • Scrapling:自适应爬虫框架,绕过反爬(Cloudflare 等),支持 JS 渲染。pip3 install scrapling --break-system-packages。详见 skills/scrapling/SKILL.md
  • clawock dashboard-build:package-owned dashboard projection,聚合 portfolio.json + snapshots + v2 plans + memory/decisions.jsonl + risk/peer/context sidecars → assets/data/dashboard.json;guardrail 卡直接复用 package lifecycle 计算,不经过 profile Python hook。决策字段统一为 decision_metrics / episode_backtest / decision_delta / recent_decisions;只计被判定触发的 episode,date-cluster CI,并公示判不了的条数(coverage_active)。⚠️ decision_money_impact 已于 2026-07-15 停止发布:它把从没执行过的 call 也算进去,不是任何真实交易序列的累计金额。三类 postflight 都自动刷新;size cap 200KB。
  • clawock portfolio-risk:包内计算 β/Vol/Max DD/Sharpe/margin_at_risk → assets/data/risk.json。每日 brief preflight 自动跑。Yahoo v8 429 限速 → 改用 Tencent gtimg primary + Polygon/AlphaVantage fallback。alert 类型:high_beta(>3) / high_vol(>50%) / deep_dd(<-10%) / high_leverage(>2.0) / negative_sharpe(<0)
  • clawock regimesrc/clawock/decision/regime.py):杠杆刻度盘 → assets/data/lev_regime.json。HSTECH 200日线趋势 + 20d 波动 → HK 杠杆ETF腿上限乘子(green×1 / amber×0.5 / red×0);US 逐名(2x单股ETF 各自 200日线,趋势off+vol>70% 才强砍)。2026-07 新增 regime_history:逐日 regime(hk←HSTECH 全历史含200DMA+近10日动量;us←benchmark.json SPY 序列,仅动量因样本<200),供 build_dashboard 把 vs_baseline 按 regime 分桶。brief preflight 自动跑;tencent 空 fetch 保留旧文件。
  • clawock mark-followed:v2 execution ground-truth 工具。--list 列出已触发但执行未知的 decision;clawock mark-followed DECISION_ID [--no]execution.status。Brier 衡量建议置信度,执行率单独展示。
  • clawock audit-resettle:重跑 bar-based settlement 并完整报告状态迁移;默认 dry-run,只有 --write 才写 memory/decisions.jsonl
  • clawock integrity [portfolio.json]:运行资金守恒、持仓派生值、报价完整性闸,ERROR 返回 2,WARN 不阻断。
  • clawock validate-sidecar <name>:校验 workflow 生成的 macro/sentiment/news/dashboard/coverage 等发布产物。
  • clawock catalysts:未来 14d catalysts → assets/data/catalysts.json(US holding/底层发行人财报 Finnhub + 2026 FOMC 硬编码 + 经济日历 NFP/CPI 规则)。brief_preflight 自动跑。catalysts.alerts 触发时 LLM brief 必须 ▎事件日历 段提及。
  • clawock-influencer-scan:高影响力人物市场异动 → assets/data/influencer_feed.json。Trump 原帖(trumpstruth.org/feed RSS, 全文)+ Musk(Google News RSS 代理, X 无可靠免费 RSS)。关键词预筛 → 单次 vendor LLM(thinking_disabled 结构化抽取)提相关性/stance/ticker/板块 → 代码交叉匹配持仓分三档:held_hits / new_ideas / sector_hits。merge-not-overwrite: 源抓取失败才保留旧条目(被 LLM 筛掉≠失败)。MINIMAX_API_KEY 主、OPENCODE_API_KEY 可选 fallback;两者都缺才降级 keyword-only。dashboard「影响力雷达」卡 + brief ▎名人异动/政策风向 段消费。
  • GHA LLM client:由 clawock.automation 持有,供 GitHub Actions 直调(绕过 OpenClaw gateway)。Primary MiniMax M3 (Anthropic Messages) → optional fallback opencode-go DeepSeek V4 Flash (OpenAI-compatible);不是 OpenClaw 或人工调用入口。
  • clawock-{brief-fallback,weekly-review,news-digest}:3 个 GitHub Actions installed commands,共用上述 package-owned client。
  • ops/publish/safe_push.sh:共享 git push 防 conflict 死循环工具。3 次 retry + 每次 rebase 失败 → git rebase --abort + exit 2(不死循环 push)。所有写文件的 GH Action workflow 用 bash ops/publish/safe_push.sh 替代原本的 push loop;adapter 的 _harness_common.push_with_rebase_retry 直接委托本脚本(2026-06-10 统一,自动获得 rebase.autoStash + 冲突标记硬闸),全体 committer 单一 push 路径。
  • clawock reconcile:手工成交后的唯一收口。先把成交写进对应 holdings[].trades[]action/date/shares/price,卖出另记 realized_pnl),同步 broker 真值叶子(shares / cost_basis;新仓建 holding、平仓保留历史行并置 shares=0;存取款写 cash_adjustments[]),再运行本命令重算 aggregates / cash / realized P&L 并执行完整性闸。它只派生和校验,不会替你猜成交。

Cron map

精确的 11-job schedule、EDT/EST 表达式、Mode/harness 和 11 条 watchdog 映射由 config/cron-schedules.json 单源维护,生成的人读表见 docs/operations/cron-schedules.mdops/host/sync_us_cron_dst.py --apply 每日自动对齐美股 live cron + system watchdog; clawock-cron-heartbeat 维护 Mode 7 slot ledger,由现有 single publisher 发布。

所有 harness preflight/postflight 的实现都在 src/clawock/harness/,统一从安装后的 clawock CLI 调用。Mode 6 / brief / Mode 7 的 postflight 都会重建 dashboard;Mode 7 不提交 portfolio.json,dashboard 只发布语义变化,但每个 受监控 slot 的 heartbeat 都会发布并由 cron health 对账。

cron payload 是真实执行面,会为隔离 session 自包含关键步骤;SKILL.md 是详细规范。完整 prompt 模板在 config/cron-payloads/,job 变量、model/fallback/thinking/tools/schedule 则由 config/cron-schedules.json 单源声明;改格式时必须同时 diff payload 与对应 Mode,尤其 Step 2.5 sidecar。schedule、payload、watchdog 或生成文档漂移都会被 ops/system_check.py / CI 拦截。

改 cron 配置的安全步骤(默认只检查,显式 apply;不覆盖投递目标/account/failure alert):

python3 ops/host/sync_cron_payloads.py --json
python3 ops/host/sync_cron_payloads.py --apply --json

同步器按精确 job 名/ID 规划最小 patch,发现重复/缺失/额外 job 或目标 job 正在运行时不写, 逐 job 失败即停,apply 后重新读取验证。升级大版本后仍应先 openclaw cron list 数 job 个数 (应为 11),少了跑 openclaw doctor --fix

Cron 运行历史(自动 + 手动跨 job 聚合)

openclaw cron runs 必须带 --id,且单 job 视角。跨 job + 自动调度 + 手动 trigger 一起看用:

bash ops/host/check_crons.sh                 # 最近 20 次(auto + manual 混排,HKT 倒序)
bash ops/host/check_crons.sh 50              # 最近 50 次
bash ops/host/check_crons.sh --status error  # 只看失败
bash ops/host/check_crons.sh --kind cron     # 只看自动调度
bash ops/host/check_crons.sh --job 港股       # 按 job 名子串过滤
bash ops/host/check_crons.sh --full          # 摘要不截断
bash ops/host/check_crons.sh --json          # JSON 输出(喂给后续 pipeline)

运行历史同样优先经 OpenClaw CLI 读取;旧 cron/runs/*.jsonl 只作为迁移前 fallback。 脚本本体 ops/host/cron_runs.py

已废弃

旧脚本源码已删除,不作为参考依赖;provider、header、fallback 与解析逻辑只认 installed package 当前实现。

  • 完全删掉 (2026-05-16 大扫除):monday_signal.py (含硬编码 key)、api_retry_wrapper.pybaidu_search_wrapper.pydeep_analysis.pyfinal_analysis.pyfind_opportunities.pyhk_ai_monitor.pymulti_agent_stock_analysis.pyprice_alert_monitor.pyTradingAgents/ 整目录
  • 完全删掉scripts/legacy/scripts/data/;dated memory 中的旧文件名只属历史记录。