Files
seal-use/skills/seal-home/references/cli.md
T
gitea 191e67957d
🧪 CI / 🧪 Test & Type-Check (push) Has been cancelled
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled
Optimize release upload and ensure bump script syncs global skill directory
2026-08-26 16:27:39 +08:00

14 KiB

Seal Home CLI Reference

Run from any directory after installing the global CLI:

seal-home <command>

Enterprise config lookup:

  • If SEAL_HOME_ENTERPRISES_DIR is set, only that directory is loaded.
  • Otherwise ./enterprises and ~/.config/seal-home/enterprises are merged.
  • User-level configs override same-ID local configs.

Enterprise selection is stateless by default. Commands that access an enterprise require --corp <corpId> unless stateful mode is explicitly enabled:

seal-home config mode stateful --corp <corpId>
seal-home corps switch <corpId>
seal-home config mode stateless

The global mode is stored in ~/.config/seal-home/config.json; set SEAL_HOME_CONFIG_FILE to override that path. The legacy current-corp file is not read.

Top-Level Commands

seal-home version
seal-home config paths
seal-home config get
seal-home config mode <stateful|stateless> [--corp <corpId>]
seal-home service <start|stop|restart|status>
seal-home http [--port 8787] [--host 127.0.0.1]
seal-home serve [--port 8787]
seal-home update
seal-home tools list
seal-home corps list [--corp <corpId>]
seal-home corps current [--corp <corpId>]
seal-home corps switch <corpId>
seal-home corps add-hose --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId"}'
seal-home corps add-seal --json '{"sealUrl":"https://tenant.sealai.cc","token":"seal-bearer-token"}'
seal-home auth diagnose [--corp <corpId>]
seal-home auth hose-link [--corp <corpId>] [--expire 7200]
seal-home delegation list [--corp <corpId>]
seal-home delegation create [--note <note>] [--corp <corpId>]
seal-home delegation revoke <tokenId> [--corp <corpId>]
seal-home users create --name <name> --phone <phone> [--dept <deptId>] [--corp <corpId>]
seal-home users reset-password <userId> [--corp <corpId>]
seal-home users get <userId> [--corp <corpId>]
seal-home users delete <userId> [--corp <corpId>]
seal-home llm config [--corp <corpId>]
seal-home llm providers [--corp <corpId>]
seal-home permissions available [--corp <corpId>]
seal-home permissions configs [--corp <corpId>]
seal-home billing status [--corp <corpId>]
seal-home billing plans [--corp <corpId>]
seal-home billing features [--corp <corpId>]
seal-home webhook list [--query <text>] [--show-secret] [--corp <corpId>]
seal-home webhook get|find <idOrName> [--show-secret] [--corp <corpId>]
seal-home webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]
seal-home webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]
seal-home webhook delete <idOrName> --yes [--corp <corpId>]
seal-home deploy hosecloud requirements [--corp <corpId>]
seal-home deploy hosecloud list [--corp <corpId>]
seal-home deploy hosecloud get <sign-key> [--corp <corpId>]
seal-home deploy hosecloud status [--corp <corpId>]
seal-home deploy hosecloud configure --json '{...}' [--corp <corpId>]
seal-home deploy hosecloud sync <sign-key> [--corp <corpId>]
seal-home preference get [--corp <corpId>]
seal-home preference decision update --json '{"explicitApprove":"..."}' [--corp <corpId>]
seal-home preference thinking-depth set --default <medium|high> [--corp <corpId>]
seal-home preference thinking-depth policies list [--corp <corpId>]
seal-home preference thinking-depth policies upsert --json '{...}' [--corp <corpId>]
seal-home preference thinking-depth policies remove <policyId> [--corp <corpId>]
seal-home source config [--corp <corpId>]
seal-home tool <toolName> [--corp <corpId>] [--json '{"key":"value"}']
seal-home approval-runs summary --corp <corpId> [--date YYYY-MM-DD] [--timezone Asia/Shanghai]
seal-home approval-runs stats --corp <corpId> [--since 3months] [--dedupe-by sourceDocumentSN|sourceDocumentId|id]
seal-home approval-runs count --corp <corpId> [--status APPROVED]
seal-home approval-runs search --corp <corpId> [--query text] [--limit 20] [--includeBridge true]
seal-home approval-runs get <recordId> --corp <corpId> [--fields metadata|document.fields,result.summary] [--output-file file.json]
seal-home approval-runs attachments <recordId> --corp <corpId>
seal-home approval-runs result <recordId> --corp <corpId> [--summary]
seal-home approval-runs url --corp <corpId>
seal-home approval-runs url <recordId> --corp <corpId>
seal-home approval-runs url --sourceDocumentSN <sourceDocumentSN> --corp <corpId>
seal-home approval-runs bridge --corp <corpId> [--sourceDocumentSN <sourceDocumentSN>]
seal-home simulation batch-records <batchId> --corp <corpId>
seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" [--reject-node 财务] [--thinking-depth default|medium|high] [--skip-invoice-generation|--skip-invoice-generation false] --corp <corpId>
seal-home simulation create --mode material_pack --package-ids <materialPackageId> [--template-id conference_reimbursement_v1] [--schema-config file.json] --corp <corpId>
seal-home simulation create --source-system weaver --request-ids "req-01,req-02" --corp <corpId>
seal-home simulation wait <batchId> [--timeout 10m] [--poll-interval 2s] --corp <corpId>
seal-home simulation clean <batchId> --corp <corpId>
seal-home simulation specifications [--integration <sign-key>] --corp <corpId>
seal-home simulation list [--limit 50] --corp <corpId>
seal-home simulation get <batchId> --corp <corpId>
seal-home simulation templates --corp <corpId>
seal-home simulation integrations --corp <corpId>
seal-home simulation package-upload <材料包.zip> --corp <corpId>

