opencode-with-claude 1.1.7 → 1.1.8
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 +8 -2
- package/dist/index.d.ts +0 -10
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -28,14 +28,20 @@ An [OpenCode](https://opencode.ai) plugin that runs [opencode-claude-max-proxy](
|
|
|
28
28
|
|
|
29
29
|
The plugin hooks into OpenCode's plugin system. When OpenCode launches, it starts the proxy, configures the Anthropic provider, and cleans everything up on exit.
|
|
30
30
|
|
|
31
|
-
**1.
|
|
31
|
+
**1. Install the plugin**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g opencode-with-claude
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**2. Authenticate with Claude (one-time)**
|
|
32
38
|
|
|
33
39
|
```bash
|
|
34
40
|
npm install -g @anthropic-ai/claude-code
|
|
35
41
|
claude login
|
|
36
42
|
```
|
|
37
43
|
|
|
38
|
-
**
|
|
44
|
+
**3. Add to your `opencode.json`**
|
|
39
45
|
|
|
40
46
|
Global (`~/.config/opencode/opencode.json`) or project-level:
|
|
41
47
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { Plugin } from '@opencode-ai/plugin';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* OpenCode plugin that manages the Claude Max proxy lifecycle.
|
|
5
|
-
*
|
|
6
|
-
* On init:
|
|
7
|
-
* 1. Verifies the Claude CLI is installed and authenticated
|
|
8
|
-
* 2. Starts the proxy (port 3456, or falls back to a random port if in use)
|
|
9
|
-
* 3. Registers cleanup handlers to stop the proxy on exit
|
|
10
|
-
* 4. Returns a `config` hook that injects the proxy's baseURL into
|
|
11
|
-
* the Anthropic provider so each opencode instance gets its own proxy.
|
|
12
|
-
*/
|
|
13
3
|
declare const ClaudeMaxPlugin: Plugin;
|
|
14
4
|
|
|
15
5
|
export { ClaudeMaxPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function l(
|
|
1
|
+
function l(t){return(n,r)=>t.app.log({body:{service:"opencode-with-claude",level:n,message:r}})}import{startProxyServer as d}from"opencode-claude-max-proxy";var y=process.platform==="win32",f=3456;async function u(t){let{port:n=f,log:r}=t,a=console.error;console.error=(...e)=>{let s=e.map(String).join(" ");if(s.startsWith("[PROXY]")){r("debug",s);return}a.apply(console,e)};let p=async e=>{try{return await d({port:e,host:"127.0.0.1",silent:!0})}catch(s){if(e!==0&&s instanceof Error&&"code"in s&&s.code==="EADDRINUSE")return await r("info",`Port ${e} in use, starting on a random port instead...`),d({port:0,host:"127.0.0.1",silent:!0});throw s}},i;try{i=await p(n)}catch(e){throw console.error=a,e}let o=i.server.address().port;return await r("info",`Claude Max proxy running on port ${o}`),{port:o,close:async()=>{console.error=a,await i.close()}}}function g(t){let n=!1,r=()=>{n||(n=!0,t.close())};process.on("exit",r),process.on("SIGINT",r),y||process.on("SIGTERM",r)}var L=async({client:t,$:n,directory:r})=>{let a=l(t),p=parseInt(process.env.CLAUDE_PROXY_PORT||"",10)||void 0,i=await u({port:p,log:a}),c=`http://127.0.0.1:${i.port}`;return await a("info",`proxy ready at ${c}`),g(i),{async config(o){o.provider??={},o.provider.anthropic??={},o.provider.anthropic.options??={},o.provider.anthropic.options.baseURL=c,o.provider.anthropic.options.apiKey="claude-max-proxy"}}};export{L as ClaudeMaxPlugin};
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-with-claude",
|
|
3
3
|
"description": "OpenCode plugin to use your Claude Max subscription via local proxy",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"opencode-claude-max-proxy": "^1.17.
|
|
9
|
+
"opencode-claude-max-proxy": "^1.17.1"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@opencode-ai/plugin": "^1.3.
|
|
12
|
+
"@opencode-ai/plugin": "^1.3.2",
|
|
13
13
|
"@types/node": "^25.5.0",
|
|
14
|
-
"tsup": "^8.
|
|
14
|
+
"tsup": "^8.5.1",
|
|
15
15
|
"typescript": "^6.0.2"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|