@fink-andreas/pi-linear-tools 0.4.2 → 0.5.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/CHANGELOG.md +33 -0
- package/README.md +131 -3
- package/extensions/pi-linear-tools.js +227 -89
- package/index.js +1 -1019
- package/package.json +2 -2
- package/src/cli.js +700 -6
- package/src/handlers.js +466 -3
- package/src/linear.js +2792 -782
- package/src/sync-doc.js +1208 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.5.0 (2026-04-17)
|
|
4
|
+
|
|
5
|
+
Linear document sync, project lifecycle management, and estimate/story points support.
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
- **Linear document sync**: Keep Linear documents in sync with local Markdown files via `linear_doc_sync` command
|
|
9
|
+
- **Project lifecycle**: Full project lifecycle support including archive/unarchive, updates, and milestones
|
|
10
|
+
- **Estimate (story points)**: Support for estimate/story points field on issue create/update
|
|
11
|
+
- **Issue activity history**: View complete issue activity with `linear_issue_activity` tool
|
|
12
|
+
- **Batch sync**: `sync-doc --all` for batch syncing all configured document targets
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
- Fixed project name lookup for UUID-like project names
|
|
16
|
+
- Fixed milestone name lookup for view/update/delete operations
|
|
17
|
+
- Replaced 'order' with 'sortOrder' for ProjectMilestone queries
|
|
18
|
+
- Fixed sync-doc first-run check/run parity
|
|
19
|
+
- Fixed sync-doc drift detection and target matching
|
|
20
|
+
- Fixed project archive and update validation
|
|
21
|
+
- Fixed archived project resolution for project updates
|
|
22
|
+
- Fixed sync-doc marker position preservation when position is 'top'
|
|
23
|
+
- Fixed default limit for executeIssueActivity (now 25)
|
|
24
|
+
|
|
25
|
+
### Improvements
|
|
26
|
+
- Reduced expensive Linear API issue reads
|
|
27
|
+
- Better CLI help for issue and project workflows
|
|
28
|
+
- Improved sync-doc examples and guidance
|
|
29
|
+
- Added promptSnippet to all Linear tools for consistent LLM context
|
|
30
|
+
- Removed redundant action lists from tool descriptions
|
|
31
|
+
|
|
32
|
+
### Cleanup
|
|
33
|
+
- Removed planning artifacts and documentation files
|
|
34
|
+
- Stopped tracking plan files in git
|
|
35
|
+
|
|
3
36
|
## v0.4.2 (2026-03-26)
|
|
4
37
|
|
|
5
38
|
Rate-limit resilience and API usage diagnostics release.
|
package/README.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
`pi-linear-tools` is a Pi extension for the [Pi coding agent](https://github.com/badlogic/pi-mono) that lets you manage [Linear](https://linear.app/about) issues, projects, and milestones via LLM tools and CLI commands.
|
|
4
4
|
|
|
5
|
+
Useful mental model:
|
|
6
|
+
- `issue update` changes issue fields; `issue comment` adds discussion; `issue activity` reads the Activity timeline
|
|
7
|
+
- `project update` changes project fields; `project-update` manages Updates tab entries
|
|
8
|
+
- `project-update` maps to Linear project updates in the Updates tab
|
|
9
|
+
- `sync-doc init` scaffolds `.linear-tools/config.json` in the folder you point at
|
|
10
|
+
- `sync-doc run` and `sync-doc check` default to all configured targets in `.linear-tools/config.json`
|
|
11
|
+
- `sync-doc --target X` narrows the operation to one configured target
|
|
12
|
+
|
|
13
|
+
Reference conventions:
|
|
14
|
+
- issues use issue key or issue ID
|
|
15
|
+
- projects use project name or project ID
|
|
16
|
+
- project updates use project update ID
|
|
17
|
+
- milestones use milestone ID
|
|
18
|
+
|
|
5
19
|
## Install
|
|
6
20
|
|
|
7
21
|
### As a pi package (recommended)
|
|
@@ -43,10 +57,13 @@ Optional non-interactive commands:
|
|
|
43
57
|
## LLM-callable tools
|
|
44
58
|
|
|
45
59
|
### `linear_issue`
|
|
46
|
-
Actions: `list`, `view`, `create`, `update`, `comment`, `start`, `delete`
|
|
60
|
+
Actions: `list`, `view`, `activity`, `create`, `update`, `comment`, `start`, `delete`
|
|
47
61
|
|
|
48
62
|
### `linear_project`
|
|
49
|
-
Actions: `list`
|
|
63
|
+
Actions: `list`, `view`, `create`, `update`, `delete`, `archive`, `unarchive`
|
|
64
|
+
|
|
65
|
+
### `linear_project_update`
|
|
66
|
+
Actions: `list`, `view`, `create`, `update`, `archive`, `unarchive`
|
|
50
67
|
|
|
51
68
|
### `linear_milestone`
|
|
52
69
|
Actions: `list`, `view`, `create`, `update`, `delete`
|
|
@@ -57,6 +74,12 @@ If installed globally via ```npm install -g @fink-andreas/pi-linear-tools```, CL
|
|
|
57
74
|
|
|
58
75
|
```bash
|
|
59
76
|
pi-linear-tools --help
|
|
77
|
+
pi-linear-tools issue --help
|
|
78
|
+
pi-linear-tools project --help
|
|
79
|
+
pi-linear-tools project-update --help
|
|
80
|
+
pi-linear-tools sync-doc --help
|
|
81
|
+
pi-linear-tools sync-doc init --cwd /path/to/subproject --project "Project name or ID"
|
|
82
|
+
pi-linear-tools sync-doc explain
|
|
60
83
|
pi-linear-tools config
|
|
61
84
|
pi-linear-tools config --api-key lin_xxx
|
|
62
85
|
pi-linear-tools config --default-team ENG
|
|
@@ -65,6 +88,8 @@ pi-linear-tools config --team ENG --project "My Project"
|
|
|
65
88
|
|
|
66
89
|
### Issue commands
|
|
67
90
|
|
|
91
|
+
Use `update` to change the issue itself. Use `comment` to add discussion. Use `activity` to read the Activity timeline shown in Linear.
|
|
92
|
+
|
|
68
93
|
```bash
|
|
69
94
|
# List issues
|
|
70
95
|
pi-linear-tools issue list --project "My Project"
|
|
@@ -75,6 +100,10 @@ pi-linear-tools issue list --project "My Project" --assignee me
|
|
|
75
100
|
pi-linear-tools issue view ENG-123
|
|
76
101
|
pi-linear-tools issue view ENG-123 --no-comments
|
|
77
102
|
|
|
103
|
+
# Read Activity timeline
|
|
104
|
+
pi-linear-tools issue activity ENG-123 --limit 20
|
|
105
|
+
pi-linear-tools issue activity https://linear.app/workspace/issue/ENG-123/example --limit 20
|
|
106
|
+
|
|
78
107
|
# Create issue
|
|
79
108
|
pi-linear-tools issue create --title "Fix login bug" --team ENG
|
|
80
109
|
pi-linear-tools issue create --title "New feature" --team ENG --project "My Project" --priority 2 --assignee me
|
|
@@ -83,13 +112,15 @@ pi-linear-tools issue create --title "New feature" --team ENG --project "My Proj
|
|
|
83
112
|
pi-linear-tools issue update ENG-123 --state "In Progress"
|
|
84
113
|
pi-linear-tools issue update ENG-123 --title "Updated title" --assignee me
|
|
85
114
|
pi-linear-tools issue update ENG-123 --milestone "Sprint 1"
|
|
115
|
+
pi-linear-tools issue update ENG-123 --sub-issue-of ENG-100
|
|
86
116
|
|
|
87
117
|
# Comment on issue
|
|
88
118
|
pi-linear-tools issue comment ENG-123 --body "This is fixed in PR #456"
|
|
119
|
+
pi-linear-tools issue comment ENG-123 --body "Blocked on API review"
|
|
89
120
|
|
|
90
121
|
# Start working on issue (creates branch, sets state to In Progress)
|
|
91
122
|
pi-linear-tools issue start ENG-123
|
|
92
|
-
pi-linear-tools issue start ENG-123 --
|
|
123
|
+
pi-linear-tools issue start ENG-123 --from-ref main --on-branch-exists suffix
|
|
93
124
|
|
|
94
125
|
# Delete issue
|
|
95
126
|
pi-linear-tools issue delete ENG-123
|
|
@@ -97,10 +128,107 @@ pi-linear-tools issue delete ENG-123
|
|
|
97
128
|
|
|
98
129
|
### Project commands
|
|
99
130
|
|
|
131
|
+
Use `project update` to change the project record itself: name, teams, dates, lead, description, priority, color, or icon.
|
|
132
|
+
|
|
100
133
|
```bash
|
|
101
134
|
pi-linear-tools project list
|
|
135
|
+
pi-linear-tools project view "My Project"
|
|
136
|
+
pi-linear-tools project create --name "Roadmap Refresh" --teams ENG,OPS --lead me
|
|
137
|
+
pi-linear-tools project update "Roadmap Refresh" --description "Updated scope" --target-date 2026-06-30
|
|
138
|
+
pi-linear-tools project update "Roadmap Refresh" --lead me --teams ENG,OPS
|
|
139
|
+
pi-linear-tools project delete "Roadmap Refresh"
|
|
140
|
+
pi-linear-tools project archive "Roadmap Refresh"
|
|
141
|
+
pi-linear-tools project unarchive 11111111-1111-4111-8111-111111111111
|
|
102
142
|
```
|
|
103
143
|
|
|
144
|
+
### Project update commands
|
|
145
|
+
|
|
146
|
+
This maps to the Updates tab inside a Linear project. Create an update by project name or ID, then use the returned project update ID for later view, update, archive, or unarchive actions.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pi-linear-tools project-update list --project "My Project"
|
|
150
|
+
pi-linear-tools project-update view 22222222-2222-4222-8222-222222222222
|
|
151
|
+
pi-linear-tools project-update create --project "My Project" --body "Weekly progress update" --health onTrack
|
|
152
|
+
pi-linear-tools project-update update 22222222-2222-4222-8222-222222222222 --body "Revised update" --health atRisk
|
|
153
|
+
pi-linear-tools project-update archive 22222222-2222-4222-8222-222222222222
|
|
154
|
+
pi-linear-tools project-update unarchive 22222222-2222-4222-8222-222222222222
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Sync doc commands
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pi-linear-tools sync-doc init --cwd /path/to/subproject --project "Project name or ID"
|
|
161
|
+
pi-linear-tools sync-doc explain
|
|
162
|
+
pi-linear-tools sync-doc list
|
|
163
|
+
pi-linear-tools sync-doc run
|
|
164
|
+
pi-linear-tools sync-doc check
|
|
165
|
+
pi-linear-tools sync-doc run --target project-overview
|
|
166
|
+
pi-linear-tools sync-doc check --target project-overview
|
|
167
|
+
pi-linear-tools sync-doc run --file README.md --project "Project name or ID" --field content
|
|
168
|
+
pi-linear-tools sync-doc run --file docs/provider.md --project "Project name or ID" --target-type document --document-title "Provider Doc"
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Use one project overview target for the project body, then sync deeper docs as separate Linear documents.
|
|
172
|
+
|
|
173
|
+
Use `pi-linear-tools sync-doc init --cwd /path/to/subproject --project "Project name or ID"` to scaffold a starter config.
|
|
174
|
+
|
|
175
|
+
Placement rule:
|
|
176
|
+
- put `.linear-tools/config.json` in the smallest folder that owns the docs you are syncing
|
|
177
|
+
- the CLI resolves the nearest `.linear-tools/config.json` upward from the current directory
|
|
178
|
+
- use repo root only for targets intentionally shared across multiple subprojects
|
|
179
|
+
- `~/.linear-tools/config.json` is supported for personal defaults, but it should be treated as an override layer, not the main source of truth for repo-owned sync targets
|
|
180
|
+
|
|
181
|
+
Recommended pattern for multiple docs:
|
|
182
|
+
- one `projectField` target syncs the project overview into `project.content` or `project.description`
|
|
183
|
+
- deeper docs use `targetType: "document"` so each file gets its own Linear document
|
|
184
|
+
- the project overview target can set `documentIndexMarker` to maintain a managed list of links to those documents
|
|
185
|
+
|
|
186
|
+
For repos with multiple sync targets, the normal workflow is:
|
|
187
|
+
- define them in the repo-root `.linear-tools/config.json`
|
|
188
|
+
- run `pi-linear-tools sync-doc run` to push everything
|
|
189
|
+
- run `pi-linear-tools sync-doc check` in CI or before updates if you want drift visibility
|
|
190
|
+
|
|
191
|
+
Example:
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"syncDocs": {
|
|
196
|
+
"targets": [
|
|
197
|
+
{
|
|
198
|
+
"name": "project-overview",
|
|
199
|
+
"file": "README.md",
|
|
200
|
+
"project": "Project name or ID",
|
|
201
|
+
"field": "content",
|
|
202
|
+
"marker": "project-overview",
|
|
203
|
+
"documentIndexMarker": "project-doc-links"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "provider-foo",
|
|
207
|
+
"targetType": "document",
|
|
208
|
+
"file": "docs/provider.md",
|
|
209
|
+
"project": "Project name or ID",
|
|
210
|
+
"title": "Provider Doc",
|
|
211
|
+
"marker": "provider-foo",
|
|
212
|
+
"documentId": "optional-existing-document-id"
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Store that config at `.linear-tools/config.json`. Sync state is written to `.linear-tools/sync-state.json`.
|
|
220
|
+
If `documentId` is omitted on a document target, the first sync creates a new Linear document and stores the created ID in sync state.
|
|
221
|
+
|
|
222
|
+
Managed content is wrapped in marker comments inside the target Linear field so manual content above or below the managed block is preserved:
|
|
223
|
+
|
|
224
|
+
```md
|
|
225
|
+
<!-- linear-tools:sync-start README -->
|
|
226
|
+
...synced markdown...
|
|
227
|
+
<!-- linear-tools:sync-end README -->
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
When `documentIndexMarker` is configured on the overview target, the project field also gets a second managed block containing links to the synced Linear documents.
|
|
231
|
+
|
|
104
232
|
### Team commands
|
|
105
233
|
|
|
106
234
|
```bash
|