Linear Integration
June 12, 2026 · View on GitHub
Setup
1. Get API Key
- Go to Linear → Settings → API
- Click "Create new API key"
- Give it a descriptive name (e.g., "Neovim Comment Tasks")
- Copy the API key
2. Environment Configuration
export LINEAR_API_KEY="your_linear_api_key_here"
3. Plugin Configuration
require("comment-tasks").setup({
providers = {
linear = {
enabled = true,
api_key_env = "LINEAR_API_KEY",
team_id = "your_team_id", -- Required: Linear team ID
-- Custom status configuration (match your Linear workflow)
statuses = {
new = "Backlog", -- Special: used for issue creation
completed = "Done", -- Special: used for completion
in_progress = "In Progress", -- Custom status
review = "In Review", -- Custom status
blocked = "Blocked", -- Custom status
cancelled = "Canceled", -- Custom status
},
-- Optional: Specific project
project_id = "project_id",
-- Optional: Default assignee ID
assignee_id = "user_id",
-- Optional: Default priority (0=none, 1=urgent, 2=high, 3=medium, 4=low)
priority = 0,
}
}
})
4. Finding Your Team ID
Method 1: From Linear URL
https://linear.app/[team-name]/team/[team_id]
↳ This is your team_id
Method 2: Using API
curl -H "Authorization: YOUR_API_KEY" \\
"https://api.linear.app/graphql" \\
-d '{"query": "{ teams { nodes { id name } } }"}'
Usage
Commands
All commands work with your configured statuses:
:LinearTask new " Create issue with 'Backlog' status
:LinearTask completed " Update issue to 'Done' status
:LinearTask in_progress " Update issue to 'In Progress' status
:LinearTask review " Update issue to 'In Review' status
:LinearTask blocked " Update issue to 'Blocked' status
:LinearTask cancelled " Update issue to 'Canceled' status
:LinearTask addfile " Add current file reference to issue
Example Workflow
-
Create an issue:
// TODO: Optimize database query performance // This query is taking too long and needs indexingPlace cursor on comment →
:LinearTask new// TODO: Optimize database query performance // This query is taking too long and needs indexing // https://linear.app/company/issue/PRJ-123 -
Update status as you progress:
:LinearTask in_progress " When you start working :LinearTask review " When ready for review :LinearTask completed " When finished -
Add file references:
:LinearTask addfile " Adds current file to issue description
Configuration Options
Status Mapping
Configure statuses to match your Linear team workflow:
statuses = {
-- Required statuses
new = "Triage", -- Status for new issues
completed = "Done", -- Status for completed issues
-- Optional custom statuses (must exist in your Linear team)
planning = "Planning",
development = "In Progress",
testing = "Testing",
deployment = "Ready to Deploy",
blocked = "Blocked",
review = "In Review",
cancelled = "Canceled",
}
Advanced Configuration
linear = {
enabled = true,
api_key_env = "LINEAR_API_KEY",
team_id = "team_abc123",
statuses = {
new = "Backlog",
completed = "Done",
-- Add your custom statuses here.
-- Status values are resolved by name; use a # prefix for a
-- direct Linear state ID, e.g. blocked = "#state_12345".
},
-- Optional: Default issue configuration
assignee_id = "user_id_here",
priority = 2, -- 0=No priority, 1=Urgent, 2=High, 3=Medium, 4=Low
project_id = "project_id", -- Optional: specific project
}
Troubleshooting
"Team not found" or "Invalid team_id"
-
Verify team_id:
curl -H "Authorization: YOUR_API_KEY" \\ "https://api.linear.app/graphql" \\ -d '{"query": "{ teams { nodes { id name } } }"}' -
Check permissions: Ensure API key has access to the team
-
Team membership: Verify you're a member of the team
"State not found" Error
-
Check available states:
curl -H "Authorization: YOUR_API_KEY" \\ "https://api.linear.app/graphql" \\ -d '{"query": "{ team(id: \"TEAM_ID\") { states { nodes { id name } } } }"}' -
Case sensitivity: Status names must match Linear exactly (case-sensitive)
-
Team-specific states: Each team has its own workflow states
"Authentication Failed"
- API key validity: Check if API key is still valid in Linear settings
- Permissions: Verify API key has necessary permissions
- Rate limits: Linear has GraphQL rate limiting
Issues Not Updating
- Issue permissions: Verify you can edit issues in the team
- Workflow restrictions: Check if team has workflow restrictions
- State transitions: Some workflows may restrict certain state changes
API Reference
Linear uses GraphQL API. The plugin makes requests to:
mutation IssueCreate- Create issuesmutation IssueUpdate- Update issue status and detailsquery Issue- Retrieve issue informationquery Team- Get team details and workflow states
Best Practices
- Team organization: Use dedicated teams for different projects
- Status mapping: Align plugin statuses with your team's workflow
- Labels: Use consistent labeling for better organization
- File references: Use
:addfileto maintain code traceability - Priorities: Set appropriate priorities for better triage
Team Workflows
Multi-Team Setup
To target a different Linear team per repository, use a .comment-tasks.json
file at the project root — team_id and project_id are overridable there
(see the
Configuration Reference):
{
"providers": {
"linear": { "team_id": "frontend_team_id" }
}
}