About linear-api
linear-api uses linear-cli to run raw GraphQL queries and mutations against Linear. Variable input, JSON output, and defined exit codes suit developers calling the API directly.
Key features
- 01Run GraphQL queries
- 02Run GraphQL mutations
- 03Pass query variables
- 04Output JSON
- 05Provide defined exit codes
Use cases
- 01Query Linear user or team data
- 02Run GraphQL requests with variables
- 03Handle API results and errors in scripts
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ nesszer/ linear-cli --skill linear-apiAfter installing, type/linear-apiin Claude Code to confirm it loaded.
Details
From the project READMERaw GraphQL API
# 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
Comments
Markdown supported