Fine-Grained Tools

seal-home version returns:

{
  "name": "seal-home",
  "version": "<package version>"
}

seal-home service status returns the PID, version, state directory, PID file, and log file for the optional local background process.

seal-home update updates the git checkout, runs bun install, and restarts the local service if it was running.

Identity and session:

  • seal-home auth diagnose --corp <corpId>
  • seal_whoami
  • seal_session_get

Approval rule maintenance:

  • seal-home rules count [--corp <corpId>]
  • seal-home rules list --summary [--corp <corpId>]
  • seal-home rules clear [--corp <corpId>] [--dry-run|--yes]
  • seal_approval_rules_list
  • seal_approval_rules_clear
  • seal_approval_rule_create
  • seal_approval_rule_update
  • seal_approval_rule_delete
  • seal_approval_rule_versions_list
  • seal_approval_rule_version_publish

Approval run lightweight queries:

  • seal-home approval-runs get <recordId> --corp <corpId> --fields metadata
  • seal-home approval-runs get <recordId> --corp <corpId> --summary
  • seal-home approval-runs pick --corp <corpId> --sn <单号> --batch <batchId> --latest
  • seal-home approval-runs document-summary <recordId> --corp <corpId>
  • seal-home approval-runs cited-rules <recordId> --corp <corpId>
  • seal-home approval-runs get <recordId> --corp <corpId> --fields document.fields,result.summary
  • seal-home approval-runs attachments <recordId> --corp <corpId> --summary
  • seal-home approval-runs result <recordId> --corp <corpId> --summary
  • seal_approval_run_get with fields
  • seal_approval_run_pick
  • seal_approval_run_cited_rules_get
  • seal_approval_run_document_summary_get
  • seal_approval_run_attachments_get
  • seal_approval_run_result_get with {"summary":true}

Approval knowledge documents:

  • seal_approval_documents_list
  • seal_approval_document_get
  • seal_approval_document_create
  • seal_approval_document_update

Approval search and context:

  • seal_approval_search
  • seal_approval_context_get
  • seal-home rules get --corp <corpId> --version <number> --code '#0038'
  • seal-home rules get --corp <corpId> --record-id <recordId> --runtime-id rule-205

Style preferences:

  • seal_approval_style_preferences_get
  • seal_approval_style_preferences_update

Webhook integrations:

  • seal-home webhook list [--query <text>] [--show-secret] [--corp <corpId>]
  • seal-home webhook get|find <idOrName> [--show-secret] [--corp <corpId>]
  • seal-home webhook add --name <name> --result-url <url> [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>] [--corp <corpId>]
  • seal-home webhook update <idOrName> [--name <name>] [--result-url <url>] [--mode assisted|semi_automatic|fully_automatic] [--auto-approval-rate 60] [--secret <secret>|--rotate-secret] [--corp <corpId>]
  • seal-home webhook delete <idOrName> --yes [--corp <corpId>]
  • seal_webhook_list
  • seal_webhook_get
  • seal_webhook_add
  • seal_webhook_update
  • seal_webhook_delete

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.

Approval runs, simulations, and Langfuse bridge:

  • seal_approval_runs_search
  • seal_approval_runs_summary
  • seal_simulation_batch_records_get
  • seal_simulation_batch_create
  • seal_simulation_batches_list
  • seal_simulation_batch_get
  • seal_simulation_templates_get
  • seal_simulation_integrations_get
  • seal_approval_run_langfuse_bridge_get

