Add CLI version command

This commit is contained in:
gitea committed 2026-06-09 12:02:27 +08:00
1 parent 871bef3e4f
commit aa6f6321e5
4 files changed
+34 -2

No files matched your search

+10 -1
View File
@@ -34,6 +34,15 @@ bun run cli -- source config
bun run cli -- tools list
```
Update an existing checkout:
```bash
git pull
bun install
bun run cli -- version
bun run cli -- tools list
```
Local enterprise config files are ignored by git:
```text
@@ -86,7 +95,7 @@ CLI output is JSON on stdout. Errors are written to stderr.
- `seal_corp_switch`: switch the active local enterprise config.
- `seal_whoami`: current Seal user and tenant.
- `seal_approval_search`: keyword search across approval rules, documents, approval preferences, and optionally published rule history. Results include area, entity, field, line number, and surrounding context. Search data is cached in memory for 5 minutes.
- `seal_approval_search`: keyword search across approval rules, documents, approval preferences, and optionally published rule history. Results include area, entity, field, line number, and surrounding context. Search data is cached in memory for 5 minutes only within a long-lived process such as the MCP server; separate CLI invocations do not share this cache.
- `seal_approval_context_get`: read current approval rules, approval documents, and approval style preferences in one call.
- `seal_runs_search`: search the approval run history from `api/v1/approvals`. This is the broad record table for historical runs and returns compact run fields; set `includeBridge` only when full Langfuse bridge rows are needed.
- `seal_action`: low-frequency management router. Use `action: "help"` or `payload.topic` to discover actions.
+2 -1
View File
@@ -11,6 +11,7 @@ Run commands from the seal-home repository root:
```bash
bun run cli -- help
bun run cli -- version
bun run cli -- tools list
```
@@ -73,7 +74,7 @@ Use for "which rule/document mentions X" or before changing rule/document conten
bun run cli -- tool seal_approval_search --json '{"keywords":["关键词"],"matchMode":"any","maxResults":20}'
```
Use `areas` to narrow to `rules`, `documents`, or `preferences`. Use `refresh:true` when recent edits may not be reflected in the in-memory cache.
Use `areas` to narrow to `rules`, `documents`, or `preferences`. Use `refresh:true` when recent edits may not be reflected in the MCP server's in-memory cache. Separate CLI invocations are short-lived processes and do not share this cache.
### Update approval rules
+11
View File
@@ -9,6 +9,7 @@ bun run cli -- <command>
## Top-Level Commands
```bash
bun run cli -- version
bun run cli -- tools list
bun run cli -- corps list [--corp <corpId>]
bun run cli -- source config [--corp <corpId>]
@@ -21,6 +22,15 @@ bun run cli -- simulation batch-records <batchId>
## Fine-Grained Tools
`bun run cli -- version` returns:
```json
{
"name": "seal-home",
"version": "0.3.0"
}
```
Identity and session:
- `seal_whoami`
@@ -184,6 +194,7 @@ Update style preferences:
## Failure Handling
- CLI commands are short-lived processes. In-memory auth/search caches only live for that single process. The MCP server is long-lived, so it can reuse in-memory caches across tool calls until refresh or TTL expiry.
- 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`.
+11
View File
@@ -6,6 +6,8 @@ import { resolveLiveSealEnterpriseConfig } from "./domains/seal/source.js";
import { sealTools, type SealTool } from "./domains/seal/tools.js";
import { CorpConfig } from "./core/config/types.js";
const VERSION = "0.3.0";
type ParsedArgs = {
command: string[];
options: Record<string, string | boolean>;
@@ -21,6 +23,14 @@ async function main() {
return;
}
if (area === "version") {
printJson({
name: "seal-home",
version: VERSION
});
return;
}
if (area === "tools" && action === "list") {
printJson(sealTools.map((tool) => ({ name: tool.name, description: tool.description })));
return;
@@ -210,6 +220,7 @@ function printHelp() {
console.log(`seal-home CLI
Usage:
seal-home version
seal-home tools list
seal-home corps list [--corp <corpId>]
seal-home source config [--corp <corpId>]