跳到主要内容
TokenDance Code
EN
更新于 2026-10-22

CLI 参考

下表对应 Rust 预览。如果尚未安装本地 binary,请在源码仓库中将 tokendance 替换为 cargo run --locked -p tokendance-cli --。

会话与输出

tokendance --help
tokendance
tokendance run --json "hello"
tokendance run --stream-json "hello"
命令当前行为
tokendance使用模拟 Provider 进入交互会话
tokendance --continue使用最近的本地会话标识进入交互模式
tokendance run "<prompt>"返回模拟响应,并写入本地会话记录
tokendance run --json "<prompt>"将结果与事件作为一个 JSON 对象输出
tokendance run --stream-json "<prompt>"以 JSONL 输出事件及终态结果

输出参数必须放在提示词之前。提示词本身以 --json 开头时使用 run -- --json。--json 与 --stream-json 不能同时使用。

交互命令包括 /help、/status、/exit 和 /quit。/compact 与 /model 当前会显示 not yet implemented。

诊断与配置

tokendance doctor --json
tokendance config validate --project . --json
命令当前行为
doctor [--json]输出版本、Rust runtime 与默认 mock Provider
config validate [--project <path>] [--json]读取配置并校验受支持的值;无效配置返回非零退出码
quality打印诊断概览,不会执行测试或用户传入的命令

doctor 不测试模型连通性。quality 中的测试数是内置静态文字;需要当前测试结果时,请实际执行 Cargo 测试。

会话与 Transcript

tokendance sessions list --json
tokendance sessions show SESSION_ID --events
tokendance transcript search "hello" --json
命令当前行为
sessions 或 sessions list [--json]列出当前目录 .tokendance-rs/sessions/ 下的会话
sessions show <id> [--events]查看本地会话信息,并可显示事件摘要
transcript search <query> [--sessions-dir <path>] [--json]在 transcript 行中进行不区分大小写的文本搜索

在产生会话记录的同一工作目录执行查看命令。--continue 会复用会话标识,但不代表完整恢复了此前所有上下文。

预览边界

gateway init --model <name> 当前只打印设置提示,不写入 preset。auth tokendanceid login-url 是历史占位入口,不是 TokenDance Account 的现行接入流程。

旧版 quickstart、config path、config set、resume <id>、transcript export、diff、review、tasks、tools 与 worktree 顶层命令均未在当前 Rust CLI 注册。请以实际使用的 binary 的 --help 为准,不要直接照搬旧 TypeScript 命令表。

在 GitHub 编辑此页