opencode-claude-auth 0.5.3 → 0.5.5

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 CHANGED
@@ -1,12 +1,14 @@
1
1
  # opencode-claude-auth
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/opencode-claude-auth)](https://www.npmjs.com/package/opencode-claude-auth)
4
+ [![CI](https://github.com/griffinmartin/opencode-claude-auth/actions/workflows/ci.yml/badge.svg)](https://github.com/griffinmartin/opencode-claude-auth/actions/workflows/ci.yml)
5
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/opencode-claude-auth)](https://socket.dev/npm/package/opencode-claude-auth)
4
6
 
5
7
  OpenCode plugin that uses your existing Claude Code credentials — no separate login needed.
6
8
 
7
9
  ## How it works
8
10
 
9
- Claude Code stores OAuth tokens in the macOS Keychain (or `~/.claude/.credentials.json` on other platforms). This plugin reads those tokens and provides them to OpenCode via its auth hook, so you don't need to log in twice. When a token is about to expire, it re-reads credentials automatically. If they're still stale, it runs the Claude CLI to trigger a refresh. For OpenCode > 1.2.27, it also injects the Anthropic session prompt via the `experimental.chat.system.transform` hook.
11
+ Claude Code stores OAuth tokens in the macOS Keychain (or `~/.claude/.credentials.json` on other platforms). This plugin reads those tokens and writes them to OpenCode's `~/.local/share/opencode/auth.json`, so you don't need to log in twice. It re-syncs every 5 minutes to pick up token refreshes. If a token is near expiry, it runs the Claude CLI to trigger a refresh.
10
12
 
11
13
  ## Prerequisites
12
14
 
@@ -28,7 +30,7 @@ Fetch https://raw.githubusercontent.com/griffinmartin/opencode-claude-auth/main/
28
30
  ### Manual install
29
31
 
30
32
  ```bash
31
- npm install opencode-claude-auth
33
+ npm install -g opencode-claude-auth
32
34
  ```
33
35
 
34
36
  Then add to the `plugin` array in your `opencode.json`:
@@ -41,7 +43,7 @@ Then add to the `plugin` array in your `opencode.json`:
41
43
 
42
44
  ## Usage
43
45
 
44
- Just run OpenCode. The plugin reads your Claude Code credentials automatically and handles token refresh in the background.
46
+ Just run OpenCode. The plugin syncs your Claude Code credentials to OpenCode's auth.json and refreshes them in the background.
45
47
 
46
48
  ## Credential sources
47
49
 
@@ -63,12 +65,12 @@ The plugin checks these in order:
63
65
 
64
66
  ## How it works (technical)
65
67
 
66
- - Registers an OpenCode auth hook for the `anthropic` provider
67
- - Overrides the built-in `opencode-anthropic-auth` plugin
68
- - Returns a custom `fetch` wrapper that injects `Authorization: Bearer` headers
69
- - When a token is within 60 seconds of expiry, re-reads credentials from Keychain or file
70
- - If still expired, runs `claude -p . --model claude-haiku-4-5-20250514` to trigger a refresh
71
- - For OpenCode > 1.2.27, injects the Anthropic session prompt via `experimental.chat.system.transform`
68
+ - Reads OAuth tokens from macOS Keychain (`Claude Code-credentials` entry) or `~/.claude/.credentials.json` fallback
69
+ - Writes an `anthropic` entry to `~/.local/share/opencode/auth.json` in OpenCode's native OAuth format
70
+ - Preserves other provider entries already in auth.json
71
+ - Re-syncs credentials every 5 minutes in the background
72
+ - When a token is within 60 seconds of expiry, runs `claude` CLI to trigger a refresh
73
+ - If credentials are unavailable or unreadable, the plugin disables itself and OpenCode continues without Claude auth
72
74
 
73
75
  ## License
74
76
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,qBAAqB,CAAA;AAqF3D,QAAA,MAAM,MAAM,EAAE,MAuDb,CAAA;AAED,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAsEjD,QAAA,MAAM,MAAM,EAAE,MAmCb,CAAA;AAED,eAAe,MAAM,CAAA"}
package/dist/index.js CHANGED
@@ -1,28 +1,40 @@
1
1
  import { execSync } from "node:child_process";
2
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
3
- import { fileURLToPath } from "node:url";
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
3
  import { dirname, join } from "node:path";
5
4
  import { homedir } from "node:os";
6
5
  import { readClaudeCredentials } from "./keychain.js";
7
- function clearOpencodeAuth() {
8
- const authPaths = [
9
- join(homedir(), ".local", "share", "opencode", "auth.json"),
10
- join(process.env.APPDATA ?? homedir(), "opencode", "auth.json"),
11
- join(homedir(), ".opencode", "auth.json"),
12
- ];
13
- for (const path of authPaths) {
14
- try {
15
- if (existsSync(path)) {
16
- const raw = readFileSync(path, "utf-8");
17
- const auth = JSON.parse(raw);
18
- delete auth.anthropic;
19
- writeFileSync(path, JSON.stringify(auth), "utf-8");
6
+ function getAuthJsonPath() {
7
+ if (process.platform === "win32") {
8
+ const appData = process.env.LOCALAPPDATA ?? join(homedir(), "AppData", "Local");
9
+ return join(appData, "opencode", "auth.json");
10
+ }
11
+ return join(homedir(), ".local", "share", "opencode", "auth.json");
12
+ }
13
+ function syncAuthJson(creds) {
14
+ const authPath = getAuthJsonPath();
15
+ let auth = {};
16
+ if (existsSync(authPath)) {
17
+ const raw = readFileSync(authPath, "utf-8").trim();
18
+ if (raw) {
19
+ try {
20
+ auth = JSON.parse(raw);
21
+ }
22
+ catch {
23
+ // Malformed file, start fresh
20
24
  }
21
- }
22
- catch {
23
- // Non-fatal: may not have write permissions
24
25
  }
25
26
  }
27
+ auth.anthropic = {
28
+ type: "oauth",
29
+ access: creds.accessToken,
30
+ refresh: creds.refreshToken,
31
+ expires: creds.expiresAt,
32
+ };
33
+ const dir = dirname(authPath);
34
+ if (!existsSync(dir)) {
35
+ mkdirSync(dir, { recursive: true });
36
+ }
37
+ writeFileSync(authPath, JSON.stringify(auth, null, 2), "utf-8");
26
38
  }
27
39
  function refreshViaCli() {
28
40
  try {
@@ -37,92 +49,49 @@ function refreshViaCli() {
37
49
  // Non-fatal: Claude CLI may not be available
38
50
  }
39
51
  }
40
- function loadSessionPrompt() {
41
- try {
42
- const dir = dirname(fileURLToPath(import.meta.url));
43
- const promptPath = join(dir, "anthropic-prompt.txt");
44
- return readFileSync(promptPath, "utf-8");
52
+ function refreshIfNeeded() {
53
+ let creds = readClaudeCredentials();
54
+ if (creds && creds.expiresAt > Date.now() + 60_000) {
55
+ return creds;
45
56
  }
46
- catch {
47
- return "You are Claude Code, Anthropic's official CLI for Claude.";
57
+ // Token is expired or near expiry, try CLI refresh
58
+ refreshViaCli();
59
+ creds = readClaudeCredentials();
60
+ if (creds && creds.expiresAt > Date.now() + 60_000) {
61
+ return creds;
48
62
  }
63
+ return null;
49
64
  }
50
- function createAuthFetch(initial, onRefresh) {
51
- let current = initial;
52
- return async (fetchInput, init) => {
53
- if (current.expiresAt < Date.now() + 60_000) {
54
- const fresh = readClaudeCredentials();
55
- if (fresh && fresh.expiresAt > Date.now() + 60_000) {
56
- current = fresh;
57
- onRefresh(current);
58
- }
59
- else {
60
- refreshViaCli();
61
- const afterRefresh = readClaudeCredentials();
62
- if (afterRefresh && afterRefresh.expiresAt > Date.now() + 60_000) {
63
- current = afterRefresh;
64
- onRefresh(current);
65
- }
66
- else {
67
- throw new Error("opencode-claude-auth: Token expired and refresh failed. " +
68
- "Re-authenticate with Claude Code by running `claude` in your terminal.");
69
- }
70
- }
71
- }
72
- const headers = new Headers(init?.headers);
73
- headers.set("Authorization", `Bearer ${current.accessToken}`);
74
- return fetch(fetchInput, { ...init, headers });
75
- };
76
- }
77
- const plugin = async (input) => {
78
- const creds = readClaudeCredentials();
65
+ const SYNC_INTERVAL = 5 * 60 * 1000; // 5 minutes
66
+ const plugin = async () => {
67
+ let creds = null;
68
+ try {
69
+ creds = readClaudeCredentials();
70
+ }
71
+ catch (err) {
72
+ console.warn("opencode-claude-auth: Failed to read Claude Code credentials:", err instanceof Error ? err.message : err);
73
+ return {};
74
+ }
79
75
  if (!creds) {
76
+ console.warn("opencode-claude-auth: No Claude Code credentials found. " +
77
+ "Plugin disabled. Run `claude` to authenticate.");
80
78
  return {};
81
79
  }
82
- const auth = {
83
- provider: "anthropic",
84
- loader: async (_getAuth, _provider) => {
85
- clearOpencodeAuth();
86
- const initialCreds = readClaudeCredentials();
87
- if (!initialCreds) {
88
- throw new Error("opencode-claude-auth: Claude Code credentials not found. " +
89
- "Please authenticate with Claude Code first by running `claude` in your terminal.");
80
+ // Sync credentials to auth.json on startup
81
+ syncAuthJson(creds);
82
+ // Keep auth.json synced, refreshing via CLI if token is near expiry
83
+ setInterval(() => {
84
+ try {
85
+ const fresh = refreshIfNeeded();
86
+ if (fresh) {
87
+ syncAuthJson(fresh);
90
88
  }
91
- await input.client.auth.set({
92
- path: { id: "anthropic" },
93
- body: {
94
- type: "oauth",
95
- access: initialCreds.accessToken,
96
- refresh: initialCreds.refreshToken,
97
- expires: initialCreds.expiresAt,
98
- },
99
- });
100
- return {
101
- apiKey: "oauth",
102
- fetch: createAuthFetch(initialCreds, (updated) => {
103
- void input.client.auth.set({
104
- path: { id: "anthropic" },
105
- body: {
106
- type: "oauth",
107
- access: updated.accessToken,
108
- refresh: updated.refreshToken,
109
- expires: updated.expiresAt,
110
- },
111
- });
112
- }),
113
- };
114
- },
115
- methods: [],
116
- };
117
- return {
118
- auth,
119
- async "experimental.chat.system.transform"(hookInput, output) {
120
- if (hookInput.model.providerID !== "anthropic")
121
- return;
122
- const prompt = loadSessionPrompt();
123
- output.system.unshift(prompt);
124
- },
125
- };
89
+ }
90
+ catch {
91
+ // Non-fatal
92
+ }
93
+ }, SYNC_INTERVAL);
94
+ return {};
126
95
  };
127
96
  export default plugin;
128
97
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,aAAa,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A;YACrB,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,YAAY;QACd,CAAC;IACH,CAAC,EAAE,aAAa,CAAC,CAAA;IAEjB,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
package/installation.md CHANGED
@@ -45,7 +45,7 @@ This will prompt you to log in and store credentials in Keychain (macOS) or `~/.
45
45
  ### Step 1: Install the package
46
46
 
47
47
  ```bash
48
- npm install opencode-claude-auth
48
+ npm install -g opencode-claude-auth
49
49
  ```
50
50
 
51
51
  ### Step 2: Add to OpenCode configuration
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "opencode-claude-auth",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "OpenCode plugin that uses your Claude Code credentials — no separate login needed.",
5
+ "preferGlobal": true,
5
6
  "main": "dist/index.js",
6
7
  "module": "dist/index.js",
7
8
  "types": "dist/index.d.ts",