返回顶部
l

linear-graphql-skill线性GraphQL技能

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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
262
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

linear-graphql-skill

Linear GraphQL 技能

使用此技能通过 uxc 运行 Linear GraphQL API 操作。

复用 uxc 技能指南进行发现、模式检查、认证生命周期和错误恢复。

前提条件

  • - uxc 已安装并位于 PATH 中。
  • 可访问 https://api.linear.app/graphql 网络。
  • 拥有 Linear API 密钥或 OAuth 凭据。

认证

Linear 支持两种认证方式:

方式一:个人 API 密钥(推荐用于开发)

  1. 1. 从 Linear 获取 API 密钥:https://linear.app/settings/api
  1. 2. 使用自定义 Authorization 标头设置凭据:
bash uxc auth credential set linear-graphql \ --auth-type api_key \ --header Authorization:{{secret}} \ --secret linapiXXX

或使用环境变量:
bash
export LINEARAPIKEY=linapiXXX
uxc auth credential set linear-graphql \
--auth-type api_key \
--header Authorization:{{secret}} \
--secret-env LINEARAPIKEY

  1. 3. 绑定端点:
bash uxc auth binding add \ --id linear-graphql \ --host api.linear.app \ --path-prefix /graphql \ --scheme https \ --credential linear-graphql \ --priority 100

重要提示(仅限个人 API 密钥): Linear API 密钥需要 Authorization: linapiXXX 格式(无 Bearer 前缀)。上述 --header Authorization:{{secret}} 配置是 API 密钥认证所必需的。对于 OAuth 访问令牌,请使用标准的 Authorization: Bearer 语义(由 uxc 中的 OAuth 凭据流程处理)。

此技能中的凭据/绑定 ID 按惯例使用 linear-graphql;ID 是本地别名,可根据需要更改。

方式二:OAuth 2.0(用于生产环境/用户委托访问)

  1. 1. 在 Linear 中创建 OAuth 应用:https://linear.app/settings/api
  1. 2. 启动 OAuth 登录:
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 write

批准后,使用以下命令完成:
bash
uxc auth oauth complete linear-graphql \
--session-id \
--authorization-response http://127.0.0.1:8788/callback?code=...&state=...

  1. 3. 绑定端点:
bash uxc auth binding add \ --id linear-graphql \ --host api.linear.app \ --path-prefix /graphql \ --scheme https \ --credential linear-graphql \ --priority 100

核心工作流程

  1. 1. 默认使用固定链接命令:
- command -v linear-graphql-cli - 如果命令存在,在使用前确认它是此技能预期的 uxc link。 - 如果检测到命令冲突且无法安全复用,请停止并向技能维护者寻求指导,而不是动态重命名命令。 - 如果缺失,创建它:uxc link linear-graphql-cli https://api.linear.app/graphql - linear-graphql-cli -h
  1. 2. 发现操作:
- linear-graphql-cli -h - 返回数百个 GraphQL 操作
  1. 3. 检查特定操作:
- linear-graphql-cli query/issues -h - linear-graphql-cli mutation/issueCreate -h
  1. 4. 执行查询:
bash # 查询问题(简单) linear-graphql-cli query/issues {first:10}

# 使用显式选择集查询有用字段的问题
linear-graphql-cli query/issues {first:10,_select:nodes { identifier title url state { name } assignee { name } }}

# 查询团队
linear-graphql-cli query/teams {first:10}

# 创建问题(需要写入权限)
linear-graphql-cli mutation/issueCreate {
input: {
teamId: TEAM_ID,
title: 新问题标题,
description: 问题描述
}
}

可用操作

查询

  • - query/issues - 列出和筛选问题
  • query/issue - 获取单个问题
  • query/teams - 列出团队
  • query/team - 获取单个团队
  • query/projects - 列出项目
  • query/workflowStates - 列出工作流状态

变更

  • - mutation/issueCreate - 创建新问题
  • mutation/issueUpdate - 更新问题
  • mutation/issueArchive - 归档问题
  • mutation/commentCreate - 添加评论

使用示例

列出最近问题

bash linear-graphql-cli query/issues {first:20,_select:nodes { identifier title url state { name } assignee { name } }}

按 ID 获取问题

bash linear-graphql-cli query/issue id=ISSUE_ID

列出团队

bash linear-graphql-cli query/teams

创建问题

bash linear-graphql-cli mutation/issueCreate {input:{teamId:YOURTEAMID,title:修复错误}}

故障排除

认证错误

错误:Bearer token 前缀被拒绝

  • - Linear API 不接受 Authorization: Bearer linapiXXX
  • 确保凭据使用 --auth-type api_key --header Authorization:{{secret}}
  • 不要使用 --auth-type bearer

错误:凭据未找到

  • - 检查凭据是否存在:uxc auth credential list
  • 验证绑定:uxc auth binding list
  • 如果缺少绑定,请创建(参见认证部分)

OAuth 登录跨越多个代理轮次

  • - 优先使用 uxc auth oauth start ... 和 uxc auth oauth complete ...
  • 仅当单个进程可以等待粘贴的回调 URL 时,才使用 uxc auth oauth login ... --flow authorization_code

错误:未匹配到绑定

  • - 检查绑定是否存在:uxc auth binding match api.linear.app/graphql
  • 如果缺少,使用 uxc auth binding add 创建绑定(参见认证部分)

有关详细的认证故障排除,请参阅 uxc 技能的 references/auth-configuration.md。

常见问题

凭据更改后的守护进程问题

  • - 重启守护进程:uxc daemon restart
  • 检查状态:uxc daemon status

未找到环境变量

  • - 确保变量已在守护进程的环境中导出
  • 或使用 --secret 传递字面值(安全性较低)
  • 或使用 --secret-op 从 1Password 获取(最安全)

安全护栏

  • - 保持自动化使用 JSON 输出格式;不要使用 --text。
  • 首先解析稳定字段:ok、kind、data、error。
  • 对于非字符串和类型化参数,优先使用位置 JSON(例如:linear-graphql-cli query/issues {first:10} 和 linear-graphql-cli mutation/issueCreate {input:{teamId:TEAMID,title:Test}})。
  • 当需要显式返回字段时,使用保留的 GraphQL 参数 select(字符串),例如 {_select:nodes { identifier title }}。
  • 使用 linear-graphql-cli 作为默认命令路径。
  • linear-graphql-cli ... 等同于 uxc https://api.linear.app/graphql ...。
  • 优先执行读取操作(query/),然后执行写入操作(mutation/)。
  • 对于写入操作,始终在执行前确认用户意图。
  • 如果认证失败,使用 uxc auth credential info linear-graphql 检查凭据。

参考

  • - Linear API 文档:https://developers.linear.app
  • GraphQL 模式:https://studio.apollographql.com/public/Linear-API
  • 调用模式:references/usage-patterns.md

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 linear-graphql-skill-1776198070 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 linear-graphql-skill-1776198070 技能

通过命令行安装

skillhub install linear-graphql-skill-1776198070

下载

⬇ 下载 linear-graphql-skill v1.0.0(免费)

文件大小: 5.9 KB | 发布时间: 2026-4-15 11:53

v1.0.0 最新 2026-4-15 11:53
Initial release of Linear GraphQL Skill

- Provides CLI-based access to Linear workspace issues, projects, and teams via the Linear GraphQL API using UXC.
- Supports both Personal API Key and OAuth authentication, with detailed setup instructions for each.
- Includes examples for querying and managing issues, projects, and teams.
- Offers troubleshooting guidance for common authentication and command-line issues.
- Emphasizes guardrails for safe automation and best practices in API interaction.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部