关于 linear-api
linear-api 通过 linear-cli 提供执行原始 GraphQL 查询和变更的能力,支持变量与 JSON 输出,适合需要直接调用 Linear API 的开发者。
主要功能
- 01执行 GraphQL 查询
- 02执行 GraphQL 变更
- 03传入查询变量
- 04输出 JSON
- 05提供明确退出码
适用场景
- 01查询 Linear 中的用户或团队信息
- 02使用变量运行 GraphQL 请求
- 03在脚本中处理 API 结果和错误
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ nesszer/ linear-cli --skill linear-api安装后在 Claude Code 中输入/linear-api确认已加载。
README 原文English
来自项目 READMEREADME 暂无中文译文,以下为英文原文;中文介绍见上方。
Raw 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
评论
支持 Markdown