@fink-andreas/pi-linear-tools 0.1.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 ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## v0.1.0 (planned)
4
+
5
+ Initial public release of `@fink-andreas/pi-linear-tools`.
6
+
7
+ ### Included
8
+ - Linear issue/project/team/milestone tools for pi
9
+ - Extension commands for configuration/help
10
+ - Local CLI for settings and tool operations
11
+ - Project/team/milestone and assignee handling improvements covered by test suite
12
+
13
+ ### Notes
14
+ - npm package: `@fink-andreas/pi-linear-tools`
15
+ - Planned git tag: `v0.1.0`
16
+ - GitHub release notes source: `RELEASE_NOTES_v0.1.0.md`
@@ -0,0 +1,57 @@
1
+ # pi-linear-tools Functionality
2
+
3
+ ## Scope
4
+
5
+ `pi-linear-tools` provides Linear SDK functionality as a pi extension package.
6
+
7
+ Included:
8
+ - extension configuration command (`/linear-tools-config`)
9
+ - issue/project/milestone tools powered by `@linear/sdk`
10
+ - issue start flow with optional git branch creation/switch
11
+ - settings persistence for API key/default team/project team mapping
12
+
13
+ Excluded:
14
+ - daemon runtime
15
+ - polling loop
16
+ - systemd service installation/control
17
+ - tmux/process session management
18
+ - RPC process lifecycle management
19
+
20
+ ## Core modules
21
+
22
+ - `src/linear-client.js`: Linear SDK client factory
23
+ - `src/linear.js`: issue/project/milestone operations and formatting helpers
24
+ - `src/settings.js`: settings defaults/validation/load/save
25
+ - `src/logger.js`: structured logging
26
+ - `extensions/pi-linear-tools.js`: command and tool registration
27
+ - `src/cli.js`: optional local CLI for settings operations
28
+
29
+ ## Tool behavior notes
30
+
31
+ - `LINEAR_API_KEY` is resolved from env first, then settings
32
+ - project references may be project name or project ID
33
+ - issue references may be identifier (`ABC-123`) or Linear issue ID
34
+ - default team resolution order for issue creation:
35
+ 1. explicit `team` parameter
36
+ 2. project-level configured team
37
+ 3. global `defaultTeam`
38
+ - `linear_issue` `start` action:
39
+ - uses Linear branch name if available
40
+ - can create/switch git branch via `pi.exec("git", ...)`
41
+
42
+ ## Settings schema
43
+
44
+ ```json
45
+ {
46
+ "schemaVersion": 1,
47
+ "linearApiKey": null,
48
+ "defaultTeam": null,
49
+ "projects": {
50
+ "<linear-project-id>": {
51
+ "scope": {
52
+ "team": "ENG"
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ```
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andreas Fink
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,30 @@
1
+ # Post-release verification checklist
2
+
3
+ ## Registry and install checks
4
+
5
+ ```bash
6
+ npm view @fink-andreas/pi-linear-tools version
7
+ npm install -g @fink-andreas/pi-linear-tools
8
+ pi-linear-tools --help
9
+ ```
10
+
11
+ ## pi package route smoke test
12
+
13
+ ```bash
14
+ pi install git:github.com/fink-andreas/pi-linear-tools
15
+ # then enable extension resource and run
16
+ /linear-tools-help
17
+ ```
18
+
19
+ ## Basic command smoke test
20
+
21
+ ```bash
22
+ pi-linear-tools project list
23
+ pi-linear-tools team list
24
+ ```
25
+
26
+ ## Closeout
27
+
28
+ - Capture any regressions as follow-up Linear issues
29
+ - Post release summary to INN-234
30
+ - Mark milestone complete
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # pi-linear-tools
2
+
3
+ `pi-linear-tools` is a **Pi extension package** for the [Pi coding agent](https://github.com/badlogic/pi-mono), with Linear SDK-powered tools for issues, projects, and milestones.
4
+
5
+ ## Install
6
+
7
+ ### As a pi package (recommended)
8
+ ```bash
9
+ pi install git:github.com/fink-andreas/pi-linear-tools
10
+ pi config
11
+ ```
12
+ Enable the `pi-linear-tools` extension resource.
13
+
14
+ ### As an npm package
15
+ ```bash
16
+ npm install -g @fink-andreas/pi-linear-tools
17
+ ```
18
+
19
+ ## Initial configuration
20
+
21
+ After installation, run `/linear-tools-config` in pi.
22
+
23
+ When used **without parameters**, it starts the interactive setup flow and guides you through:
24
+ - authentication (API key)
25
+ - workspace selection
26
+ - default team selection
27
+
28
+ ```text
29
+ /linear-tools-config
30
+ ```
31
+
32
+ Optional non-interactive commands:
33
+ ```text
34
+ /linear-tools-config --api-key lin_xxx
35
+ /linear-tools-config --default-team ENG
36
+ /linear-tools-config --team ENG --project "My Project"
37
+ ```
38
+
39
+ ## Extension commands
40
+
41
+ - `/linear-tools-config`
42
+ - `/linear-tools-help`
43
+
44
+ ## LLM-callable tools
45
+
46
+ ### `linear_issue`
47
+ Actions: `list`, `view`, `create`, `update`, `comment`, `start`, `delete`
48
+
49
+ ### `linear_project`
50
+ Actions: `list`
51
+
52
+ ### `linear_milestone`
53
+ Actions: `list`, `view`, `create`, `update`, `delete`
54
+
55
+ ## CLI usage
56
+
57
+ If installed globally via npm, you can run:
58
+
59
+ ```bash
60
+ npm install -g @fink-andreas/pi-linear-tools
61
+ pi-linear-tools --help
62
+ pi-linear-tools config
63
+ pi-linear-tools config --api-key lin_xxx
64
+ pi-linear-tools config --default-team ENG
65
+ pi-linear-tools config --team ENG --project "My Project"
66
+ ```
67
+
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
+ ### Issue commands
75
+
76
+ ```bash
77
+ # List issues
78
+ pi-linear-tools issue list --project "My Project"
79
+ pi-linear-tools issue list --project "My Project" --states "In Progress,Backlog"
80
+ pi-linear-tools issue list --project "My Project" --assignee me
81
+
82
+ # View issue details
83
+ pi-linear-tools issue view ENG-123
84
+ pi-linear-tools issue view ENG-123 --no-comments
85
+
86
+ # Create issue
87
+ pi-linear-tools issue create --title "Fix login bug" --team ENG
88
+ pi-linear-tools issue create --title "New feature" --team ENG --project "My Project" --priority 2 --assignee me
89
+
90
+ # Update issue
91
+ pi-linear-tools issue update ENG-123 --state "In Progress"
92
+ pi-linear-tools issue update ENG-123 --title "Updated title" --assignee me
93
+ pi-linear-tools issue update ENG-123 --milestone "Sprint 1"
94
+
95
+ # Comment on issue
96
+ pi-linear-tools issue comment ENG-123 --body "This is fixed in PR #456"
97
+
98
+ # Start working on issue (creates branch, sets state to In Progress)
99
+ pi-linear-tools issue start ENG-123
100
+ pi-linear-tools issue start ENG-123 --branch custom-branch-name
101
+
102
+ # Delete issue
103
+ pi-linear-tools issue delete ENG-123
104
+ ```
105
+
106
+ ### Project commands
107
+
108
+ ```bash
109
+ pi-linear-tools project list
110
+ ```
111
+
112
+ ### Team commands
113
+
114
+ ```bash
115
+ pi-linear-tools team list
116
+ ```
117
+
118
+ ### Milestone commands
119
+
120
+ ```bash
121
+ # List milestones
122
+ pi-linear-tools milestone list --project "My Project"
123
+
124
+ # View milestone details
125
+ pi-linear-tools milestone view <milestone-id>
126
+
127
+ # Create milestone
128
+ pi-linear-tools milestone create --project "My Project" --name "v1.0 Release"
129
+ pi-linear-tools milestone create --project "My Project" --name "Sprint 1" --target-date 2024-12-31 --status planned
130
+
131
+ # Update milestone
132
+ pi-linear-tools milestone update <milestone-id> --status inProgress
133
+
134
+ # Delete milestone
135
+ pi-linear-tools milestone delete <milestone-id>
136
+ ```
137
+
138
+ ## Configuration storage
139
+
140
+ Settings path:
141
+
142
+ `~/.pi/agent/extensions/pi-linear-tools/settings.json`
143
+
144
+ Environment fallback:
145
+ - `LINEAR_API_KEY` (takes precedence over settings)
146
+
147
+ ## Development
148
+
149
+ ```bash
150
+ npm install
151
+ npm test
152
+ npm run release:check
153
+ node index.js --help
154
+ ```
155
+
156
+ Release checklist: see `RELEASE.md`.
157
+ Post-release verification checklist: see `POST_RELEASE_CHECKLIST.md`.
package/RELEASE.md ADDED
@@ -0,0 +1,50 @@
1
+ # Release Runbook
2
+
3
+ ## npm publish (`v0.1.0`)
4
+
5
+ 1. Ensure clean working tree
6
+ ```bash
7
+ git status
8
+ ```
9
+ 2. Run pre-publish checks
10
+ ```bash
11
+ npm run release:check
12
+ ```
13
+ 3. Verify npm authentication
14
+ ```bash
15
+ npm whoami
16
+ ```
17
+ 4. Publish package
18
+ ```bash
19
+ npm publish --access public
20
+ ```
21
+ 5. Verify published version
22
+ ```bash
23
+ npm view @fink-andreas/pi-linear-tools version
24
+ ```
25
+
26
+ ## Post-publish quick validation
27
+
28
+ ```bash
29
+ npm install -g @fink-andreas/pi-linear-tools
30
+ pi-linear-tools --help
31
+ ```
32
+
33
+ ## GitHub release
34
+
35
+ ```bash
36
+ git tag v0.1.0
37
+ git push origin v0.1.0
38
+ ```
39
+
40
+ Create release notes from `RELEASE_NOTES_v0.1.0.md`:
41
+
42
+ ```bash
43
+ gh release create v0.1.0 --title "v0.1.0" --notes-file RELEASE_NOTES_v0.1.0.md
44
+ ```
45
+
46
+ Verify release:
47
+
48
+ ```bash
49
+ gh release view v0.1.0
50
+ ```
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runCli } from '../src/cli.js';
4
+
5
+ runCli().catch((error) => {
6
+ console.error('pi-linear-tools CLI error:', error?.message || error);
7
+ process.exit(1);
8
+ });