49 KiB
Seal Use CLI Reference
Run from any directory after installing the global CLI:
seal-use <command>
Enterprise config lookup:
- If
SEAL_USE_ENTERPRISES_DIRis set, only that directory is loaded. - Otherwise the user-level
~/.config/seal-use/enterprisesdirectory is loaded. A configuredtestEnterprisesDiris loaded first for test-tenant workflows. The current working directory's./enterprisesdirectory is not loaded implicitly. - Set
SEAL_USE_ENTERPRISES_DIRto use one explicit directory instead. Legacy~/.config/seal-home/enterprisesfiles are migrated to the primary directory when possible.
Enterprise selection is stateless by default. Commands that access an enterprise require
--corp <corpId> unless stateful mode is explicitly enabled:
seal-use config mode stateful --corp <corpId>
seal-use corps switch <corpId>
seal-use config mode stateless
The global mode is stored in ~/.config/seal-use/config.json; set SEAL_USE_CONFIG_FILE to
override that path. The legacy current-corp file is not read.
Stream & Exit Code Contract
stdout: Pure, deterministic JSON for machine/Agent parsing.stderr: Diagnostics, probing logs, and Next-Step Command Suggestions with the stable prefix👉 Next action: seal-use ....Exit Code:0on success;1runtime/upstream failure or quality-gate failure,2malformed command line (unknown subcommand, bad--flagvalue),10explicit destructive-operation confirmation required,11missing/invalid authentication,12output protection requiring a compact/file/query alternative,13local config/input validation failure (missing--corp, unparseable enterprise file, missing required parameter),14safety-guard block (target environment forbids the action, e.g. replay into production).
Top-Level Commands
seal-use version
seal-use corps list [query] [--all] [--limit <n>] [--env <production|test>] [--strict] [--corp <corpId>]
seal-use corps search <query> [--env <production|test>] [--strict]
seal-use corps get <corpId>
seal-use corps current [--corp <corpId>]
seal-use corps switch <corpId>
seal-use corps mark <corpId> --env <production|test> [--confirm]
seal-use corps rename <corpId> --name <newName>
seal-use corps bind-test <prodCorpId> <testCorpId> [--confirm] [--force]
seal-use corps bind-test <testCorpId> --corp <prodCorpId> [--confirm] [--force]
seal-use corps unbind-test [<corpId>] [--confirm]
seal-use corps sync-test [<prodCorpId>] [--dry-run] [--yes] [--version-name <name>]
seal-use corps replay-test [<prodCorpId>] [--record-id <id>] [--sn <sn>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--confirm|--yes] [--force]
seal-use corps add-hose-persistent --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId"}'
seal-use corps add-seal-bearer --json '{"sealUrl":"https://tenant.sealai.cc","token":"seal-bearer-token"}'
seal-use corps add-hose-web-session --json '{"baseUrl":"https://wx2.ekuaibao.com","corpId":"...","staffId":"...","accessToken":"..."}'
seal-use corps add-link <url> [--name <customName>] [--elevate-hose] [--app-key <key>] [--key-id <id>] [--overwrite] [--dry-run]
seal-use corps probe-hose --json '{"appKey":"...","appSecurity":"...","domain":"https://..."}'
seal-use corps hose-staffs --json '{"appKey":"...","appSecurity":"...","role":"admin"}'
seal-use corps hose-extract-keys <url> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]
seal-use corps hose-keys [<url> | <corpId>] [--reveal] [--save] [--app-key <key>]
seal-use rules count [--version <number|latest>] [--corp <corpId>]
seal-use rules list [--version <number|latest>] [--summary] [--limit 20] [--offset 0] [--output-file <path>] [--corp <corpId>]
seal-use rules get <code> [--version <number|latest>] [--record-id <recordId>] [--corp <corpId>]
seal-use rules search <keyword> [--version <number|latest>] [--maxResults 20] [--corp <corpId>]
seal-use rules create --description <text> --scope <scope> [--strictness <MUST_FOLLOW|SHOULD_FOLLOW|SUGGESTION>] [--description-file <path>] [--corp <corpId>]
seal-use rules update <code> [--description <text>|--description-file <path>] [--scope <scope>] [--strictness <MUST_FOLLOW|SHOULD_FOLLOW|SUGGESTION>] [--corp <corpId>]
seal-use rules delete <code> --yes [--corp <corpId>]
seal-use rules publish <versionName> [--corp <corpId>]
seal-use rules versions [--corp <corpId>]
seal-use rules version <versionNumber|latest> [--corp <corpId>]
seal-use rules diff <fromVersion> <toVersion> [--code <code>] [--include-unchanged] [--full] [--corp <corpId>]
seal-use rules lint [--file <path>] [--linter <name|path>] [--version <number|latest>] [--code <code>] [--min-score <score>] [--level all|error|warning] [--summary] [--corp <corpId>]
seal-use rules linters [--corp <corpId>]
seal-use rules pull [--version <number|latest>] [--out <file>] [--corp <corpId>]
seal-use rules push [--file <path>] [--publish] [--version-name <name>] [--dry-run|--yes] [--corp <corpId>]
seal-use rules push status [--file <path>] [--corp <corpId>]
seal-use rules clear [--dry-run|--yes] [--corp <corpId>]
seal-use rules recode [--dry-run] --corp <corpId>
seal-use rules map [--version <number|latest>] [--code <code>] [--corp <corpId>]
seal-use webhook ready [<材料包.zip>] [--webhook <idOrName>] [--corp <corpId>]
seal-use webhook status [<材料包.zip>] [--corp <corpId>]
seal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]
seal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]
seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--min-file-size 500] [--max-file-size <bytes>] [--allowed-extensions <.pdf,.xlsx,...>] [--dry-run] [--corp <corpId>]
seal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--min-file-size <bytes>] [--max-file-size <bytes>] [--allowed-extensions <.pdf,.xlsx,...>] [--clear-max-file-size] [--dry-run] [--corp <corpId>]
seal-use webhook delete <idOrName> [--yes|--dry-run] [--corp <corpId>]
seal-use webhook resource-pack export [--limit <n>] [--status <status>] [--output <file.zip>] [--to-downloads] [--corp <corpId>]
seal-use webhook resource-pack export <recordId> [--output <file.zip>] [--corp <corpId>]
seal-use webhook resource-pack export --record-ids <id1,id2> [--corp <corpId>]
seal-use webhook resource-pack preview <资源包.zip|信息表.xlsx> [--min-file-size <bytes>] [--max-file-size <bytes>] [--allowed-extensions <.pdf,.xlsx,...>] [--corp <corpId>]
seal-use webhook resource-pack push <资源包.zip|信息表.xlsx> [--webhook <idOrName>] [--corp <corpId>]
seal-use webhook replay <recordId> [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use webhook replay --sn <documentSN> [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--yes|--confirm]
seal-use webhook replay --limit <n> [--status <status>] [--source-corp <corpId>] [--target-corp <corpId>] [--yes|--confirm]
seal-use approval-runs summary [--date YYYY-MM-DD] [--timezone Asia/Shanghai] [--corp <corpId>]
seal-use approval-runs stats [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id] [--corp <corpId>]
seal-use approval-runs count [--status APPROVED] [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--corp <corpId>]
seal-use approval-runs export [--sn <SN1,SN2>] [--start <YYYY-MM-DD|ms>] [--end <YYYY-MM-DD|ms>] [--force] [--status <status>] [--manual-status <status>] [--completed-only] [--limit <n>] [--downloads|--to-downloads] [--with-flow] [--out <file>] [--corp <corpId>]
seal-use approval-runs hose-flow <recordId|SN> [--corp <corpId>]
seal-use approval-runs list|search [--query text] [--humanResult 驳回] [--manualApprovalStatus TERMINATED] [--startDate ms] [--endDate ms] [--limit 20] [--includeBridge true] [--corp <corpId>]
seal-use approval-runs pick --sn <documentSN> [--batch <batchId>] [--latest] [--fields recordId,status,aiDecision] [--corp <corpId>]
seal-use approval-runs get <recordId> [--summary] [--fields metadata|document.fields,result.summary] [--full] [--output-file file.json] [--corp <corpId>]
seal-use approval-runs cited-rules <recordId> [--corp <corpId>]
seal-use approval-runs diagnose <recordId>|--sn <documentSN> [--full] [--corp <corpId>]
seal-use approval-runs document-summary <recordId> [--corp <corpId>]
seal-use approval-runs attachments <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>] [--corp <corpId>]
seal-use approval-runs result <recordId> [--summary] [--corp <corpId>]
seal-use approval-runs link <recordId> [--corp <corpId>]
seal-use approval-runs link <recordId> --auto-login [--expire 7200] [--corp <corpId>]
seal-use approval-runs link <recordId> --type hose-document [--corp <corpId>]
seal-use approval-runs link --sn <documentSN> [--auto-login] [--corp <corpId>]
seal-use approval-runs bridge [--sourceDocumentSN B26001887] [--corp <corpId>]
seal-use approval-runs replay <recordId> [--webhook <idOrName>] [--sn-suffix <str>] [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use approval-runs replay --sn <documentSN> [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--yes|--confirm]
seal-use approval-runs replay --sn <documentSN> --channel hose-outbound [--sign-key <key>] [--target-corp <corpId>] [--dry-run] [--yes|--confirm]
seal-use approval-runs replay <recordId> --channel hose-outbound [--sign-key <key>] [--target-corp <corpId>] [--dry-run] [--yes|--confirm]
seal-use approval-runs replay --limit <n> [--status <status>] [--source-corp <corpId>] [--target-corp <corpId>] [--yes|--confirm]
seal-use report ledger --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD> [--templates <t1,t2...>] [--limit <n>] [--out <file.xlsx>] [--corp <corpId>]
seal-use report data (--ledger <台账.xlsx> | --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>) [--templates <t1,t2...>] [--limit <n>] [--corp <corpId>]
seal-use report template [--out <file.md>]
seal-use report chart venn --ai <acc> --human <acc> [--both <both>] [--out <file.svg>]
seal-use report generate (--ledger <台账.xlsx> | --start-date <YYYY-MM-DD> --end-date <YYYY-MM-DD>) [--templates <t1,t2...>] [--out <报告.md>] [--template <file>] [--report-id <RPT-...>] [--limit <n>] [--allow-unreviewed] [--corp <corpId>]
seal-use report validate <报告.md>
seal-use report render <报告.md> --out <build/报告> [--format <all|html|png|pdf>]
seal-use report export <报告.md> --out <输出目录> [--format <all|html|pdf>]
seal-use report review set [--record-id <ID>] [--sn <SN>] --verdict <v> [--note <text>] [--reviewed-by <who>] [--corp <corpId>]
seal-use report review list [--corp <corpId>]
seal-use report review import <台账.xlsx|csv> --corp <corpId>
seal-use simulation batch-records <batchId> [--corp <corpId>]
seal-use simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--wait] [--timeout 10m] [--poll-interval 2s] [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-extract|--extract] [--skip-invoice-generation] [--no-wait] [--force] [--reuse-window 5m] [--corp <corpId>]
seal-use simulation create --mode material_pack --package-ids <materialPackageId> [--template-id conference_reimbursement_v1] [--schema-config file.json] [--corp <corpId>]
seal-use simulation create --source-system weaver --request-ids "req-01,req-02" [--corp <corpId>]
seal-use simulation status <batchId> [--corp <corpId>]
seal-use simulation wait <batchId> [--timeout 10m] [--poll-interval 2s] [--corp <corpId>]
seal-use simulation clean <batchId> --yes [--corp <corpId>]
seal-use simulation specifications [--integration <sign-key>] [--corp <corpId>]
seal-use simulation approval-definitions [--corp <corpId>]
seal-use simulation list [--limit 50] [--corp <corpId>]
seal-use simulation get <batchId> [--corp <corpId>]
seal-use simulation templates [--corp <corpId>]
seal-use simulation integrations [--corp <corpId>]
seal-use simulation package-upload <材料包.zip> [--corp <corpId>]
seal-use deploy hosecloud requirements [--corp <corpId>]
seal-use deploy hosecloud list [--corp <corpId>]
seal-use deploy hosecloud get <sign-key> [--corp <corpId>]
seal-use deploy hosecloud status [--corp <corpId>]
seal-use deploy hosecloud configure --json '{...}' [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use deploy hosecloud sync [<sign-key>] [--auto] [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use deploy hosecloud test-outbound [--sign-key <key>] --flow-id <id> --message-id <msgId> [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use deploy hosecloud test-outbound [--sign-key <key>] --sn <SN> --message-id <msgId> [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use hose-ebot search <sn> [--type invoking|callback] [--limit <n>] [--reveal] [--corp <corpId>]
seal-use hose-ebot messages [--type flow|message] [--reveal] [--corp <corpId>]
seal-use hose-ebot callback --flow-id <flowId> --node-id <nodeId> --action <accept|refuse|preAdd|aftAdd> --comment <审批意见> [--sign-key <key>] [--policy <ALL|ANY>] [--add-approver-ids <id,id>] [--reject-to <nodeId>] [--resubmit-method <FROM_START|TO_REJECTOR>] [--dry-run] [--yes|--confirm] [--corp <corpId>]
seal-use preference get [--corp <corpId>]
seal-use preference decision update --json '{"explicitApprove":"..."}' [--dry-run] [--corp <corpId>]
seal-use preference thinking-depth set --default <medium|high> [--dry-run] [--corp <corpId>]
seal-use preference thinking-depth policies list [--corp <corpId>]
seal-use preference thinking-depth policies upsert --json '{...}' [--dry-run] [--corp <corpId>]
seal-use preference thinking-depth policies remove <policyId> [--dry-run] [--corp <corpId>]
seal-use config paths
seal-use config get
seal-use config mode <stateful|stateless> [--corp <corpId>]
seal-use config test-dir [<path>|--clear]
seal-use config lint [status|enable|disable] [--linter <name|path>] [--min-score <score>]
seal-use auth check [--corp <corpId>]
seal-use auth link [--note <note>] [--expire <duration>] [--corp <corpId>]
seal-use auth link --from-link <url> [--note <note>] [--expire <duration>]
seal-use auth link list [--corp <corpId>]
seal-use auth link revoke <tokenId> [--corp <corpId>]
seal-use auth hose-link [--corp <corpId>] [--expire <duration>] [--force]
seal-use auth hose-openapi-token [--corp <corpId>] [--force]
seal-use auth hose-extract-keys <url> [--reveal] [--save] [--app-key <key>] [--key-id <id>] [--name <customName>] [--overwrite]
seal-use auth hose-keys [--corp <corpId>] [--reveal]
seal-use users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]
seal-use users search <keyword> [--corp <corpId>]
seal-use users delegation <userIdOrPhone|name> [--note <note>] [--expire <duration>] [--corp <corpId>]
seal-use users reset-password <userId> --yes [--corp <corpId>]
seal-use users get <userId> [--corp <corpId>]
seal-use users delete <userId> --yes [--corp <corpId>]
seal-use contacts departments [<departmentId>] [--corp <corpId>]
seal-use contacts children <departmentId> [--corp <corpId>]
seal-use contacts users <departmentId> [--corp <corpId>]
seal-use contacts sync-time [--corp <corpId>]
seal-use data expenses [--sn <documentSN>|--record-id <recordId>|--search <text>] [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--offset <n>] [--limit <n>] [--max-scan <n>] [--corp <corpId>]
seal-use data invoices [--search <text>] [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--offset <n>] [--limit <n>] [--full] [--corp <corpId>]
seal-use invoices [list] [--search <text>] [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--offset <n>] [--limit <n>] [--full] [--corp <corpId>]
seal-use invoices trace <invoiceNumber> [--corp <corpId>]
seal-use invoices <invoiceNumber> [--corp <corpId>]
seal-use expenses [list] [--sn <documentSN>|--record-id <recordId>|--search <text>] [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--offset <n>] [--limit <n>] [--max-scan <n>] [--corp <corpId>]
seal-use llm config [--corp <corpId>]
seal-use llm providers [--corp <corpId>]
seal-use permissions available [--corp <corpId>]
seal-use permissions configs [--corp <corpId>]
seal-use billing status [--corp <corpId>]
seal-use billing plans [--corp <corpId>]
seal-use billing features [--corp <corpId>]
seal-use analytics insight [--start-date <ISO>] [--end-date <ISO>] [--limit <n>] [--corp <corpId>]
seal-use analytics risks <tagId> [--start-date <ISO>] [--end-date <ISO>] [--corp <corpId>]
seal-use analytics performance [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--corp <corpId>]
seal-use analytics analyze <recordId> [--corp <corpId>]
seal-use analytics export [--downloads] [--out <file>] [--start-date <ISO>] [--end-date <ISO>] [--force] [--limit <n>] [--corp <corpId>]
seal-use context [--ruleVersion <versionId|versionNumber|latest>] [--documentLimit 50] [--corp <corpId>]
seal-use source config [--corp <corpId>]
seal-use documents list [--scenarios <audit,fill>] [--limit 50] [--offset 0] [--corp <corpId>]
seal-use documents get <documentId> [--corp <corpId>]
seal-use documents search <keyword> [--maxResults 20] [--corp <corpId>]
seal-use documents create --title <title> --purpose <purpose> [--content <text>|--content-file <path>] [--type <policy|document|video|pdf|feishu_doc>] [--scenarios <audit,fill>] [--tags <tag1,tag2>] [--status <published|draft>] [--corp <corpId>]
seal-use documents update <documentId> [--title <title>] [--purpose <purpose>] [--content <text>|--content-file <path>] [--type <policy|document|video|pdf|feishu_doc>] [--enabled <true|false>] [--scenarios <audit,fill>] [--tags <tag1,tag2>] [--status <published|draft>] [--corp <corpId>]
seal-use documents delete <documentId> --yes [--corp <corpId>]
seal-use update [--check] [--force] [--version <v>]
seal-use update check
seal-use update changelog [--limit <n>]
seal-use changelog [--limit <n>]
seal-use probe [<corpId>]
seal-use langfuse check
seal-use langfuse cache-refresh <traceId> [--trace-id <traceId>]
seal-use langfuse outline <traceId> [--include-io-preview] [--max-preview-chars <n>] [--full]
seal-use langfuse search <traceId> --query <term1,term2> [--fields input,output] [--max-results <n>]
seal-use langfuse observation <traceId> <observationId> [--fields input,output] [--max-chars <n>]
seal-use langfuse session <sessionId> [--trace-limit <n>]
seal-use langfuse observations <traceId> [--name-contains <text>] [--type <type>]
seal-use langfuse url <traceId>
seal-use langfuse attachment-flow <traceId> [--file-id <id>] [--file-name <name>]
seal-use langfuse rule-flow <traceId> --rule <规则内容>
seal-use mcp
seal-use mcp config
seal-use mcp-config
seal-use skill dump
seal-use skill install [--dir <path>|--local]
seal-use skill status
seal-use doctor [--quiet]
seal-use doctor guide
seal-use doctor paths
seal-use doctor tenant [--corp <corpId>] [--quiet]
seal-use test regression [--corp <corpId>] [--samples <N>] [--dry-run] [--fail-on-flips]
以下补充说明独立维护:
# --sn / --sns: 定向筛选单据编号(支持逗号/分号/空格分隔,跳过全量分页,秒级定向导出特定单据)
# --with-flow: 启用合思原生审批流对齐,输出 E人工行为 / E人工意见 两列(含样式 2-B 三行展开式驳回目标与重审规则、中途修改置顶事实且保留时序、动作 Emoji,默认关闭以节省合思 API 调用)
# 导出文件名自动追加精确到分钟的 _YYYYMMDD_HHmm 时间戳后缀防止文件覆盖,格式:${企业名称}_审核记录_${时间区间}_${条数}_${导出时间戳}.xlsx
# 生成审批详情链接:seal-use approval-runs link <recordId>
CLI Command Overview
seal-use version returns:
{
"name": "seal-use",
"version": "<package version>"
}
seal-use update checks and installs the latest official release, and refreshes the installed Agent Skill. The installation method is handled automatically and should not be exposed in user-facing explanations. seal-use update --check only reports available releases, and seal-use update changelog reads release history.
System diagnostic & embedded architecture specifications:
seal-use doctor [--quiet]executes a comprehensive read-only environment diagnostic health check (runtime executable, filesystem paths health, enterprise assets summary) with zero disk footprint.seal-use doctor tenant [--corp <corpId>] [--quiet]probes the tenant-level health contract: verifies user identity and administrative permissions, checks AI approval quota balance (balanceanddeductionAmount), inspects active rules count and unreleased draft safety, validates webhook integration readiness, and verifies 1-to-1 environment pairing with test staging. Outputs clean JSON onstdoutand a visual terminal dashboard onstderr.seal-use doctor guidereads the complete embedded system architecture & directory specification whitepaper directly from binary memory without touching disk.seal-use doctor pathsoutputs compact JSON audit of all filesystem paths touched by the CLI.
Enterprise and tenant management (corps is the enterprise-context entry point):
Use the command groups in this order for normal work: enterprise onboarding → discovery and selection → environment configuration → test pairing and verification. Hose probing, staff discovery, key extraction, and key inspection are secondary capabilities for Hose-sourced enterprises.
seal-use corps add-link <url> [--name <name>] [--elevate-hose] [--app-key <key>] [--key-id <id>] [--overwrite] [--dry-run]is the preferred onboarding entry point: it auto-detects a Seal native delegate link or a Hose assistance link. Native Seal links are registered as native Seal enterprises; Hose links can remain short-lived or use--elevate-hosefor durable Hose credentials.--dry-runnever writes local config.seal-use corps add-seal-bearer --json '{"sealUrl":"https://tenant.sealai.cc","token":"..."}'registers a native Seal enterprise directly from a Seal Bearer Token.seal-use corps add-hose-web-session --json '{"baseUrl":"https://wx2.ekuaibao.com","corpId":"...","staffId":"...","accessToken":"..."}'imports a normalized Hose web session (for example, parsed from a Hose admin cURL), saving the HosecloseTokenand personnel ID. Seal Bearer is exchanged only at runtime; this command does not create or save OpenAPIappKey/appSecuritycredentials.seal-use corps add-hose-persistent --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"..."}'registers and persists a Hose enterprise from durable OpenAPI credentials.
Durable Hose configs are identified by source.type: "hose" plus appKey/appSecurity; Hose Web Session configs use the same source type with closeToken + staffId. When the session material includes an expiry, it is recorded as expiresIn (TTL seconds) and expiresAt (Beijing ISO 8601 without milliseconds, for example 2026-09-22T13:30:00+08:00).
seal-use corps list [query] [--env <production|test>] [--limit <n>] [--all] [--strict] [--corp <corpId>](defaults to displaying the top 10 most frequently used enterprises in the last 7 days; sorting is automatic and query results keep relevance order)seal-use corps search <query> [--env <production|test>] [--strict](intelligent soft search by default: case-insensitive, Chinese homophones, front/back nasal vowels, flat/retroflex consonants, initials, typo/missing letter tolerance; pass--strictfor exact substring match)seal-use corps get <corpId>(rich enterprise attributes with sensitive secrets safely redacted)seal-use corps current [--corp <corpId>]seal-use corps switch <corpId>seal-use corps mark <corpId> --env <production|test> --confirmandseal-use corps rename <corpId> --name <newName>maintain local enterprise metadata.seal-use corps bind-test <prodCorpId> <testCorpId> --confirm [--force],unbind-test, andsync-testmanage the 1-to-1 production/test lifecycle.seal-use corps replay-test [<prodCorpId>] ... [--dry-run] [--confirm|--yes] [--force]replays sanitized approval records to the paired test Webhook. Preview does not send; live replay requires confirmation.--forceonly overrides missing/non-test pairing guards.seal-use corps probe-hose --json '{"appKey":"...","appSecurity":"...","domain":"https://..."}'probes Hose domains and discovers enterprise identity without saving configuration.seal-use corps hose-staffs --json '{"appKey":"...","appSecurity":"...","role":"admin"}'discovers role-based staff candidates; cellphones are masked by default.seal-use corps hose-extract-keys <url> [--reveal] [--save] [--name <name>] [--app-key <key>] [--key-id <id>] [--overwrite]extracts OpenAPI keys (appKeyandappSecurity) from a Hose assistance link (thirdparty.html). The oldextract-keys/extract-key/extract-hose-keysforms remain aliases. Hose Subdomain Privilege Elevation: elevates a short-lived session token to permanent Hose OpenAPI developer credentials. If--saveis specified, registers the enterprise as a durable Hose tenant. If the enterprise has multiple keys, execution halts and candidates are listed unless--app-keyor--key-idis passed.seal-use corps hose-keys [<url> | <corpId>] [--reveal] [--save]reads/displays OpenAPI keys for a Hose assistance link or configured Hose enterprise (masked by default,--revealdisplays plaintext). The oldkeysform remains an alias. Rejects non-Hose/native-Seal tenants with exit code 2.seal-use auth hose-extract-keys <url>andseal-use auth hose-keys [--corp <corpId>]are the explicit Hose auth-domain commands. The oldextract-keys/extract-key/extract-hose-keysandkeysforms remain aliases.seal-use auth hose-openapi-token [--corp <corpId>] [--force]exchanges the persisted HoseappKey/appSecurityfor an OpenAPIaccessTokenand prints it as machine JSON (token,expiresAt,cached; aliasesopenapi-token,hose-token). A still-fresh cached token is reused by default (cached: true, with a stderr notice);--forcemints a new one. Unlikeauth check, the token is intentionally unredacted. Rejects non-Hose tenants with exit code 2; missing credentials exit 13.
Hose outbound discovery & EBot callback (first-level hose-ebot command; Hose-only):
seal-use hose-ebot search <sn> [--type invoking|callback] [--limit <n>] [--reveal]is the default entry: it searches the Hose outbound message log by document SN and returns records that each carry a uniqueid(INVOKING=出站触发,CALLBACK=回调), plus theflowId/nodeId/messageId/rejectionNuma callback needs. Read-only; anysignKeyinside records is masked unless--reveal.seal-use hose-ebot messages [--type flow|message] [--reveal]lists every outbound message config on the Hose side (messageName,signKey,callbackUrl,enable, …).signKeyis theconfig_idembedded in the callback URL; masked unless--reveal. Read-only.seal-use hose-ebot callback --flow-id <flowId> --node-id <nodeId> --action <accept|refuse|preAdd|aftAdd> --comment <审批意见> …runs the EBot approval callback (POST /api/openapi/v1/approval) and writes the result into the approval flow; success isvalue.code=204. Requires--dry-run(masked preview) or--yes/--confirm(otherwise exit 10).--sign-keyis optional when the enterprise has exactly one Seal Hose integration. Upstream business codes map to exit codes: 401→11, 400→13, 412/500→1. Only EBot-node approvals are supported upstream.
Read-only discovery:
seal-use contacts departments|children|users|sync-time --corp <corpId>queries the tenant's organization tree and last directory sync time.seal-use data expenses|invoices --corp <corpId> [--search <text>] [--start-date <ISO|ms>] [--end-date <ISO|ms>] [--offset <n>] [--limit <n>]queries paginated raw expense or invoice records.seal-use analytics insight --corp <corpId> [--start-date <ISO>] [--end-date <ISO>] [--limit <n>]queries risk-tag statistics; omitted dates use the current month.seal-use analytics risks <tagId> --corp <corpId> [--start-date <ISO>] [--end-date <ISO>]queries detailed risks and cited documents under a specific risk tag.seal-use analytics performance --corp <corpId> [--start-date <ISO|ms>] [--end-date <ISO|ms>]queries approval performance metrics and Sankey decision flow.seal-use analytics analyze <recordId> --corp <corpId>triggers on-demand smart insight risk analysis for an approval record.seal-use analytics export --corp <corpId> [--downloads] [--out <file>] [--start-date <ISO>] [--end-date <ISO>]exports a comprehensive multi-sheet Excel report covering performance KPIs, decision flow, top risk tags, and detailed risk citations.seal-use context --corp <corpId> [--ruleVersion <versionId|versionNumber|latest>] [--documentLimit 50]aggregates rules, knowledge documents, and style preferences.seal-use source config --corp <corpId>resolves the live source-system configuration without changing it.
Test Enterprise Binding, Staging Synchronization & Automated Regression Testing:
- 1-to-1 Association: One production enterprise can only bind at most one test enterprise (
corps bind-test <prodCorpId> <testCorpId>). Multi-tier chaining is rejected. - Marking & Rigorous Confirmation: Marking (
corps mark <corpId> --env <production|test>) and binding require explicit--confirm. Without confirmation, the CLI blocks with exit code10(confirmationRequired). Overwriting existing bindings requires--force. - Production Safety Guarantee (
corps sync-test):- In the Production Enterprise: Rules remain strictly in draft state without publishing any live version.
- In the Test Enterprise: Style preferences (
decisionPreferences,thinkingDepthPreference) are updated to match production, test draft rules are cleared and populated with production draft rules, recoded, and immediately published as a new official version in the test tenant (--version-name <name>). - Semantic Version Naming: Defaults to
Sync from <ProdCorp> [Prod v<N> · #<Iteration>]tracking production baseline version and test draft iteration without redundant date strings. - Rule Mapping & Local Snapshot: Returns
versionMappingandruleMappingin CLI stdout and saves persistent snapshot to~/.config/seal-use/state/mappings/<testCorpId>-v<N>.jsonand<testCorpId>-latest.json. --dry-runpreviews the full preference diff, version mapping plan, and rule sync plan without sending mutations. Execution requires--yes.
- Approval Run Replay to Test Enterprise (
corps replay-test):- Automatically identifies the bound test enterprise for
<prodCorpId>(or current corp). - Fetches original approval records from the production enterprise (
--record-id,--sn, or batch via--limit/--status). - Cleans and normalizes payload structure, appends customizable suffix (default
-REPLAY-TEST) to avoid collision. - Automatically provisions
(Seal测-回放通道)withassistedmode on the test enterprise if no webhook integration exists. - Replays documents safely to the test enterprise webhook endpoint. Targeting production is blocked by default; if the enterprise has no bound test corp or target is production,
--forcecan be specified to override that guard, but live execution still requires--confirm/--yes.
- Automatically identifies the bound test enterprise for
- Automated Rule Regression Test Matrix (
seal-use test regression):- Runs an automated regression testing matrix across paired production and test enterprises before rule publication.
- Enforces Red Line 1: The replay target MUST be a test enterprise (
environment: "test"). Running regression tests directly in pure production is strictly forbidden. - Enforces Red Line 2: Pre-flight verification of target test enterprise AI approval balance (
balance >= samples * deductionAmount). If balance is insufficient, execution is blocked immediately to avoid quota starvation. - Samples historical completed production runs (
--samples <N>, default 10). - Replays sanitized documents into the test webhook integration.
- Uses outbound HTTPS polling for asynchronous test approval completion, eliminating any requirement for public IP or inbound webhook listeners behind NAT/VPNs.
- Normalizes and compares production vs. test decisions (
APPROVE,REJECT,MANUAL,ERROR). - Detects decision flips (e.g. production APPROVE becoming test REJECT), computes overall concordance rate, and computes boolean
safeToPublish. - Supports
--dry-runto preview sampled documents and verify quota without executing mutations. - Supports
--fail-on-flipsto terminate with a non-zero exit code (1) if any decision flip occurs, providing seamless integration with automated CI/CD safety gates.
Approval rule maintenance:
seal-use rules count [--version <number|latest>] [--corp <corpId>]seal-use rules list [--version <number|latest>] [--summary] [--limit 20] [--offset 0] [--output-file <path>] [--corp <corpId>]seal-use rules get <code> [--version <number|latest>] [--record-id <recordId>] [--corp <corpId>]seal-use rules search <keyword> [--version <number|latest>] [--maxResults 20] [--corp <corpId>]seal-use rules create --description <text> --scope <scope> [--strictness <MUST_FOLLOW|SHOULD_FOLLOW|SUGGESTION>] [--description-file <path>] [--corp <corpId>]seal-use rules update <code> [--description <text>|--description-file <path>] [--scope <scope>] [--strictness <MUST_FOLLOW|SHOULD_FOLLOW|SUGGESTION>] [--corp <corpId>]seal-use rules delete <code> --yes [--corp <corpId>]seal-use rules publish <versionName> [--corp <corpId>]seal-use rules versions [--corp <corpId>]seal-use rules version <versionNumber|latest> [--corp <corpId>]seal-use rules diff <fromVersion> <toVersion> [--code <code>] [--include-unchanged] [--full] [--corp <corpId>](returns structured changes plus a Git-styleunifiedDiff; oversized output is truncated only when it exceeds the safety limit)seal-use rules lint [--file <path>] [--linter <name|path>] [--version <number|latest>] [--code <code>] [--min-score <score>] [--level all|error|warning] [--summary] [--corp <corpId>]seal-use rules linters [--corp <corpId>](lists official and custom linters with directory specs: custom in~/.config/seal-use/lintersand official in~/.cache/seal-use/linters/official)seal-use rules pull [--version <number|latest>] [--out <file>] [--corp <corpId>]seal-use rules push [--file <path>] [--publish] [--version-name <name>] [--dry-run|--yes] [--corp <corpId>]incrementally applies the local file: matched IDs are updated, missing local IDs are created, and remote IDs absent from the file are deleted. It does not clear/recreate the whole draft or recode it. Live execution persists a per-step recovery ledger (status:not_started,partial,completed,uncertain) and hydrates newly created IDs so an interrupted run can be inspected and resumed without duplicating rules.seal-use rules push status [--file <path>] [--corp <corpId>](or--check) inspects the last push recovery ledger and reconciles remaining diff against the live draft without mutating state.seal-use rules clear [--dry-run|--yes] [--corp <corpId>]seal-use rules recode [--dry-run] --corp <corpId>: first returns an unexecuted numbering preview and a one-use credential (exit 10). Inspect the preview, then invoke the returnednextCommandseparately. The credential is enterprise/environment/draft-bound, valid for five minutes, and cannot be replaced by--yes/--confirm.--dry-runonly previews (exit 0). Recode does not publish; failed/uncertain executions require a draft read before another request. Do not script both phases into automatic consecutive execution.seal-use rules map [--version <number|latest>] [--code <code>] [--corp <corpId>](reads local sync rule mapping snapshot)
Rule identity and versioning (Draft by default vs. --version latest):
- Default = Current Draft: Whenever
--versionis omitted,rules count,rules list,rules get <code>,rules search,rules lint, andrules pullalways read the current draft. - Latest Published Version =
--version latest: To inspect the latest published version, you must explicitly pass--version latest(or--version <number>for a specific historical version, orrules version latestfor the full version snapshot). - In Seal, every rule has a 4-digit zero-padded
code(0000, 0001, 0025, 0038, ...). - A published version has its own snapshot and
codespace. Publishing or deleting rules can shiftcodenumbers across versions, so always paircodewith--versionor--record-idwhen inspecting historical approval runs.
Approval run lightweight queries:
seal-use approval-runs get <recordId> --corp <corpId> --fields metadataseal-use approval-runs get <recordId> --corp <corpId> --summaryseal-use approval-runs pick --corp <corpId> --sn <单号> --batch <batchId> --latestseal-use approval-runs document-summary <recordId> --corp <corpId>seal-use approval-runs cited-rules <recordId> --corp <corpId>seal-use approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summaryseal-use approval-runs attachments <recordId> --corp <corpId> --summaryseal-use approval-runs attachments download <recordId> [--all] [--name <name>] [--out-dir <dir>] --corp <corpId>seal-use approval-runs result <recordId> --corp <corpId> --summary
Approval knowledge documents:
seal-use documents list [--scenarios <audit,fill>] [--limit 50] [--offset 0] [--corp <corpId>]seal-use documents get <documentId> [--corp <corpId>]seal-use documents search <keyword> [--maxResults 20] [--corp <corpId>]seal-use documents create --title <title> --purpose <purpose> [--content <text>|--content-file <path>] [--type <policy|document|video|pdf|feishu_doc>] [--scenarios <audit,fill>] [--tags <tag1,tag2>] [--status <published|draft>] [--corp <corpId>]seal-use documents update <documentId> [--title <title>] [--purpose <purpose>] [--content <text>|--content-file <path>] [--type <policy|document|video|pdf|feishu_doc>] [--enabled <true|false>] [--scenarios <audit,fill>] [--tags <tag1,tag2>] [--status <published|draft>] [--corp <corpId>]seal-use documents delete <documentId> --yes [--corp <corpId>](删除前必须重新读取并确认;若只是暂时撤下内容,优先使用documents update <documentId> --enabled false)
--type 必须是 document、video、pdf、feishu_doc 或 policy(默认)之一;--scenarios 至少包含一个 fill(智能填单)或 audit(智能审核,默认)。这里的 scenarios 是产品能力开关,不是费用类别或业务场景名。
Webhook integrations:
seal-use webhook ready [<资源包.zip|信息表.xlsx>] [--webhook <idOrName>] [--corp <corpId>]seal-use webhook list [--query <text>] [--show-secret] [--corp <corpId>]seal-use webhook get|find <idOrName> [--show-secret] [--corp <corpId>]seal-use webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--min-file-size <bytes>] [--max-file-size <bytes>] [--allowed-extensions <.pdf,.xlsx,...>] [--dry-run] [--corp <corpId>]seal-use webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--min-file-size <bytes>] [--max-file-size <bytes>] [--allowed-extensions <.pdf,.xlsx,...>] [--clear-max-file-size] [--dry-run] [--corp <corpId>]seal-use webhook delete <idOrName> [--yes|--dry-run] [--corp <corpId>]seal-use webhook resource-pack export [--limit <n>] [--status <status>] [--output <file.zip>] [--to-downloads] --corp <corpId>(将线上审核记录打包导出为标准 Webhook 资源包,支持按条数、状态或指定单据 ID 筛选)seal-use webhook resource-pack preview <资源包.zip|信息表.xlsx> [--min-file-size <bytes>] [--max-file-size <bytes>] [--allowed-extensions <.pdf,.xlsx,...>] --corp <corpId>seal-use webhook resource-pack push <资源包.zip|信息表.xlsx> [--webhook <idOrName>] --corp <corpId>(别名pack,旧名material-pack兼容支持)seal-use webhook replay [<recordId>] [--sn <documentSN>] [--limit <n>] [--status <status>] [--webhook <idOrName>] [--source-corp <corpId>] [--target-corp <corpId>] [--sn-suffix <str>] [--dry-run] [--yes|--confirm] [--force] [--corp <corpId>](通用单据重放:从历史审批单据汲取结构化表单与明细,清洗规范化字段类型,支持单条或批量重放到目标企业的 Webhook 触发审批。实际重放要求--yes或--confirm;默认阻止向未授权生产环境重放以防污染数据,提供--force显式覆盖支持)
Webhook writes read the current AI approval config and POST the merged full config back to api/v1/agent/ai-approval/config, preserving non-Webhook integrations. List/get mask secret by default; add returns the generated secret once. Each Webhook can also store a mutable materialPackFilePolicy with minFileSizeBytes, optional maxFileSizeBytes, and allowedExtensions. Update is a patch: omitted policy fields are retained; allowedExtensions replaces the complete list; --clear-max-file-size removes the upper bound.
Supported high-risk writes expose --dry-run previews, including rules clear/push, corps sync-test, preference updates, thinking-depth policy changes, HoseCloud configure, Webhook writes, and corps replay-test. Preview mode performs read-only discovery and never sends the mutation request. Use the command-specific --yes or --confirm gate for live execution; --force is an additional scope override and is not a confirmation substitute.
Approval runs, simulations, and Langfuse bridge:
seal-use approval-runs search --corp <corpId> [--query <text>] [--limit 20]seal-use approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]seal-use approval-runs hose-flow <recordId|SN> --corp <corpId>(合思原生审批流时间线、员工意见、驳回原因与 AI 运行记录对齐;旧名flow兼容)seal-use approval-runs bridge --corp <corpId> [--sourceDocumentSN <sn>]seal-use simulation create --mode hosecloud --flow-ids ... --no-wait --corp <corpId>returns immediately with anasyncTicket(creation is non-blocking by default;--waithangs and polls until the batch finishes).- Create is idempotent per document set: before POSTing, the CLI checks recent batches and, if an identical
--flow-ids/--package-idsbatch (not failed/cancelled) was created within--reuse-window(default5m), it returns the existing batch withreused: trueand does not create a new one — protecting against double billing when a--waitinvocation is interrupted and re-issued. Pass--force(or--reuse-window 0) to skip the check and create a fresh batch. seal-use simulation status <batchId> --corp <corpId>performs one non-blocking status check and returnsQUEUED/RUNNING/COMPLETED/FAILED-style state plus counters.seal-use simulation approval-definitions --corp <corpId>lists available Feishu approval definitions so anapprovalCodecan be selected before creating a batch.seal-use simulation wait <batchId> --corp <corpId>seal-use simulation clean <batchId> --yes --corp <corpId>seal-use simulation list --corp <corpId>seal-use simulation get <batchId> --corp <corpId>seal-use simulation batch-records <batchId> --corp <corpId>seal-use simulation templates --corp <corpId>seal-use simulation integrations --corp <corpId>
Langfuse trace inspection (built-in, read-only, credentials injected at compile time; no --corp and no user config required; all verbs are seal_use MCP-read-only):
seal-use langfuse checkverifies connectivity of the embedded read-only credentials (missing credentials → exit 11).seal-use langfuse cache-refresh <traceId>fetches one full trace into~/.cache/seal-use/langfuse/traces/default/<traceId>.json(shared format with langfuse-home); other cache-first verbs answer from it across working directories and point here (exit 13) when it is missing, unless--refresh-if-missing.SEAL_USE_LANGFUSE_CACHE_DIRoverrides the cache root. Matching legacy cwd caches are copied on first read, preserving their original files and timestamps.seal-use langfuse outline <traceId> [--include-io-preview] [--max-preview-chars <n>] [--full]returns the compact observation tree with sizes, usage, cost, andwarnings[]for >20k-char fields.seal-use langfuse search <traceId> --query <term1,term2>is the ranked single-trace keyword search (qrep): hierarchy paths,observationId, before/match/after context;--metadata <json>and--observation-typesnarrow it.seal-use langfuse observation <traceId> <observationId> [--max-chars <n>] [--json-path <path>]reads focused IO last (middle-truncated to 8000 chars by default, 30000 max, 500000 with--full).seal-use langfuse session <sessionId>,seal-use langfuse observations <traceId>, andseal-use langfuse url <traceId>give the session outline, filtered observation summaries, and a UI deep link.seal-use langfuse attachment-flow <traceId> --file-id/--file-name/--content-hintsandseal-use langfuse rule-flow <traceId> --rule <text>extract deterministic text evidence per pipeline stage (they do not prove model reasoning).
Common Examples
Add and verify a Hose enterprise:
seal-use corps add-hose-persistent --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId"}'
seal-use auth check --corp <corpId>
Force-write a Hose config without verification:
seal-use corps add-hose-persistent --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId","force":true}'
Check auth failures:
seal-use auth check --corp <corpId>
The diagnostic stages are hose.openapi, hose.provisional, seal.sso, and seal.whoami. Tokens are omitted from output.
Search approval rules or knowledge documents:
seal-use rules search <keyword> --maxResults 20 --corp <corpId>
seal-use documents search <keyword> --maxResults 20 --corp <corpId>
Get aggregated approval context:
seal-use context --documentLimit 20 --corp <corpId>
Create, update, and publish approval rules:
seal-use rules create --description "规则描述" --scope "适用场景" --strictness SHOULD_FOLLOW --corp <corpId>
seal-use rules update 25 --description "更新后的规则描述" --corp <corpId>
seal-use rules publish "版本名称" --corp <corpId>
Create and update an approval knowledge document:
seal-use documents create --title "标题" --purpose "用途" --content-file ./policy.md --type policy --scenarios audit --corp <corpId>
seal-use documents update <documentId> --content-file ./policy.md --corp <corpId>
Summarize one local date:
seal-use approval-runs summary --corp <corpId> --date 2026-06-09 --timezone Asia/Shanghai --limit 100
Find a run and include Langfuse bridge rows:
seal-use approval-runs search --corp <corpId> --query <sourceDocumentSN> --limit 20 --includeBridge true
Resolve Langfuse trace/session hints:
seal-use approval-runs bridge --corp <corpId> --sourceDocumentSN <sourceDocumentSN>
模拟测试批次(模拟发布闭环)创建与查询:
# 合思指定单号: 创建批次(响应只含 batchId)
seal-use simulation create --mode hosecloud --flow-ids "B26017701,B26022501" --reject-node 财务 --thinking-depth medium --skip-invoice-generation --corp <corpId>
# 材料包导入: 先上传材料包 ZIP(服务端解析并返回 schemaConfig), 再用返回的 id 发起
seal-use simulation package-upload 测试材料包.zip --corp <corpId>
seal-use simulation create --mode material_pack --package-ids <materialPackageId> --template-id conference_reimbursement_v1 --schema-config schema.json --corp <corpId>
# 预留: 其他模式参数通过 --json 透传(如时间范围 startTime/endTime)
seal-use simulation create --mode hosecloud --flow-ids "B26017701" --json '{"startTime":0,"endTime":0}' --corp <corpId>
# 创建后轮询批次状态与记录
seal-use simulation list --limit 50 --corp <corpId>
seal-use simulation get <batchId> --corp <corpId>
seal-use simulation batch-records <batchId> --corp <corpId>
seal-use simulation templates --corp <corpId>
seal-use simulation integrations --corp <corpId>
Failure Handling
- If no run is found by
sourceDocumentSN, retry withsourceDocumentIdor a broaderquery. - If date-based summaries look wrong, pass
--timezone Asia/Shanghaiand an explicit--date. - If
langfuseTraceIdis missing, uselangfuseSessionFallback. - If a write operation fails, report the raw JSON error and do not retry with guessed payloads.