linear
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLinear API Emulator
Linear API 模拟器
Stateful Linear GraphQL API emulation with organizations, users, teams, workflow states, issues, comments, labels, projects, cycles, OAuth apps, tokens, webhooks, and basic agent sessions.
具备状态的Linear GraphQL API模拟,支持组织、用户、团队、工作流状态、问题、评论、标签、项目、周期、OAuth应用、令牌、Webhook以及基础Agent会话。
Start
启动
bash
undefinedbash
undefinedLinear only
仅启动Linear
npx emulate --service linear
Default URL: `http://localhost:4012` when all services are started, or `http://localhost:4000` when Linear is the only service.npx emulate --service linear
默认URL:当启动所有服务时为 `http://localhost:4012`,当仅启动Linear服务时为 `http://localhost:4000`。URL Mapping
URL映射
| Real Linear URL | Emulator URL |
|---|---|
| |
| |
| |
| |
| 真实Linear URL | 模拟器URL |
|---|---|
| |
| |
| |
| |
Auth
认证
GraphQL accepts a bearer token or bare personal API key:
bash
curl "$LINEAR_EMULATOR_URL/graphql" \
-H "Authorization: Bearer lin_test_admin" \
-H "Content-Type: application/json" \
-d '{"query":"{ viewer { id email } }"}'Scope checks are relaxed by default. Set in seed config to require supported operation scopes such as , , , , and .
linear.strict_scopes: truereadwriteissues:createcomments:createadminGraphQL接受Bearer令牌或纯个人API密钥:
bash
curl "$LINEAR_EMULATOR_URL/graphql" \
-H "Authorization: Bearer lin_test_admin" \
-H "Content-Type: application/json" \
-d '{"query":"{ viewer { id email } }"}'默认情况下权限范围检查较为宽松。在种子配置中设置 ,即可要求支持的操作权限范围,如 、、、 和 。
linear.strict_scopes: truereadwriteissues:createcomments:createadminSeed Config
种子配置
yaml
linear:
organization:
name: Acme
url_key: acme
users:
- email: admin@example.com
name: Admin User
admin: true
- email: dev@example.com
name: Developer
teams:
- key: ENG
name: Engineering
issues:
- team: ENG
title: Fix local checkout test
state: Todo
assignee: dev@example.com
oauth_apps:
- client_id: lin_example_client_id
client_secret: example_client_secret
name: My Linear App
redirect_uris:
- http://localhost:3000/api/auth/callback/linear
scopes: [read, write, issues:create, comments:create]
tokens:
- token: lin_test_admin
user: admin@example.com
scopes: [read, write, issues:create, comments:create, admin]
strict_scopes: falseyaml
linear:
organization:
name: Acme
url_key: acme
users:
- email: admin@example.com
name: Admin User
admin: true
- email: dev@example.com
name: Developer
teams:
- key: ENG
name: Engineering
issues:
- team: ENG
title: Fix local checkout test
state: Todo
assignee: dev@example.com
oauth_apps:
- client_id: lin_example_client_id
client_secret: example_client_secret
name: My Linear App
redirect_uris:
- http://localhost:3000/api/auth/callback/linear
scopes: [read, write, issues:create, comments:create]
tokens:
- token: lin_test_admin
user: admin@example.com
scopes: [read, write, issues:create, comments:create, admin]
strict_scopes: falseGraphQL Surface
GraphQL 接口
Supported queries:
viewerorganization- ,
usersuser - ,
teamsteam - ,
workflowStatesworkflowState - ,
issuesissue - ,
commentscomment - ,
issueLabelsissueLabel - ,
projectsproject - ,
cyclescycle - ,
webhookswebhook - ,
agentSessionsagentSession
Supported mutations:
- ,
issueCreate,issueUpdate,issueDelete,issueArchiveissueUnarchive - ,
commentCreate,commentUpdatecommentDelete - ,
issueLabelCreate,issueLabelUpdateissueLabelDelete - ,
issueAddLabelissueRemoveLabel - ,
webhookCreatewebhookDelete - ,
agentSessionCreateOnIssue,agentSessionCreateOnCommentagentSessionUpdate agentActivityCreate
Connections use Relay-style cursors with , , and .
nodesedgespageInfo支持的查询:
viewerorganization- ,
usersuser - ,
teamsteam - ,
workflowStatesworkflowState - ,
issuesissue - ,
commentscomment - ,
issueLabelsissueLabel - ,
projectsproject - ,
cyclescycle - ,
webhookswebhook - ,
agentSessionsagentSession
支持的突变:
- ,
issueCreate,issueUpdate,issueDelete,issueArchiveissueUnarchive - ,
commentCreate,commentUpdatecommentDelete - ,
issueLabelCreate,issueLabelUpdateissueLabelDelete - ,
issueAddLabelissueRemoveLabel - ,
webhookCreatewebhookDelete - ,
agentSessionCreateOnIssue,agentSessionCreateOnCommentagentSessionUpdate agentActivityCreate
连接使用Relay风格的游标,包含 、 和 。
nodesedgespageInfoOAuth
OAuth
- - authorization endpoint with local user picker
GET /oauth/authorize - - local user picker callback
POST /oauth/authorize/callback - - authorization code, refresh token, and client credentials grants
POST /oauth/token - - revoke access or refresh tokens
POST /oauth/revoke
OAuth apps can use or . The configured actor is authoritative. User actor apps use authorization code flows. App actor apps use the app install flow and can request client credentials tokens. App actor support is sufficient for local agent and service-account tests, but it is not full production Linear agent behavior.
actor: useractor: app- - 带本地用户选择器的授权端点
GET /oauth/authorize - - 本地用户选择器回调
POST /oauth/authorize/callback - - 授权码、刷新令牌和客户端凭证授权
POST /oauth/token - - 撤销访问令牌或刷新令牌
POST /oauth/revoke
OAuth应用可使用 或 。配置的actor为权威设置。用户actor应用使用授权码流程。应用actor应用使用应用安装流程,并可请求客户端凭证令牌。应用actor支持足以满足本地Agent和服务账户测试,但并非完整的生产环境Linear Agent行为。
actor: useractor: appWebhooks
Webhook
Create local webhook subscriptions through or seed config. Supported writes dispatch Linear-shaped payloads with , , and headers when a secret is configured.
webhookCreateLinear-DeliveryLinear-EventLinear-Signature通过 或种子配置创建本地Webhook订阅。当配置密钥后,支持的写入操作会发送Linear格式的负载,并附带 、 和 头。
webhookCreateLinear-DeliveryLinear-EventLinear-SignatureInspector
检查器
Open in the Linear emulator to inspect issues, teams, users, projects, agent sessions, OAuth apps, tokens, webhook subscriptions, and webhook deliveries.
GET /在Linear模拟器中打开 ,可查看问题、团队、用户、项目、Agent会话、OAuth应用、令牌、Webhook订阅以及Webhook投递记录。
GET /Current Limits
当前限制
Full Linear schema coverage, exact production rate limiting, notification inbox behavior, rich document APIs, customer APIs, initiative APIs, exact search relevance, and full production agent behavior are not implemented.
尚未实现完整的Linear Schema覆盖、精确的生产环境速率限制、通知收件箱行为、富文档API、客户API、倡议API、精确的搜索相关性以及完整的生产环境Agent行为。