Loading...
Loading...
Compare original and translation side by side
jqjqundefinedundefined
No `--json` flag. No `--human` flag. JSON is the default and only format.
无需`--json`或`--human`参数,JSON是默认且唯一的输出格式。next_actions{
"ok": true,
"command": "joelclaw send pipeline/video.download",
"result": {
"event_id": "01KHF98SKZ7RE6HC2BH8PW2HB2",
"status": "accepted"
},
"next_actions": [
{
"command": "joelclaw run 01KHF98SKZ7RE6HC2BH8PW2HB2",
"description": "Check run status for this event"
},
{
"command": "joelclaw logs --follow",
"description": "Watch worker logs in real-time"
},
{
"command": "joelclaw health",
"description": "Check system health"
}
]
}next_actionsnext_actions{
"ok": true,
"command": "joelclaw send pipeline/video.download",
"result": {
"event_id": "01KHF98SKZ7RE6HC2BH8PW2HB2",
"status": "accepted"
},
"next_actions": [
{
"command": "joelclaw run 01KHF98SKZ7RE6HC2BH8PW2HB2",
"description": "Check run status for this event"
},
{
"command": "joelclaw logs --follow",
"description": "Watch worker logs in real-time"
},
{
"command": "joelclaw health",
"description": "Check system health"
}
]
}next_actions{
"ok": true,
"command": "joelclaw",
"result": {
"description": "JoelClaw — personal AI system CLI",
"health": { "server": {...}, "worker": {...} },
"commands": [
{ "name": "send", "description": "Send event to Inngest", "usage": "joelclaw send <event> -d '<json>'" },
{ "name": "status", "description": "System status", "usage": "joelclaw status" },
{ "name": "health", "description": "Health check all services", "usage": "joelclaw health" }
]
},
"next_actions": [...]
}{
"ok": true,
"command": "joelclaw",
"result": {
"description": "JoelClaw — personal AI system CLI",
"health": { "server": {...}, "worker": {...} },
"commands": [
{ "name": "send", "description": "Send event to Inngest", "usage": "joelclaw send <event> -d '<json>'" },
{ "name": "status", "description": "System status", "usage": "joelclaw status" },
{ "name": "health", "description": "Health check all services", "usage": "joelclaw health" }
]
},
"next_actions": [...]
}{
"ok": true,
"command": "joelclaw logs",
"result": {
"lines": 20,
"total": 4582,
"truncated": true,
"full_output": "/var/folders/.../joelclaw-logs-abc123.log",
"entries": ["...last 20 lines..."]
},
"next_actions": [
{ "command": "joelclaw logs --tail 100", "description": "Show more log lines" }
]
}{
"ok": true,
"command": "joelclaw logs",
"result": {
"lines": 20,
"total": 4582,
"truncated": true,
"full_output": "/var/folders/.../joelclaw-logs-abc123.log",
"entries": ["...last 20 lines..."]
},
"next_actions": [
{ "command": "joelclaw logs --tail 100", "description": "Show more log lines" }
]
}fix{
"ok": false,
"command": "joelclaw send pipeline/video.download",
"error": {
"message": "Inngest server not responding",
"code": "SERVER_UNREACHABLE"
},
"fix": "Start the Inngest server: cd ~/Code/system-bus && docker compose up -d",
"next_actions": [
{ "command": "joelclaw health", "description": "Re-check system health after fix" },
{ "command": "docker ps", "description": "Check if Docker containers are running" }
]
}fix{
"ok": false,
"command": "joelclaw send pipeline/video.download",
"error": {
"message": "Inngest server not responding",
"code": "SERVER_UNREACHABLE"
},
"fix": "Start the Inngest server: cd ~/Code/system-bus && docker compose up -d",
"next_actions": [
{ "command": "joelclaw health", "description": "Re-check system health after fix" },
{ "command": "docker ps", "description": "Check if Docker containers are running" }
]
}{
ok: true,
command: string, // the command that was run
result: object, // command-specific payload
next_actions: Array<{
command: string, // exact command to copy-paste/run
description: string // what it does
}>
}{
ok: true,
command: string, // 执行的命令
result: object, // 命令专属返回数据
next_actions: Array<{
command: string, // 可直接复制执行的命令
description: string // 命令说明
}>
}{
ok: false,
command: string,
error: {
message: string, // what went wrong
code: string // machine-readable error code
},
fix: string, // plain-language suggested fix
next_actions: Array<{
command: string,
description: string
}>
}{
ok: false,
command: string,
error: {
message: string, // 错误信息
code: string // 机器可读的错误码
},
fix: string, // 自然语言描述的修复建议
next_actions: Array<{
command: string,
description: string
}>
}slog~/Code/system-bus/igs~/Code/system-bus/slog~/Code/system-bus/igs~/Code/system-bus/@effect/cliimport { Command, Options } from "@effect/cli"
import { NodeContext, NodeRuntime } from "@effect/platform-node"
const send = Command.make("send", {
event: Options.text("event"),
data: Options.optional(Options.text("data").pipe(Options.withAlias("d"))),
}, ({ event, data }) => {
// ... execute, return JSON envelope
})
const root = Command.make("joelclaw", {}, () => {
// Root: return health + command tree
}).pipe(Command.withSubcommands([send, status, health]))@effect/cliimport { Command, Options } from "@effect/cli"
import { NodeContext, NodeRuntime } from "@effect/platform-node"
const send = Command.make("send", {
event: Options.text("event"),
data: Options.optional(Options.text("data").pipe(Options.withAlias("d"))),
}, ({ event, data }) => {
// ... 执行逻辑,返回JSON信封格式
})
const root = Command.make("joelclaw", {}, () => {
// 根命令:返回健康状态 + 命令树
}).pipe(Command.withSubcommands([send, status, health]))~/.bun/bin/bun build src/cli.ts --compile --outfile joelclaw
cp joelclaw ~/.bun/bin/~/.bun/bin/bun build src/cli.ts --compile --outfile joelclaw
cp joelclaw ~/.bun/bin/Command.makenext_actionscommandsCommand.makenext_actionscommands| Don't | Do |
|---|---|
| Plain text output | JSON envelope |
| Tables with ANSI colors | JSON arrays |
| JSON is the only format |
| Dump 10,000 lines | Truncate + file pointer |
| |
| Undiscoverable commands | Root returns full command tree |
| Static help text | HATEOAS next_actions |
| |
| Exit code as the only error signal | Error in JSON + exit code |
| Require the agent to read --help | Root command self-documents |
| 禁止做法 | 正确做法 |
|---|---|
| 纯文本输出 | JSON信封格式 |
| 带ANSI颜色的表格 | JSON数组 |
通过 | JSON是唯一输出格式 |
| 输出10000行内容 | 截断输出并提供文件路径 |
| |
| 命令不可被发现 | 根命令返回完整命令树 |
| 静态帮助文本 | HATEOAS风格的next_actions |
| |
| 仅通过退出码传递错误信号 | JSON中包含错误信息 + 退出码 |
| 要求Agent阅读--help内容 | 根命令提供自文档化信息 |
sendstatushealthlogsjoelclaw memory searchjoelclaw loop start--kebab-case--max-quality--follow-d--data-f--followdomain/actionpipeline/video.downloadcontent/summarizesendstatushealthlogsjoelclaw memory searchjoelclaw loop start--kebab-case--max-quality--follow-d--data-f--followdomain/actionpipeline/video.downloadcontent/summarize