@uniswap/ai-toolkit-linear-task-utils 0.0.1 → 0.0.2-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +177 -36
- package/dist/cli.cjs +13384 -0
- package/dist/index.cjs +13009 -0
- package/dist/packages/linear-task-utils/src/cli.d.ts +2 -0
- package/dist/packages/linear-task-utils/src/cli.d.ts.map +1 -0
- package/dist/packages/linear-task-utils/src/ensure-label.d.ts +21 -0
- package/dist/packages/linear-task-utils/src/ensure-label.d.ts.map +1 -0
- package/dist/packages/linear-task-utils/src/index.d.ts +5 -0
- package/dist/packages/linear-task-utils/src/index.d.ts.map +1 -0
- package/dist/packages/linear-task-utils/src/query-issues.d.ts +20 -0
- package/dist/packages/linear-task-utils/src/query-issues.d.ts.map +1 -0
- package/dist/packages/linear-task-utils/src/types.d.ts +87 -0
- package/dist/packages/linear-task-utils/src/types.d.ts.map +1 -0
- package/dist/packages/linear-task-utils/src/update-issue.d.ts +25 -0
- package/dist/packages/linear-task-utils/src/update-issue.d.ts.map +1 -0
- package/dist/packages/linear-task-utils/src/version.d.ts +2 -0
- package/dist/packages/linear-task-utils/src/version.d.ts.map +1 -0
- package/package.json +45 -6
package/README.md
CHANGED
|
@@ -1,45 +1,186 @@
|
|
|
1
1
|
# @uniswap/ai-toolkit-linear-task-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI tool to query Linear issues for autonomous Claude Code task processing in GitHub Actions workflows.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
# Use directly via npx (recommended for CI)
|
|
9
|
+
npx @uniswap/ai-toolkit-linear-task-utils query --team "Developer AI" --label "claude"
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
# Or install globally
|
|
12
|
+
npm install -g @uniswap/ai-toolkit-linear-task-utils
|
|
13
|
+
```
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@uniswap/ai-toolkit-linear-task-utils`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
+
## Commands
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
### query
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Query Linear issues matching criteria and output a JSON matrix for GitHub Actions.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
```bash
|
|
22
|
+
npx @uniswap/ai-toolkit-linear-task-utils query \
|
|
23
|
+
--team "Developer AI" \
|
|
24
|
+
--label "claude" \
|
|
25
|
+
--statuses "Backlog,Todo" \
|
|
26
|
+
--max 3
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Options:**
|
|
30
|
+
|
|
31
|
+
| Option | Default | Description |
|
|
32
|
+
| ------------ | -------------- | ---------------------------- |
|
|
33
|
+
| `--team` | "Developer AI" | Linear team name |
|
|
34
|
+
| `--label` | "claude" | Label to filter by |
|
|
35
|
+
| `--statuses` | "Backlog,Todo" | Comma-separated status names |
|
|
36
|
+
| `--max` | 3 | Maximum issues to return |
|
|
37
|
+
|
|
38
|
+
**Output (JSON to stdout):**
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"include": [
|
|
43
|
+
{
|
|
44
|
+
"issue_id": "abc123",
|
|
45
|
+
"issue_identifier": "DAI-123",
|
|
46
|
+
"issue_title": "Fix authentication bug",
|
|
47
|
+
"issue_description": "Full description...",
|
|
48
|
+
"issue_url": "https://linear.app/...",
|
|
49
|
+
"branch_name": "claude/dai-123-fix-auth-bug",
|
|
50
|
+
"priority": 1,
|
|
51
|
+
"priority_label": "Urgent"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"count": 1
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### ensure-label
|
|
59
|
+
|
|
60
|
+
Ensure a label exists in the specified team. Creates it if missing.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @uniswap/ai-toolkit-linear-task-utils ensure-label \
|
|
64
|
+
--team "Developer AI" \
|
|
65
|
+
--label "claude" \
|
|
66
|
+
--color "#6366f1"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Options:**
|
|
70
|
+
|
|
71
|
+
| Option | Default | Description |
|
|
72
|
+
| --------- | -------------- | --------------------------- |
|
|
73
|
+
| `--team` | "Developer AI" | Linear team name |
|
|
74
|
+
| `--label` | "claude" | Label name to ensure exists |
|
|
75
|
+
| `--color` | "#6366f1" | Label color (hex) |
|
|
76
|
+
|
|
77
|
+
### update-issue
|
|
78
|
+
|
|
79
|
+
Update an issue status and optionally attach a PR link.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx @uniswap/ai-toolkit-linear-task-utils update-issue \
|
|
83
|
+
--issue-id "abc123" \
|
|
84
|
+
--status "In Review" \
|
|
85
|
+
--pr-url "https://github.com/org/repo/pull/123"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Options:**
|
|
89
|
+
|
|
90
|
+
| Option | Required | Description |
|
|
91
|
+
| ------------ | -------- | ----------------------------------- |
|
|
92
|
+
| `--issue-id` | Yes | Linear issue ID |
|
|
93
|
+
| `--status` | Yes | New status name (e.g., "In Review") |
|
|
94
|
+
| `--pr-url` | No | PR URL to attach |
|
|
95
|
+
| `--comment` | No | Comment to add to the issue |
|
|
96
|
+
|
|
97
|
+
## Authentication
|
|
98
|
+
|
|
99
|
+
Set the `LINEAR_API_KEY` environment variable:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
export LINEAR_API_KEY="lin_api_xxxxx"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Or pass via CLI flag (not recommended for CI - shows in process list):
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx @uniswap/ai-toolkit-linear-task-utils query --api-key "lin_api_xxxxx"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## GitHub Actions Usage
|
|
112
|
+
|
|
113
|
+
### Querying Issues for Matrix Strategy
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
jobs:
|
|
117
|
+
prepare:
|
|
118
|
+
runs-on: ubuntu-latest
|
|
119
|
+
outputs:
|
|
120
|
+
matrix: ${{ steps.query.outputs.result }}
|
|
121
|
+
has_tasks: ${{ steps.query.outputs.has_tasks }}
|
|
122
|
+
steps:
|
|
123
|
+
- name: Query Linear issues
|
|
124
|
+
id: query
|
|
125
|
+
run: |
|
|
126
|
+
RESULT=$(npx @uniswap/ai-toolkit-linear-task-utils query \
|
|
127
|
+
--team "${{ inputs.linear_team }}" \
|
|
128
|
+
--label "${{ inputs.linear_label }}" \
|
|
129
|
+
--max "${{ inputs.max_issues }}")
|
|
130
|
+
|
|
131
|
+
echo "result=$RESULT" >> $GITHUB_OUTPUT
|
|
132
|
+
|
|
133
|
+
COUNT=$(echo "$RESULT" | jq -r '.count')
|
|
134
|
+
if [ "$COUNT" -gt 0 ]; then
|
|
135
|
+
echo "has_tasks=true" >> $GITHUB_OUTPUT
|
|
136
|
+
else
|
|
137
|
+
echo "has_tasks=false" >> $GITHUB_OUTPUT
|
|
138
|
+
fi
|
|
139
|
+
env:
|
|
140
|
+
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
|
|
141
|
+
|
|
142
|
+
process-task:
|
|
143
|
+
needs: prepare
|
|
144
|
+
if: needs.prepare.outputs.has_tasks == 'true'
|
|
145
|
+
strategy:
|
|
146
|
+
fail-fast: false
|
|
147
|
+
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
|
148
|
+
runs-on: ubuntu-latest
|
|
149
|
+
steps:
|
|
150
|
+
- name: Process task ${{ matrix.issue_identifier }}
|
|
151
|
+
run: echo "Working on ${{ matrix.issue_title }}"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Updating Issue After PR Creation
|
|
155
|
+
|
|
156
|
+
```yaml
|
|
157
|
+
- name: Update Linear issue
|
|
158
|
+
if: steps.create-pr.outputs.pr_url != ''
|
|
159
|
+
run: |
|
|
160
|
+
npx @uniswap/ai-toolkit-linear-task-utils update-issue \
|
|
161
|
+
--issue-id "${{ matrix.issue_id }}" \
|
|
162
|
+
--status "In Review" \
|
|
163
|
+
--pr-url "${{ steps.create-pr.outputs.pr_url }}"
|
|
164
|
+
env:
|
|
165
|
+
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Priority Sorting
|
|
169
|
+
|
|
170
|
+
Issues are sorted by priority in this order:
|
|
171
|
+
|
|
172
|
+
1. **Urgent** (priority = 1)
|
|
173
|
+
2. **High** (priority = 2)
|
|
174
|
+
3. **Normal** (priority = 3)
|
|
175
|
+
4. **Low** (priority = 4)
|
|
176
|
+
5. **No Priority** (priority = 0)
|
|
177
|
+
|
|
178
|
+
## Related
|
|
179
|
+
|
|
180
|
+
- [AI Toolkit](https://github.com/Uniswap/ai-toolkit) - Standardized Claude Code setup
|
|
181
|
+
- [Claude Code Action](https://github.com/anthropics/claude-code-action) - GitHub Action for Claude Code
|
|
182
|
+
- [Linear API](https://developers.linear.app/) - Linear API documentation
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
MIT
|