# Linear API

> Execute raw GraphQL queries and mutations against the Linear API. Use for advanced operations not covered by other commands.

- Skill: `finesssee/linear-api` (Agent Skill)
- Install (CLI): `npx skillmds@latest add finesssee/linear-api`
- Raw SKILL.md: https://api.skillmd.com/api/skills/finesssee/linear-api/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: Finesssee (https://skillmd.com/u/finesssee)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/finesssee/linear-api

---


# Raw GraphQL API

```bash
# Run a query
linear-cli api query '{ viewer { id name email } }'

# Query with variables
linear-cli api query -v teamId=abc '{ team(id: $teamId) { name } }'

# Run a mutation
linear-cli api mutate -v title="Bug" '
  mutation($title: String!) {
    issueCreate(input: { title: $title, teamId: "..." }) {
      issue { id identifier }
    }
  }
'

# Pipe query from file
cat query.graphql | linear-cli api query -
```

## Flags

| Flag | Purpose |
|------|---------|
| `-v key=val` | GraphQL variables |
| `--output json` | JSON output |
| `--compact` | Compact JSON |

## Exit Codes

`0`=Success, `1`=Error, `2`=Not found, `3`=Auth error

