docs: translate README to Chinese

This commit is contained in:
2026-08-16 11:54:58 +08:00
parent 6ce4d61c8f
commit e56ff6b1e1
+15 -15
View File
@@ -1,20 +1,20 @@
# CraftTable MCP CLI # CraftTable MCP CLI
`@game-crafttable/mcp-client` provides the `crafttable-mcp` command and the compatibility alias `crafttable-mcp-client`. `@game-crafttable/mcp-client` 提供主命令 `crafttable-mcp`,并保留兼容别名 `crafttable-mcp-client`
## Quick install and configure ## 快速安装与配置
The repository is private, so first make sure Git Credential Manager can access `git.crash.work`, then run this in PowerShell: 该仓库目前为私有仓库。请先确认 Git Credential Manager 能够访问 `git.crash.work`,然后在 PowerShell 中执行:
```powershell ```powershell
npm install --global --allow-git=all --ignore-scripts git+https://git.crash.work/cneicy/crafttable-mcp-client.git; crafttable-mcp login; crafttable-mcp configure all npm install --global --allow-git=all --ignore-scripts git+https://git.crash.work/cneicy/crafttable-mcp-client.git; crafttable-mcp login; crafttable-mcp configure all
``` ```
This installs the CLI, opens the browser for OAuth login, and configures the same local stdio bridge plus the `crafttable` Agent Skill for Codex, Claude Code, and OpenCode at user scope. The Skill lets an Agent discover and call CraftTable proactively when workspace data is relevant. 这条命令会安装 CLI、打开浏览器完成 OAuth 登录,并在用户级配置中为 Codex、Claude Code 和 OpenCode 注册同一个本地 stdio 桥及 `crafttable` Agent Skill。当工作区数据与当前任务相关时,该 Skill 可以帮助 Agent 主动发现并调用 CraftTable。
The explicit `--allow-git=all` is required by npm 12, whose default policy rejects Git-based package dependencies. The repository includes the built CLI bundle, so `--ignore-scripts` keeps installation reproducible without running package lifecycle scripts. npm 12 默认拒绝 Git 类型的包依赖,因此安装命令需要显式传入 `--allow-git=all`。仓库已经包含构建后的 CLI bundle`--ignore-scripts` 可以避免安装期间执行包生命周期脚本。
## Commands ## 常用命令
```powershell ```powershell
crafttable-mcp login crafttable-mcp login
@@ -24,18 +24,18 @@ crafttable-mcp call list_spaces '{}'
crafttable-mcp configure all crafttable-mcp configure all
``` ```
`configure` installs both the MCP entry and the bundled Skill. `unconfigure` removes both when the Skill is still managed by this CLI; a locally modified Skill is preserved unless `--force` is supplied. Existing different entries are never overwritten silently, and `--dry-run` previews both changes. `configure` 会同时安装 MCP 配置和随包提供的 Skill`unconfigure` 会在 Skill 仍由本 CLI 管理时将两者一并移除;如果用户修改过本地 Skill,则默认保留,只有显式传入 `--force` 才会删除。已有的不同配置不会被静默覆盖,`--dry-run` 可以预览 MCP 和 Skill 两部分的变更。
`login` uses Authorization Code with PKCE and saves OAuth tokens in the operating-system credential store. Tokens are isolated by MCP server URL and OAuth client ID. The CLI never falls back to a plaintext token file. `login` 使用 Authorization Code + PKCE 完成登录,并将 OAuth token 保存到操作系统凭据库。凭据按 MCP Server URL OAuth client ID 隔离,CLI 不会降级为明文 token 文件。
`serve` is a stdio MCP bridge for Codex, Claude Code, and OpenCode. It writes MCP JSON-RPC only to stdout. If no OAuth credential exists, it can use the legacy `CRAFTTABLE_MCP_TOKEN` environment variable and reports that path only on stderr. `serve` 是供 CodexClaude Code OpenCode 使用的 stdio MCP 桥。协议模式下,stdout 只输出 MCP JSON-RPC。如果本机没有 OAuth 凭据,CLI 可以兼容使用旧的 `CRAFTTABLE_MCP_TOKEN` 环境变量,并且只在 stderr 提示当前正在使用服务账号路径。
Connection defaults: 默认连接配置:
- URL: `https://crafttable.crash.work/mcp` - URL`https://crafttable.crash.work/mcp`
- OAuth client ID: `crafttable-mcp-cli` - OAuth client ID`crafttable-mcp-cli`
- callback: `http://127.0.0.1:48321/oauth/callback` - 回调地址:`http://127.0.0.1:48321/oauth/callback`
Override them with `--url`, `--client-id`, and `--callback-port`, or with `CRAFTTABLE_MCP_URL`, `CRAFTTABLE_MCP_OAUTH_CLIENT_ID`, and `CRAFTTABLE_MCP_OAUTH_CALLBACK_PORT`. 可以使用 `--url``--client-id``--callback-port` 覆盖默认值,也可以设置 `CRAFTTABLE_MCP_URL``CRAFTTABLE_MCP_OAUTH_CLIENT_ID``CRAFTTABLE_MCP_OAUTH_CALLBACK_PORT` 环境变量。
Only HTTPS remote URLs are accepted. Plain HTTP is limited to `localhost`, `127.0.0.1`, and `::1` development servers. 远程地址必须使用 HTTPS。只有 `localhost``127.0.0.1` `::1` 开发地址允许使用明文 HTTP。