setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSetup — Prerequisites & MCP Configuration
安装设置 — 必备组件与MCP配置
Install CLI tools, authenticate to GitHub/GitLab, and configure the Jira integration for OpenCode.
mcp-atlassian安装CLI工具、完成GitHub/GitLab身份验证,并为OpenCode配置 Jira集成。
mcp-atlassianPrerequisites
前置要求
- Linux with package manager
apt - and
bashavailablecurl - Internet access (for apt packages and uv installer)
- 配备包管理器的Linux系统
apt - 可使用和
bashcurl - 可访问互联网(用于下载apt包和uv安装程序)
Trigger
触发条件
User says: "setup", "install prerequisites", "configure jira", or similar.
Important — interactive skill only. This skill requires user interaction (auth prompts, Jira credentials). It must not be called as a sub-step from autonomous skill pipelines (fast-meeting, issue-review, etc.) — doing so will stall the pipeline waiting for input that will never arrive.
用户说出:"setup"、"install prerequisites"、"configure jira"或类似内容。
重要提示 — 仅支持交互式skill:本skill需要用户交互(身份验证提示、Jira凭证输入)。禁止在自主skill流水线(fast-meeting、issue-review等)中作为子步骤调用,否则流水线会因永远等待输入而停滞。
Workflow
工作流程
Phase 1 — Install CLI tools
阶段1 — 安装CLI工具
Run the bundled script to install missing tools (idempotent — skips already-installed ones):
bash
bash "$(dirname "$0")/reference/setup.sh"The script installs (via if not already present):
apt- — GitHub CLI
gh - — GitLab CLI
glab - — JSON processor
jq - — via the official
uvxinstaller (uv)curl -LsSf https://astral.sh/uv/install.sh | sh
After running, inform the user of what was installed vs. already present.
运行配套脚本安装缺失的工具(幂等设计 — 跳过已安装的工具):
bash
bash "$(dirname "$0")/reference/setup.sh"脚本会通过安装以下未预装的工具:
apt- — GitHub CLI
gh - — GitLab CLI
glab - — JSON处理器
jq - — 通过官方
uvx安装程序安装(uv)curl -LsSf https://astral.sh/uv/install.sh | sh
运行完成后,告知用户哪些是新安装的、哪些是已存在的。
Phase 2 — CLI Authentication
阶段2 — CLI身份验证
Check and authenticate each CLI:
bash
gh auth status 2>&1- Show the full output to the user (current logged-in account, token scopes, etc.)
- If not authenticated → tell the user: "Run and follow the prompts."
gh auth login - Do NOT run automatically (requires interactive input).
gh auth login
bash
glab auth status 2>&1- Show the full output to the user (GitLab instance, current user, token validity, etc.)
- If not authenticated → tell the user: "Run and follow the prompts."
glab auth login - Do NOT run automatically.
glab auth login
检查每个CLI的身份验证状态并完成验证:
bash
gh auth status 2>&1- 向用户展示完整输出(当前登录账号、token权限范围等)
- 若未完成身份验证 → 告知用户:"运行并按照提示操作。"
gh auth login - 不要自动运行(需要交互式输入)。
gh auth login
bash
glab auth status 2>&1- 向用户展示完整输出(GitLab实例、当前用户、token有效性等)
- 若未完成身份验证 → 告知用户:"运行并按照提示操作。"
glab auth login - 不要自动运行。
glab auth login
Phase 3 — Configure mcp-atlassian for Jira
阶段3 — 为Jira配置mcp-atlassian
Step 3.1 — Check if uvx is available:
bash
uvx --version 2>&1 || ~/.local/bin/uvx --version 2>&1If not found, remind the user to restart their shell or source / after the Phase 1 script ran.
~/.bashrc~/.profileStep 3.2 — Read existing OpenCode config:
Use the Read tool to read .
~/.config/opencode/opencode.json- If the file does not exist, treat it as .
{} - If is already present → confirm to the user and skip the rest of Phase 3.
mcp.mcp-atlassian
Step 3.3 — Gather credentials (if not already configured):
Ask the user these two questions in a single message:
- Jira URL — default (Server/Data Center). Press Enter to accept.
https://jira.dedalus.com/ - Jira Personal Access Token (PAT) — steps to generate one:
- Log in to your Jira instance
- Go to Profile → Personal Access Tokens
- Click Create token, give it a name, set an expiry
- Copy the token and paste it here
For Jira Cloud users: use(your email) +JIRA_USERNAME(from https://id.atlassian.com/manage-profile/security/api-tokens) instead of a PAT.JIRA_API_TOKEN
Step 3.4 — Write the config:
Merge the block into , preserving any existing content. Use the Write tool to write the final JSON.
mcp-atlassian~/.config/opencode/opencode.jsonFor Server/Data Center (default):
json
{
"mcp": {
"mcp-atlassian": {
"type": "local",
"command": ["uvx", "mcp-atlassian"],
"environment": {
"JIRA_URL": "<jira-url>",
"JIRA_PERSONAL_TOKEN": "<pat>"
},
"enabled": true
}
}
}For Cloud (if user specifies):
json
{
"mcp": {
"mcp-atlassian": {
"type": "local",
"command": ["uvx", "mcp-atlassian"],
"environment": {
"JIRA_URL": "<jira-url>",
"JIRA_USERNAME": "<email>",
"JIRA_API_TOKEN": "<api-token>"
},
"enabled": true
}
}
}Step 3.5 — Secure the config file:
bash
chmod 600 ~/.config/opencode/opencode.json步骤3.1 — 检查uvx是否可用:
bash
uvx --version 2>&1 || ~/.local/bin/uvx --version 2>&1如果找不到uvx,提醒用户在阶段1的脚本运行完成后重启shell,或者执行source命令加载 / 。
~/.bashrc~/.profile步骤3.2 — 读取现有OpenCode配置:
使用读取工具读取。
~/.config/opencode/opencode.json- 如果文件不存在,视为空对象。
{} - 如果已存在 → 向用户确认并跳过阶段3的剩余步骤。
mcp.mcp-atlassian
步骤3.3 — 收集凭证(如果尚未配置):
在同一条消息中向用户询问以下两个问题:
- Jira URL — 默认值为(服务器/数据中心版本),按回车键即可使用默认值。
https://jira.dedalus.com/ - Jira个人访问令牌(PAT) — 生成步骤:
- 登录你的Jira实例
- 进入 个人资料 → 个人访问令牌
- 点击 创建令牌,命名令牌、设置过期时间
- 复制令牌并粘贴到此处
对于Jira Cloud用户:请使用(你的邮箱)+JIRA_USERNAME(可从https://id.atlassian.com/manage-profile/security/api-tokens 获取)替代PAT。JIRA_API_TOKEN
步骤3.4 — 写入配置:
将配置块合并到中,保留所有现有内容。使用写入工具写入最终的JSON。
mcp-atlassian~/.config/opencode/opencode.json服务器/数据中心版本(默认):
json
{
"mcp": {
"mcp-atlassian": {
"type": "local",
"command": ["uvx", "mcp-atlassian"],
"environment": {
"JIRA_URL": "<jira-url>",
"JIRA_PERSONAL_TOKEN": "<pat>"
},
"enabled": true
}
}
}Cloud版本(用户指定时使用):
json
{
"mcp": {
"mcp-atlassian": {
"type": "local",
"command": ["uvx", "mcp-atlassian"],
"environment": {
"JIRA_URL": "<jira-url>",
"JIRA_USERNAME": "<email>",
"JIRA_API_TOKEN": "<api-token>"
},
"enabled": true
}
}
}步骤3.5 — 配置文件权限加固:
bash
chmod 600 ~/.config/opencode/opencode.jsonPhase 4 — Summary
阶段4 — 配置总结
Print a clear summary table:
| Component | Status |
|---|---|
| gh | installed / already ok |
| glab | installed / already ok |
| jq | installed / already ok |
| uvx | installed / already ok |
| gh auth | authenticated / action needed |
| glab auth | authenticated / action needed |
| mcp-atlassian | configured / already ok / skipped |
End with: "Restart OpenCode to load the new MCP configuration."
打印清晰的总结表格:
| 组件 | 状态 |
|---|---|
| gh | 已安装 / 状态正常 |
| glab | 已安装 / 状态正常 |
| jq | 已安装 / 状态正常 |
| uvx | 已安装 / 状态正常 |
| gh auth | 已验证 / 需要操作 |
| glab auth | 已验证 / 需要操作 |
| mcp-atlassian | 已配置 / 状态正常 / 已跳过 |
结束提示:"重启OpenCode以加载新的MCP配置。"