Linear
Interact with Linear directly via the Linear GraphQL API (api.linear.app/graphql).
Setup (one-time)
- 1. Go to Linear → Settings → Account → Security & Access → API keys
- Create a new key
- Set environment variable:
CODEBLOCK0
Usage
List your teams
CODEBLOCK1
List issues assigned to you
CODEBLOCK2
List issues for a team
CODEBLOCK3
Get a specific issue
CODEBLOCK4
Search issues
CODEBLOCK5
Create an issue
CODEBLOCK6
Update an issue
CODEBLOCK7
List projects
CODEBLOCK8
List cycles (sprints)
CODEBLOCK9
List workflow states for a team
CODEBLOCK10
Priority levels
- - 0 = No priority
- 1 = Urgent
- 2 = High
- 3 = Normal
- 4 = Low
Linear
通过 Linear GraphQL API (api.linear.app/graphql) 直接与 Linear 交互。
设置(一次性操作)
- 1. 进入 Linear → 设置 → 账户 → 安全与访问 → API 密钥
- 创建一个新密钥
- 设置环境变量:
LINEARAPIKEY=linapi...
使用方法
列出你的团队
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py teams
列出分配给你的问题
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py my-issues
python3 /mnt/skills/user/linear/scripts/linear_query.py my-issues --state 进行中
列出某个团队的问题
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py issues --team 工程部
python3 /mnt/skills/user/linear/scripts/linear_query.py issues --team 工程部 --state 待办 --limit 20
获取特定问题
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py issue ENG-123
搜索问题
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py search 认证错误
创建问题
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py create --team 工程部 --title 修复登录错误 --description 用户在 Safari 浏览器上无法登录
python3 /mnt/skills/user/linear/scripts/linear_query.py create --team 工程部 --title 添加深色模式 --priority 2
更新问题
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py update ENG-123 --state 已完成
python3 /mnt/skills/user/linear/scripts/linear_query.py update ENG-123 --priority 1 --title 新标题
列出项目
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py projects
python3 /mnt/skills/user/linear/scripts/linear_query.py projects --team 工程部
列出周期(冲刺)
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py cycles --team 工程部
列出某个团队的工作流状态
bash
python3 /mnt/skills/user/linear/scripts/linear_query.py states --team 工程部
优先级级别
- - 0 = 无优先级
- 1 = 紧急
- 2 = 高
- 3 = 普通
- 4 = 低