| name | linear-api |
| description | Execute raw GraphQL queries and mutations against the Linear API. Use for advanced operations not covered by other commands. |
| allowed-tools | Bash |
Raw GraphQL API
linear-cli api query '{ viewer { id name email } }'
linear-cli api query -v teamId=abc '{ team(id: $teamId) { name } }'
linear-cli api mutate -v title="Bug" '
mutation($title: String!) {
issueCreate(input: { title: $title, teamId: "..." }) {
issue { id identifier }
}
}
'
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