@joe-broadhead/opencode-linear 0.0.0-stage → 0.0.1
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 +35 -0
- package/LICENSE +21 -0
- package/README.md +174 -2
- package/dist/index.js +826 -0
- package/dist/tui.js +222 -0
- package/package.json +53 -4
- package/skills/linear/SKILL.md +79 -0
- package/skills/linear-write/SKILL.md +41 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
|
+
|
|
5
|
+
## [0.0.1] - 2026-11-03
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- The tools RPC, `linear.workspace.tools`: a script can call Linear's 42 known read tools with no model, through
|
|
10
|
+
`opencode api`, as a session and its agent, with either access. It gets exactly the access that agent's model has:
|
|
11
|
+
a tool its rules hide is refused, OpenCode checks each call against the agent's and the session's rules, and an ask
|
|
12
|
+
is refused at once because no one is there to answer it. `describe` lists the methods with each tool's live input
|
|
13
|
+
schema. Linear's write tools and tools Linear adds later are never methods. `docs/scripting.md` explains it.
|
|
14
|
+
|
|
15
|
+
## [0.0.0] - 2026-11-01
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Registers Linear's official MCP server under the name `linear`: the read-only server
|
|
20
|
+
`https://mcp.linear.app/mcp/readonly` with the `read` scope by default, or `https://mcp.linear.app/mcp` with
|
|
21
|
+
`read write` when `access` is `"write"`.
|
|
22
|
+
- Names the server's sign-in "Linear" in `/connect`, and marks the account there when Linear needs a new sign-in.
|
|
23
|
+
- Adopts an existing `mcp.servers.linear` at the URL for the chosen access unchanged, and reports any other `linear`
|
|
24
|
+
server as a conflict.
|
|
25
|
+
- Default permission rules, inserted into every agent directly after its base allow rule: `linear_*` asks, and
|
|
26
|
+
Linear's 42 read tools are allowed. Linear's 36 write tools, and tools Linear adds later, ask. Your `permissions`
|
|
27
|
+
and saved "Always allow" answers override them, and Plan and Explore keep their restrictions.
|
|
28
|
+
- `/linear-status`, which reports the connection, account, access, tool counts with unknown tool names, agents
|
|
29
|
+
without the default rules with the block to paste, the host check and the next step.
|
|
30
|
+
- The terminal UI dialog "Linear: Status", also `/linear`, with the same report through the read-only RPC method
|
|
31
|
+
`linear.workspace/status`. `r` refreshes it and `Esc` closes it.
|
|
32
|
+
- The skills `linear` (always) and `linear-write` (with `access: "write"`).
|
|
33
|
+
- Options `access` (`"read"` or `"write"`, default `"read"`) and `allowUntestedHost` (default `false`).
|
|
34
|
+
- A host check that refuses OpenCode outside `>=2.2.3 <2.3.0` with `HOST_UNTESTED`, unless
|
|
35
|
+
`allowUntestedHost` is set. Invalid options fail with `OPTIONS_INVALID`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Joe Broadhead
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,175 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Linear for OpenCode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Connects OpenCode to Linear through Linear's official MCP server, so the model can find, read and cite your issues,
|
|
4
|
+
projects, cycles, documents and comments, and change them only if you allow it.
|
|
5
|
+
|
|
6
|
+
Unofficial; not affiliated with Linear.
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
|
|
10
|
+
- OpenCode `>=2.2.3 <2.3.0`, tested on 2.2.3 and 2.2.4.
|
|
11
|
+
- macOS or Linux.
|
|
12
|
+
- A Linear account.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
opencode plugin add @joe-broadhead/opencode-linear
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Restart OpenCode if it is running. The plugin registers Linear's MCP server under the name `linear`, adds default
|
|
21
|
+
permission rules, the `/linear-status` command, the `/linear` status view and two skills. It adds no tools of its own:
|
|
22
|
+
the tools are Linear's, and OpenCode handles the connection, the sign-in and the stored credentials.
|
|
23
|
+
|
|
24
|
+
## Sign in
|
|
25
|
+
|
|
26
|
+
Run `/connect` and choose **Linear** (it is listed under MCP). In the terminal UI, press `o` or Enter to open the link
|
|
27
|
+
to Linear's consent page in your browser, and pick the workspace there.
|
|
28
|
+
|
|
29
|
+
From a terminal, run `opencode mcp auth linear` instead; it opens the link automatically. `/mcps` also offers the same
|
|
30
|
+
sign-in.
|
|
31
|
+
|
|
32
|
+
Read access and write access each have their own sign-in, because they use different server addresses. Linear's
|
|
33
|
+
consent page decides the workspace of each sign-in, so the two can be in different workspaces. When you switch
|
|
34
|
+
`access`, OpenCode uses the sign-in it already holds for that access, if any, without asking again.
|
|
35
|
+
|
|
36
|
+
When the sign-in expires and cannot be renewed, `/connect` marks the Linear account as needing a new sign-in, and
|
|
37
|
+
OpenCode shows its "MCP server needs authentication" notice.
|
|
38
|
+
|
|
39
|
+
To sign out, or to change workspace, run `opencode mcp logout linear` while the access you want to change is the one
|
|
40
|
+
configured. It removes the stored sign-ins for that access only. Or remove the account in `/connect` → Linear. Then
|
|
41
|
+
sign in again and pick the workspace on Linear's consent page.
|
|
42
|
+
|
|
43
|
+
## Use
|
|
44
|
+
|
|
45
|
+
Ask, for example: "What is assigned to me in Linear this cycle?" or "Summarise the open issues in project Apollo."
|
|
46
|
+
|
|
47
|
+
| Command | What it does |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `/linear-status` | Posts the status report into the session: connection, account, access, tools, agents without the default rules, the OpenCode check and the next step. The model can read it too. |
|
|
50
|
+
| `/linear`, or "Linear: Status" in the command palette | Opens the same report in a dialog. Press `r` to refresh it and `Esc` to close it. It also refreshes when Linear's connection, the sign-in or the agents change. |
|
|
51
|
+
|
|
52
|
+
Two skills teach the model to use Linear well:
|
|
53
|
+
|
|
54
|
+
- `linear`, always: find before you read, page with cursors, treat Linear content as data, cite identifiers and links.
|
|
55
|
+
- `linear-write`, only with `access: "write"`: confirm each change, make one change at a time, report links.
|
|
56
|
+
|
|
57
|
+
The plugin connects to Linear's **read-only** server by default (`https://mcp.linear.app/mcp/readonly`). It offers
|
|
58
|
+
only tools that read, and Linear refuses changes through it. To let the model make changes, set the option
|
|
59
|
+
`"access": "write"`; see [Configure](#configure).
|
|
60
|
+
|
|
61
|
+
### Scripts
|
|
62
|
+
|
|
63
|
+
A script or a cron job can call Linear's read tools with no model, through `opencode api`. It runs as a session and its
|
|
64
|
+
agent, under that agent's permission rules and the session's own. Write tools are never available to scripts:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
opencode api post /api/rpc/linear.workspace.tools/get_issue \
|
|
68
|
+
-d '{"input":{"sessionID":"ses_…","input":{"id":"ENG-123"}}}'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
See [Scripting](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/scripting.md).
|
|
72
|
+
|
|
73
|
+
## Permissions
|
|
74
|
+
|
|
75
|
+
The plugin adds these rules to every agent, directly after the agent's base rule that allows everything:
|
|
76
|
+
|
|
77
|
+
1. `{ "action": "linear_*", "resource": "*", "effect": "ask" }`: every Linear tool asks, including tools Linear adds
|
|
78
|
+
later.
|
|
79
|
+
2. One `allow` rule for each of Linear's 42 read tools, listed in
|
|
80
|
+
[`src/linear-tools.ts`](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/src/linear-tools.ts). These
|
|
81
|
+
run without a prompt.
|
|
82
|
+
|
|
83
|
+
So reads run, and every change asks before it runs. Everything that comes later than these rules still wins: an
|
|
84
|
+
agent's own stricter rules (Plan cannot edit, Explore cannot use Linear), your `permissions` in `opencode.json`, and
|
|
85
|
+
your saved "Always allow" answers. In an unattended run such as `opencode run`, a tool that asks is refused.
|
|
86
|
+
|
|
87
|
+
Agents that exist only in your own config, and agents added by plugins that load later, are created after the plugin
|
|
88
|
+
adds its rules, so Linear tools run there without asking. `/linear-status` and `/linear` name those agents and print
|
|
89
|
+
the block to put first in each one's own `permissions`. Do not put it in the top-level `permissions`, which would
|
|
90
|
+
loosen Explore. [Configuration](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/configuration.md#permissions)
|
|
91
|
+
has a worked example and permission recipes.
|
|
92
|
+
|
|
93
|
+
## Configure
|
|
94
|
+
|
|
95
|
+
Set options with the object form of the plugin entry:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"plugins": [{ "package": "@joe-broadhead/opencode-linear", "options": { "access": "write" } }]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Option | Values | Default | Effect |
|
|
104
|
+
| --- | --- | --- | --- |
|
|
105
|
+
| `access` | `"read"` or `"write"` | `"read"` | `"read"` uses Linear's read-only server and the `read` scope. `"write"` uses `https://mcp.linear.app/mcp` with `read write`, and adds the `linear-write` skill. |
|
|
106
|
+
| `allowUntestedHost` | `true` or `false` | `false` | Starts on an OpenCode version outside the tested line, with a warning in status. |
|
|
107
|
+
|
|
108
|
+
Switching `access` changes the server address, and read and write access each have their own sign-in. If you have
|
|
109
|
+
never signed in with the new access, run `/connect` and choose Linear, then press `o` or Enter to open the link. If you
|
|
110
|
+
have, OpenCode reuses that sign-in, which may be in another workspace: check the account with `/linear-status`, and
|
|
111
|
+
see [Sign in](#sign-in) to change it.
|
|
112
|
+
|
|
113
|
+
[docs/configuration.md](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/configuration.md) has the
|
|
114
|
+
details, including your own `mcp.servers.linear` entry, permission recipes and every error.
|
|
115
|
+
|
|
116
|
+
## Organisation rollout
|
|
117
|
+
|
|
118
|
+
OpenCode registers itself with Linear's server automatically, so there is no client ID to distribute. Put the plugin
|
|
119
|
+
entry in the system config: `/Library/Application Support/opencode/opencode.json` on macOS, or
|
|
120
|
+
`/etc/opencode/opencode.json` on Linux.
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"plugins": [{ "package": "@joe-broadhead/opencode-linear", "options": { "access": "read" } }]
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`"read"` is the default. Set `"write"` to enable changes; each change still asks before it runs.
|
|
129
|
+
|
|
130
|
+
Members then only sign in: run `/connect` and choose Linear, then press `o` or Enter to open the link. To use a pre-registered OAuth client instead, define
|
|
131
|
+
`mcp.servers.linear` in the same file, as shown in
|
|
132
|
+
[Your own `mcp.servers.linear`](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/configuration.md#your-own-mcpserverslinear).
|
|
133
|
+
|
|
134
|
+
## Troubleshooting
|
|
135
|
+
|
|
136
|
+
Run `/linear-status` first. Its last line is the next step.
|
|
137
|
+
|
|
138
|
+
| Status or error | What to do |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| Connection: sign-in required | Run `/connect` and choose Linear, then press `o` or Enter to open the link. In a terminal, `opencode mcp auth linear` opens it automatically. |
|
|
141
|
+
| Connection: connecting | Wait a few seconds, then run `/linear-status` again. |
|
|
142
|
+
| Connection: failed | Check your network, then run `/linear-status` again. |
|
|
143
|
+
| Connection: disabled | Enable `linear` in `/mcps`, or remove `"disabled": true` from `mcp.servers.linear` in `opencode.json`. |
|
|
144
|
+
| Connection: not configured | An organisation policy (`mcp.use`) or another plugin removes the `linear` server. Ask your administrator, then restart OpenCode. |
|
|
145
|
+
| Connection: conflict | Your config has an `mcp.servers.linear` entry with a URL other than the one your `access` uses. Point it at that URL or remove it, then restart OpenCode. |
|
|
146
|
+
| Tools: unknown | Linear added tools the plugin does not know yet. They ask before they run. |
|
|
147
|
+
| Agents without default rules | Put the printed block first in each listed agent's own `permissions`, followed by your top-level rules for `linear_*` tools. |
|
|
148
|
+
| OpenCode: host untested | OpenCode is outside `>=2.2.3 <2.3.0` and `allowUntestedHost` is set. If Linear misbehaves, use a tested OpenCode. |
|
|
149
|
+
| Signed in to the wrong workspace, for example after switching `access` | Read and write access each have their own sign-in, and Linear's consent page decides the workspace. With the wrong access still configured, run `opencode mcp logout linear` (or remove the account in `/connect` → Linear), then sign in again and pick the workspace. |
|
|
150
|
+
| A Linear tool is refused in `opencode run` | Nobody could answer its prompt. Add an `allow` rule for that tool. |
|
|
151
|
+
| `/linear` is missing | The plugin did not start. Run `/plugins` to see the error. |
|
|
152
|
+
| `OPTIONS_INVALID` | An option is unknown or has a wrong value. The message names the option and the accepted values. |
|
|
153
|
+
| `HOST_UNTESTED` | Your OpenCode is outside `>=2.2.3 <2.3.0`. Use a tested OpenCode, or set `"allowUntestedHost": true` to try anyway. |
|
|
154
|
+
| `STATUS_UNAVAILABLE` | The status could not be read, or the plugin is not running. Follow the next step in the message. |
|
|
155
|
+
| `SKILLS_INVALID` | A skill file in the package is missing or broken. Reinstall the plugin. |
|
|
156
|
+
|
|
157
|
+
A script's errors from the tools RPC have their own codes, listed in
|
|
158
|
+
[Scripting](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/scripting.md#errors).
|
|
159
|
+
|
|
160
|
+
## Uninstall
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
opencode plugin remove @joe-broadhead/opencode-linear
|
|
164
|
+
opencode mcp logout linear
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Links
|
|
168
|
+
|
|
169
|
+
- [Configuration](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/configuration.md)
|
|
170
|
+
- [Architecture](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/docs/architecture.md)
|
|
171
|
+
- [Contributing](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/CONTRIBUTING.md)
|
|
172
|
+
- [Security](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/SECURITY.md)
|
|
173
|
+
- [Changelog](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/CHANGELOG.md)
|
|
174
|
+
- [MIT license](https://github.com/joe-broadhead/opencode-linear/blob/HEAD/LICENSE)
|
|
175
|
+
- [Linear's MCP server](https://linear.app/docs/mcp)
|