@fink-andreas/pi-linear-tools 0.4.1 → 0.4.3
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 +37 -0
- package/README.md +139 -13
- package/extensions/pi-linear-tools.js +298 -60
- package/index.js +1 -951
- package/package.json +6 -2
- package/src/cli.js +703 -7
- package/src/handlers.js +429 -4
- package/src/linear-client.js +7 -2
- package/src/linear.js +1502 -152
- package/src/sync-doc.js +1208 -0
- package/FUNCTIONALITY.md +0 -57
- package/POST_RELEASE_CHECKLIST.md +0 -30
- package/RELEASE.md +0 -50
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.4.3 (2026-04-02)
|
|
4
|
+
|
|
5
|
+
Sync-doc parity and tool prompt metadata polish release.
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
- Fixed first-run `sync-doc` batch parity so `check` and `run` produce aligned project index planning
|
|
9
|
+
- Preserved existing managed marker location when `position` is `top`
|
|
10
|
+
- Resolved archived projects more reliably during project update flows
|
|
11
|
+
|
|
12
|
+
### Improvements
|
|
13
|
+
- Added `promptSnippet` metadata consistently across all Linear tools for better in-app tool discoverability/context
|
|
14
|
+
- Added default activity limit handling for issue activity execution paths
|
|
15
|
+
|
|
16
|
+
### Tests
|
|
17
|
+
- Added/updated sync-doc regression coverage for first-run check/run parity and marker placement stability
|
|
18
|
+
|
|
19
|
+
## v0.4.2 (2026-03-26)
|
|
20
|
+
|
|
21
|
+
Rate-limit resilience and API usage diagnostics release.
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
- Hardened issue update flow when post-mutation refresh is rate-limited
|
|
25
|
+
- Added explicit user-facing note when update succeeded but refresh is partial due to rate limits
|
|
26
|
+
- Fixed per-command API usage metric keying so usage deltas report correctly
|
|
27
|
+
|
|
28
|
+
### Performance / API Usage
|
|
29
|
+
- Added short-lived in-memory caches for viewer, project list, team list, and team workflow states
|
|
30
|
+
- Added direct-ID fast paths for project/team resolution to avoid full list fetches
|
|
31
|
+
|
|
32
|
+
### Diagnostics
|
|
33
|
+
- Added optional per-command usage summary output via `PI_LINEAR_TOOLS_USAGE_SUMMARY=true`
|
|
34
|
+
- Added debug-level per-command request delta logging across issue/project/team/milestone tools
|
|
35
|
+
|
|
36
|
+
### Documentation / Tests
|
|
37
|
+
- Documented new diagnostics flag and cache behavior
|
|
38
|
+
- Added regression tests for rate-limit fallback and API usage caching
|
|
39
|
+
|
|
3
40
|
## v0.4.0 (2026-03-23)
|
|
4
41
|
|
|
5
42
|
Comprehensive error handling and file-first logging release.
|
package/README.md
CHANGED
|
@@ -2,19 +2,32 @@
|
|
|
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)
|
|
8
22
|
```bash
|
|
9
23
|
pi install npm:@fink-andreas/pi-linear-tools
|
|
10
|
-
pi config
|
|
11
24
|
```
|
|
12
|
-
Enable the `pi-linear-tools` extension resource.
|
|
13
25
|
|
|
14
26
|
### As an npm package
|
|
15
27
|
```bash
|
|
16
28
|
npm install -g @fink-andreas/pi-linear-tools
|
|
17
29
|
```
|
|
30
|
+
Use pi-linear-tools as a CLI tool.
|
|
18
31
|
|
|
19
32
|
## Initial configuration
|
|
20
33
|
|
|
@@ -44,35 +57,39 @@ Optional non-interactive commands:
|
|
|
44
57
|
## LLM-callable tools
|
|
45
58
|
|
|
46
59
|
### `linear_issue`
|
|
47
|
-
Actions: `list`, `view`, `create`, `update`, `comment`, `start`, `delete`
|
|
60
|
+
Actions: `list`, `view`, `activity`, `create`, `update`, `comment`, `start`, `delete`
|
|
48
61
|
|
|
49
62
|
### `linear_project`
|
|
50
|
-
Actions: `list`
|
|
63
|
+
Actions: `list`, `view`, `create`, `update`, `delete`, `archive`, `unarchive`
|
|
64
|
+
|
|
65
|
+
### `linear_project_update`
|
|
66
|
+
Actions: `list`, `view`, `create`, `update`, `archive`, `unarchive`
|
|
51
67
|
|
|
52
68
|
### `linear_milestone`
|
|
53
69
|
Actions: `list`, `view`, `create`, `update`, `delete`
|
|
54
70
|
|
|
55
71
|
## CLI usage
|
|
56
72
|
|
|
57
|
-
If installed globally via npm
|
|
73
|
+
If installed globally via ```npm install -g @fink-andreas/pi-linear-tools```, CLI command ```pi-linear-tools``` is available:
|
|
58
74
|
|
|
59
75
|
```bash
|
|
60
|
-
npm install -g @fink-andreas/pi-linear-tools
|
|
61
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
|
|
62
83
|
pi-linear-tools config
|
|
63
84
|
pi-linear-tools config --api-key lin_xxx
|
|
64
85
|
pi-linear-tools config --default-team ENG
|
|
65
86
|
pi-linear-tools config --team ENG --project "My Project"
|
|
66
87
|
```
|
|
67
88
|
|
|
68
|
-
If `pi-linear-tools` is not found, run it from the repo:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
node bin/pi-linear-tools.js --help
|
|
72
|
-
```
|
|
73
|
-
|
|
74
89
|
### Issue commands
|
|
75
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
|
+
|
|
76
93
|
```bash
|
|
77
94
|
# List issues
|
|
78
95
|
pi-linear-tools issue list --project "My Project"
|
|
@@ -83,6 +100,10 @@ pi-linear-tools issue list --project "My Project" --assignee me
|
|
|
83
100
|
pi-linear-tools issue view ENG-123
|
|
84
101
|
pi-linear-tools issue view ENG-123 --no-comments
|
|
85
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
|
+
|
|
86
107
|
# Create issue
|
|
87
108
|
pi-linear-tools issue create --title "Fix login bug" --team ENG
|
|
88
109
|
pi-linear-tools issue create --title "New feature" --team ENG --project "My Project" --priority 2 --assignee me
|
|
@@ -91,13 +112,15 @@ pi-linear-tools issue create --title "New feature" --team ENG --project "My Proj
|
|
|
91
112
|
pi-linear-tools issue update ENG-123 --state "In Progress"
|
|
92
113
|
pi-linear-tools issue update ENG-123 --title "Updated title" --assignee me
|
|
93
114
|
pi-linear-tools issue update ENG-123 --milestone "Sprint 1"
|
|
115
|
+
pi-linear-tools issue update ENG-123 --sub-issue-of ENG-100
|
|
94
116
|
|
|
95
117
|
# Comment on issue
|
|
96
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"
|
|
97
120
|
|
|
98
121
|
# Start working on issue (creates branch, sets state to In Progress)
|
|
99
122
|
pi-linear-tools issue start ENG-123
|
|
100
|
-
pi-linear-tools issue start ENG-123 --
|
|
123
|
+
pi-linear-tools issue start ENG-123 --from-ref main --on-branch-exists suffix
|
|
101
124
|
|
|
102
125
|
# Delete issue
|
|
103
126
|
pi-linear-tools issue delete ENG-123
|
|
@@ -105,10 +128,107 @@ pi-linear-tools issue delete ENG-123
|
|
|
105
128
|
|
|
106
129
|
### Project commands
|
|
107
130
|
|
|
131
|
+
Use `project update` to change the project record itself: name, teams, dates, lead, description, priority, color, or icon.
|
|
132
|
+
|
|
108
133
|
```bash
|
|
109
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
|
|
110
142
|
```
|
|
111
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
|
+
|
|
112
232
|
### Team commands
|
|
113
233
|
|
|
114
234
|
```bash
|
|
@@ -144,6 +264,12 @@ Settings path:
|
|
|
144
264
|
Environment fallback:
|
|
145
265
|
- `LINEAR_API_KEY` (takes precedence over settings)
|
|
146
266
|
|
|
267
|
+
Debug/diagnostics environment flags:
|
|
268
|
+
- `PI_LINEAR_TOOLS_USAGE_SUMMARY=true` — append per-command Linear API usage summary to tool output markdown and include `details.apiUsage`
|
|
269
|
+
- `LOG_LEVEL=debug` — enable detailed file logging
|
|
270
|
+
- `PI_LINEAR_TOOLS_LOG_TO_CONSOLE=true` — mirror logs to console (normally file-first logging)
|
|
271
|
+
- `PI_LINEAR_TOOLS_LOG_FILE=/custom/path.log` — override log file path
|
|
272
|
+
|
|
147
273
|
## Development
|
|
148
274
|
|
|
149
275
|
```bash
|