linear-graphql-skill
Original:🇺🇸 English
Translated
1 scripts
Operate Linear workspace issues, projects, and teams through Linear GraphQL API using UXC. Use when tasks require querying or creating issues, managing projects, or interacting with Linear workflow. Supports both Personal API Key and OAuth authentication.
19installs
Sourceholon-run/uxc
Added on
NPX Install
npx skill4agent add holon-run/uxc linear-graphql-skillTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Linear GraphQL Skill
Use this skill to run Linear GraphQL API operations through .
uxcReuse the skill guidance for discovery, schema inspection, auth lifecycle, and error recovery.
uxcPrerequisites
- is installed and available in
uxc.PATH - Network access to .
https://api.linear.app/graphql - Linear API key or OAuth credentials available.
Authentication
Linear supports two authentication methods:
Option 1: Personal API Key (Recommended for development)
-
Get your API key from Linear: https://linear.app/settings/api
-
Set credential with custom Authorization header:bash
uxc auth credential set linear-graphql \ --auth-type api_key \ --header "Authorization:{{secret}}" \ --secret "lin_api_XXX"Or use environment variable:bashexport LINEAR_API_KEY="lin_api_XXX" uxc auth credential set linear-graphql \ --auth-type api_key \ --header "Authorization:{{secret}}" \ --secret-env LINEAR_API_KEY -
Bind endpoint:bash
uxc auth binding add \ --id linear-graphql \ --host api.linear.app \ --path-prefix /graphql \ --scheme https \ --credential linear-graphql \ --priority 100
Important (Personal API Key only): Linear API keys require format (no prefix). The configuration above is required for API key auth. For OAuth access tokens, use standard semantics (handled by the OAuth credential flow in ).
Authorization: lin_api_XXXBearer --header "Authorization:{{secret}}"Authorization: Bearer <token>uxcCredential/binding IDs in this skill use by convention; IDs are local aliases and can be changed if needed.
linear-graphqlOption 2: OAuth 2.0 (For production/user-delegated access)
-
Create an OAuth app in Linear: https://linear.app/settings/api
-
Start OAuth login:bash
uxc auth oauth start linear-graphql \ --endpoint https://api.linear.app/graphql \ --redirect-uri http://127.0.0.1:8788/callback \ --scope read \ --scope writeAfter approval, complete it with:bashuxc auth oauth complete linear-graphql \ --session-id <session_id> \ --authorization-response 'http://127.0.0.1:8788/callback?code=...&state=...' -
Bind endpoint:bash
uxc auth binding add \ --id linear-graphql \ --host api.linear.app \ --path-prefix /graphql \ --scheme https \ --credential linear-graphql \ --priority 100
Core Workflow
-
Use fixed link command by default:
command -v linear-graphql-cli- If the command exists, confirm it is the expected for this skill before using it.
uxc link - If a command conflict is detected and cannot be safely reused, stop and ask skill maintainers for guidance instead of dynamically renaming the command.
- If missing, create it:
uxc link linear-graphql-cli https://api.linear.app/graphql linear-graphql-cli -h
-
Discover operations:
linear-graphql-cli -h- Returns hundreds of GraphQL operations
-
Inspect specific operation:
linear-graphql-cli query/issues -hlinear-graphql-cli mutation/issueCreate -h
-
Execute queries:bash
# Query issues (simple) linear-graphql-cli query/issues '{"first":10}' # Query issues with explicit selection set for useful fields linear-graphql-cli query/issues '{"first":10,"_select":"nodes { identifier title url state { name } assignee { name } }"}' # Query teams linear-graphql-cli query/teams '{"first":10}' # Create issue (requires write scope) linear-graphql-cli mutation/issueCreate '{ "input": { "teamId": "TEAM_ID", "title": "New Issue Title", "description": "Issue description" } }'
Available Operations
Queries
- - List and filter issues
query/issues - - Get single issue
query/issue - - List teams
query/teams - - Get single team
query/team - - List projects
query/projects - - List workflow states
query/workflowStates
Mutations
- - Create new issue
mutation/issueCreate - - Update issue
mutation/issueUpdate - - Archive issue
mutation/issueArchive - - Add comment
mutation/commentCreate
Usage Examples
List recent issues
bash
linear-graphql-cli query/issues '{"first":20,"_select":"nodes { identifier title url state { name } assignee { name } }"}'Get issue by ID
bash
linear-graphql-cli query/issue id=ISSUE_IDList teams
bash
linear-graphql-cli query/teamsCreate issue
bash
linear-graphql-cli mutation/issueCreate '{"input":{"teamId":"YOUR_TEAM_ID","title":"Fix bug"}}'Troubleshooting
Authentication Errors
Error: "Bearer token" prefix rejected
- Linear API does not accept
Authorization: Bearer lin_api_XXX - Ensure credential uses
--auth-type api_key --header "Authorization:{{secret}}" - Do not use
--auth-type bearer
Error: "Credential not found"
- Check credential exists:
uxc auth credential list - Verify binding:
uxc auth binding list - Create binding if missing (see Authentication section)
OAuth login spans multiple agent turns
- Prefer and
uxc auth oauth start ...uxc auth oauth complete ... - Use only when one process can wait for the pasted callback URL
uxc auth oauth login ... --flow authorization_code
Error: "No binding matched"
- Check binding exists:
uxc auth binding match api.linear.app/graphql - If missing, create binding with (see Authentication section)
uxc auth binding add
For detailed authentication troubleshooting, see skill's .
uxcreferences/auth-configuration.mdCommon Issues
Daemon issues after credential changes
- Restart daemon:
uxc daemon restart - Check status:
uxc daemon status
Environment variable not found
- Ensure variable is exported in daemon's environment
- Or use for literal values (less secure)
--secret - Or use for 1Password (most secure)
--secret-op
Guardrails
- Keep automation on JSON output envelope; do not use .
--text - Parse stable fields first: ,
ok,kind,data.error - Prefer positional JSON for non-string and typed arguments (for example: and
linear-graphql-cli query/issues '{"first":10}').linear-graphql-cli mutation/issueCreate '{"input":{"teamId":"TEAM_ID","title":"Test"}}' - Use reserved GraphQL argument (string) when you need explicit return fields, e.g.
_select.{"_select":"nodes { identifier title }"} - Use as the default command path.
linear-graphql-cli - is equivalent to
linear-graphql-cli <operation> ....uxc https://api.linear.app/graphql <operation> ... - Prefer read operations first (query/), then write operations (mutation/).
- For write operations, always confirm user intent before execution.
- If auth fails, check credential with .
uxc auth credential info linear-graphql
References
- Linear API Documentation: https://developers.linear.app
- GraphQL Schema: https://studio.apollographql.com/public/Linear-API
- Invocation patterns:
references/usage-patterns.md