agent-toolkit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Agent Toolkit (
tk
)

Agent Toolkit (
tk
)

Minimum turns and tokens. Use an existing tool first. When a raw command is repeatable, save it.
尽量减少轮次和 token 消耗。优先使用现有工具。如果某个原始命令可以重复执行,就将其保存。

0. Bootstrap (if
tk
is missing)

0. 初始化(缺少
tk
时)

Idempotent. Clone or update
~/.agent-toolkit
, then install or call that
tk
:
bash
git clone --depth 1 https://github.com/ASabale/agent-toolkit.git ~/.agent-toolkit || git -C ~/.agent-toolkit pull --ff-only
~/.agent-toolkit/install.sh
export PATH="$HOME/.local/bin:$PATH"
Or run
~/.agent-toolkit/tk
directly. Re-running is safe.
幂等。克隆或更新
~/.agent-toolkit
,然后安装或调用该
tk
:
bash
git clone --depth 1 https://github.com/ASabale/agent-toolkit.git ~/.agent-toolkit || git -C ~/.agent-toolkit pull --ff-only
~/.agent-toolkit/install.sh
export PATH="$HOME/.local/bin:$PATH"
或者直接运行
~/.agent-toolkit/tk
。重复运行是安全的。

1. Use (
Find → Run
)

1. 使用(
查找 → 运行
)

  1. Find:
    tk find "<intent>"
    (match plus a runnable command).
  2. Run that line with real
    --flag
    values:
    tk run <tool> --flag "<value>"
    .
    tk info <tool>
    for flags. On failure, run
    fix
    from
    stderr
    . If output has
    next
    , run it. Pipe JSON or
    tk run <chain>
    for multi-step.
  1. 查找:
    tk find "<intent>"
    (匹配工具并给出可运行的命令)。
  2. 使用真实的
    --flag
    值运行该命令:
    tk run <tool> --flag "<value>"
    。 使用
    tk info <tool>
    查看 flags。运行失败时,根据
    stderr
    运行
    fix
    。如果输出中包含
    next
    ,则运行它。也可以管道传输 JSON,或使用
    tk run <chain>
    执行多步骤流程。

2. Evolve (
Save → Check
)

2. 演进(
保存 → 检查
)

When
tk find
misses and raw CLI solved a repeatable task:
  1. Save (
    $TK_ARG_<FLAG>
    inputs, compact JSON on
    stdout
    ):
    tk save <namespace>.<name> --summary "<1-line summary>" --safety <read-only|mutating|destructive> --file <script>
    Or:
    tk chain save <namespace>.<name> --summary "<1-line summary>" --steps '<json-or-names>'
  2. Verify:
    tk check <namespace>.<name> && tk run <namespace>.<name> --dry-run
  3. Prune:
    tk evolve
    reports unused, failures, overlap;
    tk prune
    archives drops.
如果
tk find
未找到匹配项,但原始 CLI 已解决了一个可重复执行的任务:
  1. 保存(使用
    $TK_ARG_<FLAG>
    作为输入,并在
    stdout
    输出紧凑 JSON):
    tk save <namespace>.<name> --summary "<1-line summary>" --safety <read-only|mutating|destructive> --file <script>
    或者:
    tk chain save <namespace>.<name> --summary "<1-line summary>" --steps '<json-or-names>'
  2. 验证:
    tk check <namespace>.<name> && tk run <namespace>.<name> --dry-run
  3. 清理:
    tk evolve
    报告未使用、失败和重叠的工具;
    tk prune
    会归档被移除的工具。

Rules

规则

  • Distill
    stdout
    . Named
    --flags
    only; no positional args; no hardcoded IDs, hosts, or paths.
  • Do not wrap one UNIX command; save tools that collapse steps, filter noise, or enforce safety.
  • 精简
    stdout
    。仅使用具名
    --flags
    ;不使用位置参数;不硬编码 IDs、主机或路径。
  • 不要包装单条 UNIX 命令;应保存能够合并步骤、过滤噪声或强化安全性的工具。