介绍
# Linear
通过 `scripts/linear.sh` 管理 Linear 工单。
## 设置
将 API 密钥存储在 `~/.clawdbot/credentials/linear.json` 中: ```json {"apiKey": "lin_api_..."} ```
## 命令
```bash # List my assigned issues scripts/linear.sh issues --mine
# List team issues scripts/linear.sh issues --team TEAM_ID
# Get issue details scripts/linear.sh get CLP-123
# Search issues scripts/linear.sh search "auth bug"
# Create issue scripts/linear.sh create --team TEAM_ID --title "Bug: login fails" --description "Details"
# Update issue (status, title, assignee, priority) scripts/linear.sh update CLP-123 --state STATE_ID
# Add comment scripts/linear.sh comment CLP-123 "Fixed in PR #42"
# List teams (to get TEAM_ID) scripts/linear.sh teams
# List states (to get STATE_ID) scripts/linear.sh states
# List users (to get assignee ID) scripts/linear.sh users ```
使用 `--json` 标志获取原始 API 输出:`scripts/linear.sh --json issues --mine`
## 工作流示例
**创建并指派一个缺陷:** ```bash # Find team ID scripts/linear.sh teams # Create with priority 2 (high) scripts/linear.sh create --team abc123 --title "Critical: API down" --priority 2 ```
**将工单移动到“进行中”:** ```bash # Find state ID scripts/linear.sh states # Update scripts/linear.sh update CLP-45 --state xyz789 ```
查看 [references/api-examples.md](references/api-examples.md) 了解 GraphQL 详情。