tb-init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TeamBition 工作区初始化

TeamBition Workspace Initialization

执行步骤

Execution Steps

步骤 1:检查现有配置

Step 1: Check Existing Configuration

读取当前目录是否已有
.teambition.md
  • 已存在:展示当前配置摘要,让用户明确选择"重新配置 / 仅更新部分 / 取消"
  • 不存在:从头开始配置
规则:
  • 如果宿主支持交互选择控件,则使用交互选择
  • 如果宿主不支持交互选择控件,则直接在对话中逐项询问用户
  • 不要自动从
    .mcp.json
    、其他配置文件或已有 MCP 连接中偷用凭证,除非用户明确要求“导入现有配置”
  • 不要自动替用户选择常用项目;必须先展示候选项,再等待用户确认
Read whether there is already
.teambition.md
in the current directory:
  • Exists: Display the summary of current configuration, let the user explicitly choose "Reconfigure / Update only part / Cancel"
  • Does not exist: Configure from scratch
Rules:
  • If the host supports interactive selection controls, use interactive selection
  • If the host does not support interactive selection controls, directly ask the user item by item in the conversation
  • Do not automatically steal credentials from
    .mcp.json
    , other configuration files or existing MCP connections unless the user explicitly requests "import existing configuration"
  • Do not automatically select common projects for users; you must first display the candidates, then wait for user confirmation

步骤 2:配置凭证

Step 2: Configure Credentials

逐项收集(如果已有则展示当前值供确认):
  1. App ID — 从 https://open.teambition.com → 应用管理获取
  2. App Secret — 同上
  3. Operator ID — 操作者用户 ID
  4. Organization ID — 组织 ID
Collect item by item (if already exists, display the current value for confirmation):
  1. App ID — Obtained from https://open.teambition.com → Application Management
  2. App Secret — Same as above
  3. Operator ID — Operator user ID
  4. Organization ID — Organization ID

步骤 3:配置参数

Step 3: Configure Parameters

收集:
  1. 最大常用项目数 — 默认 5,范围 1-10
  2. 最近任务记录数 — 默认 10,范围 5-20
Collect:
  1. Maximum number of common projects — Default 5, range 1-10
  2. Number of recent task records — Default 10, range 5-20

步骤 4:选择常用项目

Step 4: Select Common Projects

先将凭证写入
.teambition.md
(至少包含凭证表格),然后执行:
bash
node scripts/tb-api.mjs get-projects
解析 JSON 结果,只展示 Active 项目,先展示候选列表,再等待用户明确选择。
First write the credentials to
.teambition.md
(contains at least the credentials table), then execute:
bash
node scripts/tb-api.mjs get-projects
Parse the JSON result, only display Active projects, first show the candidate list, then wait for the user's explicit selection.

步骤 5:生成 .teambition.md

Step 5: Generate .teambition.md

写入完整配置文件,格式:凭证表格 + 配置表格 + 常用项目表格 + 空的最近任务表格。
Write the complete configuration file, format: Credentials table + Configuration table + Common projects table + Empty recent tasks table.

步骤 6:确认完成

Step 6: Confirm Completion

展示配置摘要。
Display configuration summary.