linear
Manage issues, projects, and workflows in Linear. View issues, create new ones, search documentation, and track project progress.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Linear Issue Tracking
This skill provides access to Linear via the GraphQL API.
Setup Required
Create a Personal API Key:
- Go to Linear Settings → Account → Security & Access
- Or visit: https://linear.app/settings/account/security
- Under "Personal API keys", click "Create key"
- Select permissions (Read, Write, etc.) and teams
- Copy the key
Set as environment variable:
export LINEAR_API_KEY="lin_api_..."
When to Use
Use this skill when the user:
- Asks about Linear issues, tickets, or bugs
- Wants to create a new issue or feature request
- Needs to check project or cycle progress
- Asks about team workload or assignments
- Mentions "Linear" or issue tracking
API Endpoint
Linear uses GraphQL at: https://api.linear.app/graphql
All requests need:
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json"
Note: No "Bearer" prefix for Linear API keys.
Common Queries
List My Issues
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { assignedIssues(first: 20) { nodes { identifier title state { name } priority } } } }"}' | jq '.data.viewer.assignedIssues.nodes'
List All Issues
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(first: 50) { nodes { identifier title state { name } assignee { name } priority } } }"}' | jq '.data.issues.nodes'
Get Issue by ID
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ issue(id: \"ISSUE_UUID\") { identifier title description state { name } assignee { name } priority labels { nodes { name } } } }"}'
Search Issues by Identifier (e.g., ENG-123)
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ issueSearch(query: \"ENG-123\", first: 5) { nodes { identifier title state { name } } } }"}'
List Teams
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ teams { nodes { id name key } } }"}' | jq '.data.teams.nodes'
List Projects
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ projects(first: 20) { nodes { id name state progress } } }"}' | jq '.data.projects.nodes'
List Workflow States
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ workflowStates { nodes { id name type } } }"}' | jq '.data.workflowStates.nodes'
List Labels
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ issueLabels { nodes { id name color } } }"}' | jq '.data.issueLabels.nodes'
Get Current User Info
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { id name email } }"}'
List Current Cycle Issues
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ cycles(filter: { isActive: { eq: true } }, first: 1) { nodes { name issues { nodes { identifier title state { name } } } } } }"}'
Mutations (Creating/Updating)
Create Issue
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation CreateIssue($input: IssueCreateInput!) { issueCreate(input: $input) { success issue { identifier title url } } }",
"variables": {
"input": {
"teamId": "TEAM_UUID",
"title": "Issue title",
"description": "Issue description",
"priority": 2
}
}
}'
Add Comment to Issue
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation AddComment($input: CommentCreateInput!) { commentCreate(input: $input) { success comment { id body } } }",
"variables": {
"input": {
"issueId": "ISSUE_UUID",
"body": "Comment text here"
}
}
}'
Update Issue State
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation UpdateIssue($id: String!, $input: IssueUpdateInput!) { issueUpdate(id: $id, input: $input) { success issue { identifier state { name } } } }",
"variables": {
"id": "ISSUE_UUID",
"input": {
"stateId": "STATE_UUID"
}
}
}'
Common Workflows
Get My Open Issues
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { assignedIssues(filter: { state: { type: { nin: [\"completed\", \"canceled\"] } } }, first: 50) { nodes { identifier title state { name } priority dueDate } } } }"}' | jq '.data.viewer.assignedIssues.nodes'
Get High Priority Issues
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(filter: { priority: { lte: 2 } }, first: 20) { nodes { identifier title priority state { name } assignee { name } } } }"}' | jq '.data.issues.nodes'
Get Issues in a Project
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ project(id: \"PROJECT_UUID\") { name issues { nodes { identifier title state { name } } } } }"}'
Search Issues
curl -s -X POST "https://api.linear.app/graphql" \
-H "Authorization: $(printenv LINEAR_API_KEY)" \
-H "Content-Type: application/json" \
-d '{"query": "{ issueSearch(query: \"search term\", first: 10) { nodes { identifier title description state { name } } } }"}'
Filter Syntax
Linear supports filtering with comparison operators:
| Operator | Example | Description |
|---|---|---|
eq |
{ state: { name: { eq: "In Progress" } } } |
Equals |
neq |
{ priority: { neq: 0 } } |
Not equals |
in |
{ state: { type: { in: ["started"] } } } |
In list |
nin |
{ state: { type: { nin: ["completed"] } } } |
Not in list |
lt, lte |
{ priority: { lte: 2 } } |
Less than (=) |
gt, gte |
{ priority: { gte: 1 } } |
Greater than (=) |
Priority Values
-
0- No priority -
1- Urgent -
2- High -
3- Medium -
4- Low
State Types
-
backlog- Not started -
unstarted- To do -
started- In progress -
completed- Done -
canceled- Canceled
Notes
- Linear uses UUIDs for IDs (not the ENG-123 identifiers)
- Use
issueSearchto find issues by identifier - GraphQL requires exact field selection - add fields you need
- API key permissions control what you can access
- Get your API key at: https://linear.app/settings/account/security
Sources
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!