Common Examples

Add and verify a Hose enterprise:

seal-home corps add-hose --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId"}'
seal-home auth diagnose --corp <corpId>

Force-write a Hose config without verification:

seal-home corps add-hose --json '{"name":"企业名称","domain":"https://app.ekuaibao.com","appKey":"...","appSecurity":"...","proxyStaffBizId":"corpId:staffId","force":true}'

Diagnose auth failures:

seal-home auth diagnose --corp <corpId>

The diagnostic stages are hose.openapi, hose.provisional, seal.sso, and seal.whoami. Tokens are omitted from output.

Search approval content:

seal-home tool seal_approval_search --corp <corpId> --json '{"keywords":["关键词"],"matchMode":"any","maxResults":20}'

Get aggregated approval context:

seal-home tool seal_approval_context_get --corp <corpId> --json '{"documentLimit":20}'

Create a draft approval rule:

seal-home tool seal_approval_rule_create --corp <corpId> --json '{"description":"规则描述","scope":"适用场景","strictness":"SHOULD_FOLLOW"}'

Update an approval document:

seal-home tool seal_approval_document_update --corp <corpId> --json '{"documentId":"doc-id","content":"Markdown 内容"}'

Summarize one local date:

seal-home approval-runs summary --corp <corpId> --date 2026-06-09 --timezone Asia/Shanghai --limit 100

Find a run and include Langfuse bridge rows:

seal-home approval-runs search --corp <corpId> --query <sourceDocumentSN> --limit 20 --includeBridge true

Resolve Langfuse trace/session hints:

seal-home approval-runs bridge --corp <corpId> --sourceDocumentSN <sourceDocumentSN>

模拟测试批次(模拟发布闭环)创建与查询:

# 合思指定单号: 创建批次(响应只含 batchId)
seal-home simulation create --mode hosecloud --flow-ids "B26017701,B26022501" --reject-node 财务 --thinking-depth medium --skip-invoice-generation --corp <corpId>
# 材料包导入: 先上传材料包 ZIP(服务端解析并返回 schemaConfig), 再用返回的 id 发起
seal-home simulation package-upload 测试材料包.zip --corp <corpId>
seal-home simulation create --mode material_pack --package-ids <materialPackageId> --template-id conference_reimbursement_v1 --schema-config schema.json --corp <corpId>
# 预留: 其他模式参数通过 --json 透传(如时间范围 startTime/endTime)
seal-home simulation create --mode hosecloud --flow-ids "B26017701" --json '{"startTime":0,"endTime":0}' --corp <corpId>
# 创建后轮询批次状态与记录
seal-home simulation list --limit 50 --corp <corpId>
seal-home simulation get <batchId> --corp <corpId>
seal-home simulation batch-records <batchId> --corp <corpId>
seal-home simulation templates --corp <corpId>
seal-home simulation integrations --corp <corpId>

Write Operation Payloads

Create a rule:

{
  "description": "规则描述",
  "scope": "适用场景",
  "strictness": "MUST_FOLLOW | SHOULD_FOLLOW | SUGGESTION"
}

Update a rule:

{
  "ruleId": "rule-id",
  "description": "可选",
  "scope": "可选",
  "strictness": "SHOULD_FOLLOW"
}

Publish a rule version:

{
  "versionName": "版本名称"
}

Create a document:

{
  "title": "标题",
  "purpose": "用途",
  "content": "Markdown 内容",
  "contentType": "text/markdown",
  "status": "可选",
  "scenarios": ["场景"],
  "tags": ["标签"]
}

Update a document:

{
  "documentId": "doc-id",
  "title": "可选",
  "purpose": "可选",
  "content": "可选",
  "enabled": true,
  "scenarios": ["可选"],
  "tags": ["可选"]
}

Update style preferences:

{
  "tone": "可选",
  "language": "可选",
  "detailLevel": "可选",
  "outputFormat": "可选",
  "examples": ["可选"],
  "prohibitedPhrases": ["可选"],
  "customInstructions": "可选"
}

Failure Handling

  • CLI commands are short-lived processes. In-memory auth/search caches only live for that single process. Use seal-home service restart after updates so the optional local service picks up new code.
  • If no run is found by sourceDocumentSN, retry with sourceDocumentId or a broader query.
  • If date-based summaries look wrong, pass --timezone Asia/Shanghai and an explicit --date.
  • If langfuseTraceId is missing, use langfuseSessionFallback.
  • If a write operation fails, report the raw JSON error and do not retry with guessed payloads.