cyrus-setup-linear
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCRITICAL: Never use , , or tools on or any file inside . Use only commands (, , etc.) to interact with env files — secrets must never be read into the conversation context. Never scrape, extract, or read secret values from web pages — guide the user to copy them manually.
ReadEditWrite~/.cyrus/.env~/.cyrus/Bashgrepprintf >>重要提示:切勿对或目录下的任何文件使用、或工具。仅使用命令(、等)操作环境变量文件——密钥绝对不能被读取到对话上下文内。切勿爬取、提取或读取网页上的密钥值——请引导用户手动复制。
~/.cyrus/.env~/.cyrus/ReadEditWriteBashgrepprintf >>Setup Linear
Linear配置
Creates a Linear OAuth application and configures credentials so Cyrus can receive webhooks and respond to issues.
创建Linear OAuth应用并配置凭证,让Cyrus可以接收webhook并响应issue。
Step 1: Check Existing Configuration
步骤1:检查现有配置
bash
grep -E '^LINEAR_CLIENT_ID=' ~/.cyrus/.env 2>/dev/nullIf is already set, check if OAuth is also complete:
LINEAR_CLIENT_IDbash
grep -q '"workspaces"' ~/.cyrus/config.json 2>/dev/null && echo "configured" || echo "not configured"If both are set, inform the user:
Linear is already configured. Skipping this step. To reconfigure, remove,LINEAR_CLIENT_ID, andLINEAR_CLIENT_SECRETfromLINEAR_WEBHOOK_SECRETand re-run.~/.cyrus/.env
Skip to completion.
bash
grep -E '^LINEAR_CLIENT_ID=' ~/.cyrus/.env 2>/dev/null如果已经设置,检查OAuth是否也已配置完成:
LINEAR_CLIENT_IDbash
grep -q '"workspaces"' ~/.cyrus/config.json 2>/dev/null && echo "configured" || echo "not configured"如果两个配置都已存在,告知用户:
Linear已完成配置,跳过此步骤。 如果需要重新配置,请从中删除~/.cyrus/.env、LINEAR_CLIENT_ID和LINEAR_CLIENT_SECRET后重新运行。LINEAR_WEBHOOK_SECRET
直接跳转到完成部分。
Step 2: Get CYRUS_BASE_URL
步骤2:获取CYRUS_BASE_URL
Read the base URL from the env file (set by ):
setup-endpointbash
grep '^CYRUS_BASE_URL=' ~/.cyrus/.env | cut -d= -f2-This is needed for the callback and webhook URLs.
从环境变量文件中读取基础URL(由设置):
setup-endpointbash
grep '^CYRUS_BASE_URL=' ~/.cyrus/.env | cut -d= -f2-回调地址和webhook地址需要用到这个参数。
Step 3: Create Linear OAuth App
步骤3:创建Linear OAuth应用
Determine which browser automation mode to use (see orchestrator rules):
- If MCP tools are available → use Path A-1 (claude-in-chrome)
claude-in-chrome - If is installed (
agent-browser) and a Chrome debug session is connected → use Path A-2 (agent-browser)which agent-browser - Otherwise → use Path B (manual)
确定要使用的浏览器自动化模式(参见编排规则):
- 如果有MCP工具可用 → 使用路径A-1(claude-in-chrome)
claude-in-chrome - 如果已安装(
agent-browser可找到)且已连接Chrome调试会话 → 使用路径A-2(agent-browser)which agent-browser - 其他情况 → 使用路径B(手动)
Path A-1: claude-in-chrome Automation
路径A-1:claude-in-chrome自动化
Use the tools to navigate and interact with the user's existing Chrome browser. The user is likely already signed in to Linear.
mcp__claude-in-chrome__*Navigate to the Linear API settings page and proceed with form filling and credential capture using the chrome MCP tools (navigate, click, fill, screenshot, javascript_tool, etc.). Follow the same form fields and credential scraping logic as Path A-2 below, but using MCP tools instead of CLI commands.
使用工具导航并操作用户现有的Chrome浏览器,用户大概率已经登录了Linear账号。
mcp__claude-in-chrome__*导航到Linear API设置页面,使用Chrome MCP工具(navigate、click、fill、screenshot、javascript_tool等)完成表单填写和凭证获取。遵循下方路径A-2相同的表单字段和凭证获取逻辑,仅将CLI命令替换为MCP工具即可。
Path A-2: agent-browser Automation
路径A-2:agent-browser自动化
If is connected to a Chrome debug session, automate the Linear app creation.
agent-browser如果已连接到Chrome调试会话,可自动化完成Linear应用创建。
agent-browser3a. Navigate to Linear API settings
3a. 导航到Linear API设置页面
bash
agent-browser navigate "https://linear.app/settings/api/applications/new"Wait for page to load. Take a screenshot to verify you're on the right page and logged in.
bash
agent-browser navigate "https://linear.app/settings/api/applications/new"等待页面加载,截图确认你处于正确页面且已登录。
3b. Fill the form
3b. 填写表单
bash
agent-browser fill "input[name='name']" "<AGENT_NAME>"
agent-browser fill "input[name='developerName']" "Self-hosted"
agent-browser fill "input[name='developerUrl']" "https://github.com/ceedaragents/cyrus"For the callback URL field:
bash
agent-browser fill "input[name='redirectUrls']" "<CYRUS_BASE_URL>/callback"Enable webhooks and fill webhook URL:
bash
agent-browser fill "input[name='webhookUrl']" "<CYRUS_BASE_URL>/webhook"Check the required event types:
- Agent session events (REQUIRED)
- Inbox notifications
- Permission changes
- Issues
Click "Create".
After creation, Linear redirects to the app settings page. Do NOT screenshot credential pages or attempt to scrape secrets. Proceed to Step 4.
bash
agent-browser fill "input[name='name']" "<AGENT_NAME>"
agent-browser fill "input[name='developerName']" "Self-hosted"
agent-browser fill "input[name='developerUrl']" "https://github.com/ceedaragents/cyrus"填写回调地址字段:
bash
agent-browser fill "input[name='redirectUrls']" "<CYRUS_BASE_URL>/callback"启用webhook并填写webhook地址:
bash
agent-browser fill "input[name='webhookUrl']" "<CYRUS_BASE_URL>/webhook"勾选所需的事件类型:
- Agent会话事件(必填)
- 收件箱通知
- 权限变更
- Issues
点击「Create」。
创建完成后,Linear会跳转到应用设置页面。不要对凭证页面截图,也不要尝试爬取密钥。 直接进入步骤4。
Path A-1: claude-in-chrome Automation
路径A-1:claude-in-chrome自动化
Use the tools to navigate and interact with the user's existing Chrome browser.
mcp__claude-in-chrome__*Navigate to the Linear API settings page () and fill in the form with the same fields as Path A-2 above. Click "Create". Do NOT screenshot credential pages or attempt to scrape secrets. Proceed to Step 4.
https://linear.app/settings/api/applications/new使用工具导航并操作用户现有的Chrome浏览器。
mcp__claude-in-chrome__*导航到Linear API设置页面(),按照上述路径A-2的字段要求填写表单,点击「Create」。不要对凭证页面截图,也不要尝试爬取密钥。 直接进入步骤4。
https://linear.app/settings/api/applications/newPath B: Manual Guided Setup
路径B:引导式手动设置
Guide the user through manual creation:
Create a Linear OAuth Application
- Go to your Linear workspace settings:
- Click your workspace name (top-left) → Settings
- Navigate to API in the left sidebar
- Scroll to OAuth Applications → Click Create new
- Fill in the form:
- Application name:
<AGENT_NAME>- Developer name: Your name or org
- Developer URL:
https://github.com/ceedaragents/cyrus- Redirect callback URLs:
<CYRUS_BASE_URL>/callback- Webhook URL:
<CYRUS_BASE_URL>/webhook- Webhook: ✓ enabled
- Event types: ✓ Agent session events, ✓ Inbox notifications, ✓ Permission changes, ✓ Issues
- Public: ✗ leave disabled (this is a private self-hosted app)
- Click Create
Proceed to Step 4.
引导用户手动完成创建:
创建Linear OAuth应用
- 进入你的Linear工作区设置:
- 点击左上角的工作区名称 → 设置
- 在左侧边栏导航到API
- 滚动到OAuth Applications → 点击Create new
- 填写表单:
- 应用名称:
<AGENT_NAME>- 开发者名称: 你的名称或组织名
- 开发者URL:
https://github.com/ceedaragents/cyrus- 重定向回调地址:
<CYRUS_BASE_URL>/callback- Webhook地址:
<CYRUS_BASE_URL>/webhook- Webhook: ✓ 启用
- 事件类型: ✓ Agent会话事件、✓ 收件箱通知、✓ 权限变更、✓ Issues
- 公开: ✗ 保持禁用(这是私有的自托管应用)
- 点击Create
进入步骤4。
Step 4: Collect Credentials
步骤4:收集凭证
The agent must NOT scrape, read, or extract secrets from the page. The user copies them manually into the env file.
Agent绝对不能爬取、读取或提取页面上的密钥。 由用户手动将密钥复制到环境变量文件中。
4a. Add credential placeholders
4a. 添加凭证占位符
bash
grep -q '^LINEAR_CLIENT_ID=' ~/.cyrus/.env || echo 'LINEAR_CLIENT_ID=' >> ~/.cyrus/.env
grep -q '^LINEAR_CLIENT_SECRET=' ~/.cyrus/.env || echo 'LINEAR_CLIENT_SECRET=' >> ~/.cyrus/.env
grep -q '^LINEAR_WEBHOOK_SECRET=' ~/.cyrus/.env || echo 'LINEAR_WEBHOOK_SECRET=' >> ~/.cyrus/.envbash
grep -q '^LINEAR_CLIENT_ID=' ~/.cyrus/.env || echo 'LINEAR_CLIENT_ID=' >> ~/.cyrus/.env
grep -q '^LINEAR_CLIENT_SECRET=' ~/.cyrus/.env || echo 'LINEAR_CLIENT_SECRET=' >> ~/.cyrus/.env
grep -q '^LINEAR_WEBHOOK_SECRET=' ~/.cyrus/.env || echo 'LINEAR_WEBHOOK_SECRET=' >> ~/.cyrus/.env4b. Open env file for editing
4b. 打开环境变量文件进行编辑
bash
undefinedbash
undefinedmacOS
macOS
code --new-window ~/.cyrus/.env 2>/dev/null || open -a TextEdit ~/.cyrus/.env
code --new-window ~/.cyrus/.env 2>/dev/null || open -a TextEdit ~/.cyrus/.env
Linux
Linux
code --new-window ~/.cyrus/.env 2>/dev/null || xdg-open ~/.cyrus/.env
undefinedcode --new-window ~/.cyrus/.env 2>/dev/null || xdg-open ~/.cyrus/.env
undefined4c. Guide the user
4c. 引导用户操作
Tell the user:
I've opened. You need to paste three values from your Linear app settings page:~/.cyrus/.env
- Client ID — copy it and paste after
LINEAR_CLIENT_ID=- Client Secret — click the copy button next to it (it's masked with dots), paste after
LINEAR_CLIENT_SECRET=- Webhook Signing Secret — click the copy button next to it, paste after
LINEAR_WEBHOOK_SECRET=Save and close the file when done.
告知用户:
我已经打开了文件,你需要从Linear应用设置页面复制三个值粘贴到对应位置:~/.cyrus/.env
- Client ID — 复制后粘贴到
后面LINEAR_CLIENT_ID=- Client Secret — 点击旁边的复制按钮(值会用圆点隐藏),粘贴到
后面LINEAR_CLIENT_SECRET=- Webhook Signing Secret — 点击旁边的复制按钮,粘贴到
后面LINEAR_WEBHOOK_SECRET=完成后保存并关闭文件。
4d. Verify
4d. 验证配置
After the user confirms they've saved:
bash
grep -c '^LINEAR_CLIENT_ID=.' ~/.cyrus/.env
grep -c '^LINEAR_CLIENT_SECRET=.' ~/.cyrus/.env
grep -c '^LINEAR_WEBHOOK_SECRET=.' ~/.cyrus/.envAll three must return 1 (the after ensures the value is not empty). If any are 0, ask the user to check the file.
.=用户确认保存完成后执行:
bash
grep -c '^LINEAR_CLIENT_ID=.' ~/.cyrus/.env
grep -c '^LINEAR_CLIENT_SECRET=.' ~/.cyrus/.env
grep -c '^LINEAR_WEBHOOK_SECRET=.' ~/.cyrus/.env三个命令都必须返回1(后面的确保值非空)。如果任意一个返回0,要求用户检查文件内容。
=.Step 5: Authorize with Linear
步骤5:授权Linear访问
Run the OAuth authorization flow:
bash
cyrus self-authThis will:
- Start a temporary OAuth callback server
- Open the browser to Linear's authorization page
- After the user clicks Authorize, save tokens to
~/.cyrus/config.json
Verify authorization succeeded:
bash
cat ~/.cyrus/config.json | grep -c '"workspaces"'If the count is 0, authorization failed. Ask the user to check their credentials and try again.
运行OAuth授权流程:
bash
cyrus self-auth这个命令会:
- 启动临时OAuth回调服务
- 打开浏览器跳转到Linear授权页面
- 用户点击Authorize后,将token保存到
~/.cyrus/config.json
验证授权是否成功:
bash
cat ~/.cyrus/config.json | grep -c '"workspaces"'如果计数为0,说明授权失败,要求用户检查凭证后重试。
Completion
完成
✓ Linear OAuth application created ✓ Credentials saved to✓ Workspace authorized via~/.cyrus/.envcyrus self-auth
✓ Linear OAuth应用已创建 ✓ 凭证已保存到✓ 工作区已通过~/.cyrus/.env完成授权cyrus self-auth