Manage issues, projects, and workflows in Linear. View issues, create new ones, search documentation, and track project progress.
This skill provides access to Linear via the GraphQL API.
Create a Personal API Key:
Set as environment variable:
export LINEAR_API_KEY="lin_api_..."
Use this skill when the user:
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.
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'
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'
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 } } } }"}'
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 } } } }"}'
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'
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'
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'
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'
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 } }"}'
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 } } } } } }"}'
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
}
}
}'
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"
}
}
}'
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"
}
}
}'
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'
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'
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 } } } } }"}'
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 } } } }"}'
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 (=) |
0 - No priority1 - Urgent2 - High3 - Medium4 - Lowbacklog - Not startedunstarted - To dostarted - In progresscompleted - Donecanceled - CanceledissueSearch to find issues by identifier