---
name: linear
description: Access Linear issue tracker - search, view, create, update issues, list teams/projects, and manage comments. Use when the user asks about Linear issues, tasks, tickets, or project management in Linear.
---

# Linear

Manage Linear issues, projects, and teams via the Linear SDK.

## Setup

Run once before first use:

```bash
cd {baseDir} && npm install
```

Requires a `LINEAR_API_KEY` environment variable. Generate one at: https://linear.app/settings/api (Personal API keys).

Set it in your shell profile or pi settings:

```bash
export LINEAR_API_KEY=lin_api_...
```

## Current User

```bash
node {baseDir}/linear-me.js                # Show authenticated user
node {baseDir}/linear-me.js --issues        # Show user + their active issues
```

## Search Issues

```bash
node {baseDir}/linear-search.js "query"                     # Text search
node {baseDir}/linear-search.js "query" -n 20               # More results
node {baseDir}/linear-search.js "query" --team ENG           # Filter by team
node {baseDir}/linear-search.js "query" --state "In Progress"  # Filter by state
```

## List Issues (with filters)

```bash
node {baseDir}/linear-issues.js                              # All recent issues
node {baseDir}/linear-issues.js --team ENG                   # By team
node {baseDir}/linear-issues.js --state "In Progress"        # By state
node {baseDir}/linear-issues.js --assignee me                # My issues
node {baseDir}/linear-issues.js --assignee "John"            # By assignee name
node {baseDir}/linear-issues.js --label "Bug"                # By label
node {baseDir}/linear-issues.js --project "Q1 Goals"         # By project
node {baseDir}/linear-issues.js --team ENG --state Todo -n 50  # Combined filters
```

## View Issue Details

```bash
node {baseDir}/linear-issue.js ATT-1234                  # Full issue details
node {baseDir}/linear-issue.js ATT-1234 --comments       # Include comments
```

## Create Issue

```bash
node {baseDir}/linear-create.js --team ENG --title "Fix login bug"
node {baseDir}/linear-create.js --team ENG --title "New feature" --description "Details here" --state Todo --priority 2 --assignee me --label "Feature"
node {baseDir}/linear-create.js --team ENG --title "Sub-task" --parent ATT-100
```

Priority values: 0=None, 1=Urgent, 2=High, 3=Medium, 4=Low

## Update Issue

```bash
node {baseDir}/linear-update.js ATT-1234 --state "In Progress"
node {baseDir}/linear-update.js ATT-1234 --assignee me --priority 2
node {baseDir}/linear-update.js ATT-1234 --title "New title" --description "Updated desc"
```

## Add Comment

```bash
node {baseDir}/linear-comment.js ATT-1234 "This is done in PR #567"
```

## List Teams

```bash
node {baseDir}/linear-teams.js
```

## List Projects

```bash
node {baseDir}/linear-projects.js                    # All projects
node {baseDir}/linear-projects.js --team ENG          # By team
```

## Tips

- Use `--assignee me` to filter by the authenticated user
- Issue identifiers follow the pattern `TEAM-NUMBER` (e.g. `ATT-1234`, `ENG-567`)
- Descriptions support markdown formatting
- State names are case-insensitive (e.g. "todo", "Todo", "TODO" all work)
- When creating issues, the team key is required; use `linear-teams.js` to find available teams
