@hypeitnow/opencode-claude-auth 1.6.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/LICENSE +21 -0
- package/README.md +238 -0
- package/dist/anthropic-prompt.txt +166 -0
- package/dist/betas.d.ts +9 -0
- package/dist/betas.d.ts.map +1 -0
- package/dist/betas.js +102 -0
- package/dist/betas.js.map +1 -0
- package/dist/credentials.d.ts +29 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +313 -0
- package/dist/credentials.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +495 -0
- package/dist/index.js.map +1 -0
- package/dist/keychain.d.ts +23 -0
- package/dist/keychain.d.ts.map +1 -0
- package/dist/keychain.js +365 -0
- package/dist/keychain.js.map +1 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +74 -0
- package/dist/logger.js.map +1 -0
- package/dist/model-config.d.ts +22 -0
- package/dist/model-config.d.ts.map +1 -0
- package/dist/model-config.js +44 -0
- package/dist/model-config.js.map +1 -0
- package/dist/oauth.d.ts +31 -0
- package/dist/oauth.d.ts.map +1 -0
- package/dist/oauth.js +158 -0
- package/dist/oauth.js.map +1 -0
- package/dist/pkce.d.ts +6 -0
- package/dist/pkce.d.ts.map +1 -0
- package/dist/pkce.js +23 -0
- package/dist/pkce.js.map +1 -0
- package/dist/plugin-config.d.ts +45 -0
- package/dist/plugin-config.d.ts.map +1 -0
- package/dist/plugin-config.js +66 -0
- package/dist/plugin-config.js.map +1 -0
- package/dist/signing.d.ts +31 -0
- package/dist/signing.d.ts.map +1 -0
- package/dist/signing.js +55 -0
- package/dist/signing.js.map +1 -0
- package/dist/transforms.d.ts +14 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/transforms.js +271 -0
- package/dist/transforms.js.map +1 -0
- package/installation.md +98 -0
- package/opencode-claude-auth.js +2 -0
- package/package.json +79 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { buildBillingHeaderValue } from "./signing.js";
|
|
2
|
+
import { config, getModelOverride } from "./model-config.js";
|
|
3
|
+
const TOOL_PREFIX = "mcp_";
|
|
4
|
+
/**
|
|
5
|
+
* Prefix a tool name with TOOL_PREFIX and uppercase the first character.
|
|
6
|
+
* Claude Code uses PascalCase tool names (e.g. mcp_Bash, mcp_Read);
|
|
7
|
+
* lowercase names (mcp_bash, mcp_read) are flagged as non-Claude-Code clients.
|
|
8
|
+
*/
|
|
9
|
+
function prefixName(name) {
|
|
10
|
+
return `${TOOL_PREFIX}${name.charAt(0).toUpperCase()}${name.slice(1)}`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Reverse prefixName: strip TOOL_PREFIX and restore the original leading case.
|
|
14
|
+
*/
|
|
15
|
+
function unprefixName(name) {
|
|
16
|
+
return `${name.charAt(0).toLowerCase()}${name.slice(1)}`;
|
|
17
|
+
}
|
|
18
|
+
const SYSTEM_IDENTITY = "You are Claude Code, Anthropic's official CLI for Claude.";
|
|
19
|
+
export function repairToolPairs(messages) {
|
|
20
|
+
// Collect all tool_use ids and tool_result tool_use_ids
|
|
21
|
+
const toolUseIds = new Set();
|
|
22
|
+
const toolResultIds = new Set();
|
|
23
|
+
for (const message of messages) {
|
|
24
|
+
if (!Array.isArray(message.content))
|
|
25
|
+
continue;
|
|
26
|
+
for (const block of message.content) {
|
|
27
|
+
const id = block["id"];
|
|
28
|
+
if (block.type === "tool_use" && typeof id === "string") {
|
|
29
|
+
toolUseIds.add(id);
|
|
30
|
+
}
|
|
31
|
+
const toolUseId = block["tool_use_id"];
|
|
32
|
+
if (block.type === "tool_result" && typeof toolUseId === "string") {
|
|
33
|
+
toolResultIds.add(toolUseId);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Find orphaned IDs
|
|
38
|
+
const orphanedUses = new Set();
|
|
39
|
+
for (const id of toolUseIds) {
|
|
40
|
+
if (!toolResultIds.has(id))
|
|
41
|
+
orphanedUses.add(id);
|
|
42
|
+
}
|
|
43
|
+
const orphanedResults = new Set();
|
|
44
|
+
for (const id of toolResultIds) {
|
|
45
|
+
if (!toolUseIds.has(id))
|
|
46
|
+
orphanedResults.add(id);
|
|
47
|
+
}
|
|
48
|
+
// Early return if nothing to fix
|
|
49
|
+
if (orphanedUses.size === 0 && orphanedResults.size === 0) {
|
|
50
|
+
return messages;
|
|
51
|
+
}
|
|
52
|
+
// Filter orphaned blocks and remove messages with empty content arrays
|
|
53
|
+
return messages
|
|
54
|
+
.map((message) => {
|
|
55
|
+
if (!Array.isArray(message.content))
|
|
56
|
+
return message;
|
|
57
|
+
const filtered = message.content.filter((block) => {
|
|
58
|
+
const id = block["id"];
|
|
59
|
+
if (block.type === "tool_use" && typeof id === "string") {
|
|
60
|
+
return !orphanedUses.has(id);
|
|
61
|
+
}
|
|
62
|
+
const toolUseId = block["tool_use_id"];
|
|
63
|
+
if (block.type === "tool_result" && typeof toolUseId === "string") {
|
|
64
|
+
return !orphanedResults.has(toolUseId);
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
});
|
|
68
|
+
return { ...message, content: filtered };
|
|
69
|
+
})
|
|
70
|
+
.filter((message) => !(Array.isArray(message.content) && message.content.length === 0));
|
|
71
|
+
}
|
|
72
|
+
export function transformBody(body) {
|
|
73
|
+
if (typeof body !== "string") {
|
|
74
|
+
return body;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const parsed = JSON.parse(body);
|
|
78
|
+
// --- Billing header: inject as system[0] (no cache_control) ---
|
|
79
|
+
const version = process.env.ANTHROPIC_CLI_VERSION ?? config.ccVersion;
|
|
80
|
+
const entrypoint = process.env.CLAUDE_CODE_ENTRYPOINT ?? "sdk-cli";
|
|
81
|
+
const billingHeader = buildBillingHeaderValue((parsed.messages ?? []), version, entrypoint);
|
|
82
|
+
if (!Array.isArray(parsed.system)) {
|
|
83
|
+
parsed.system = [];
|
|
84
|
+
}
|
|
85
|
+
// Remove any existing billing header entries
|
|
86
|
+
parsed.system = parsed.system.filter((e) => !(e.type === "text" &&
|
|
87
|
+
typeof e.text === "string" &&
|
|
88
|
+
e.text.startsWith("x-anthropic-billing-header")));
|
|
89
|
+
// Insert billing header as system[0], without cache_control
|
|
90
|
+
parsed.system.unshift({ type: "text", text: billingHeader });
|
|
91
|
+
// --- Split identity prefix into its own system entry ---
|
|
92
|
+
// OpenCode's system.transform hook prepends the identity string, but
|
|
93
|
+
// OpenCode then concatenates all system entries into a single text block.
|
|
94
|
+
// Anthropic's API requires the identity string as a separate entry for
|
|
95
|
+
// OAuth validation (see issue #98).
|
|
96
|
+
const splitSystem = [];
|
|
97
|
+
for (const entry of parsed.system) {
|
|
98
|
+
if (entry.type === "text" &&
|
|
99
|
+
typeof entry.text === "string" &&
|
|
100
|
+
entry.text.startsWith(SYSTEM_IDENTITY) &&
|
|
101
|
+
entry.text.length > SYSTEM_IDENTITY.length) {
|
|
102
|
+
const rest = entry.text
|
|
103
|
+
.slice(SYSTEM_IDENTITY.length)
|
|
104
|
+
.replace(/^\n+/, "");
|
|
105
|
+
// Preserve all properties except text (e.g. cache_control)
|
|
106
|
+
const { text: _text, ...entryProps } = entry;
|
|
107
|
+
// Only keep cache_control on the remainder block to avoid exceeding
|
|
108
|
+
// the API limit of 4 cache_control blocks per request.
|
|
109
|
+
const { cache_control: _cc, ...identityProps } = entryProps;
|
|
110
|
+
splitSystem.push({ ...identityProps, text: SYSTEM_IDENTITY });
|
|
111
|
+
if (rest.length > 0) {
|
|
112
|
+
splitSystem.push({ ...entryProps, text: rest });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
splitSystem.push(entry);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
parsed.system = splitSystem;
|
|
120
|
+
// --- Relocate non-core system entries to user messages ---
|
|
121
|
+
// Anthropic's API now validates the system prompt for OAuth-authenticated
|
|
122
|
+
// requests that use Claude Code billing. Third-party system prompts
|
|
123
|
+
// (like OpenCode's) trigger a 400 "out of extra usage" rejection when
|
|
124
|
+
// they appear inside the system[] array alongside the identity prefix.
|
|
125
|
+
//
|
|
126
|
+
// Work-around: keep only the billing header and identity prefix in
|
|
127
|
+
// system[], and prepend all other system content to the first user
|
|
128
|
+
// message where it is functionally equivalent but avoids the check.
|
|
129
|
+
const BILLING_PREFIX = "x-anthropic-billing-header";
|
|
130
|
+
const keptSystem = [];
|
|
131
|
+
const movedTexts = [];
|
|
132
|
+
for (const entry of parsed.system) {
|
|
133
|
+
const txt = typeof entry === "string" ? entry : (entry.text ?? "");
|
|
134
|
+
if (txt.startsWith(BILLING_PREFIX) || txt.startsWith(SYSTEM_IDENTITY)) {
|
|
135
|
+
keptSystem.push(entry);
|
|
136
|
+
}
|
|
137
|
+
else if (txt.length > 0) {
|
|
138
|
+
movedTexts.push(txt);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (movedTexts.length > 0 && Array.isArray(parsed.messages)) {
|
|
142
|
+
const firstUser = parsed.messages.find((m) => m.role === "user");
|
|
143
|
+
if (firstUser) {
|
|
144
|
+
parsed.system = keptSystem;
|
|
145
|
+
const prefix = movedTexts.join("\n\n");
|
|
146
|
+
if (typeof firstUser.content === "string") {
|
|
147
|
+
firstUser.content = prefix + "\n\n" + firstUser.content;
|
|
148
|
+
}
|
|
149
|
+
else if (Array.isArray(firstUser.content)) {
|
|
150
|
+
firstUser.content.unshift({ type: "text", text: prefix });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Strip effort for models that don't support it (e.g. haiku).
|
|
155
|
+
// OpenCode sends { output_config: { effort: "high" } } but haiku
|
|
156
|
+
// rejects the effort parameter with a 400 error.
|
|
157
|
+
const modelId = parsed.model ?? "";
|
|
158
|
+
const override = getModelOverride(modelId);
|
|
159
|
+
if (override?.disableEffort) {
|
|
160
|
+
if (parsed.output_config) {
|
|
161
|
+
delete parsed.output_config.effort;
|
|
162
|
+
if (Object.keys(parsed.output_config).length === 0) {
|
|
163
|
+
delete parsed.output_config;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (parsed.thinking && "effort" in parsed.thinking) {
|
|
167
|
+
delete parsed.thinking.effort;
|
|
168
|
+
if (Object.keys(parsed.thinking).length === 0) {
|
|
169
|
+
delete parsed.thinking;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Anthropic's OAuth billing validation rejects lowercase tool names
|
|
174
|
+
// when multiple tools are present. Claude Code uses PascalCase after
|
|
175
|
+
// the mcp_ prefix (e.g. mcp_Bash, mcp_Read). Apply the same convention.
|
|
176
|
+
if (Array.isArray(parsed.tools)) {
|
|
177
|
+
parsed.tools = parsed.tools.map((tool) => ({
|
|
178
|
+
...tool,
|
|
179
|
+
name: tool.name ? prefixName(tool.name) : tool.name,
|
|
180
|
+
}));
|
|
181
|
+
}
|
|
182
|
+
if (Array.isArray(parsed.messages)) {
|
|
183
|
+
parsed.messages = parsed.messages.map((message) => {
|
|
184
|
+
if (!Array.isArray(message.content)) {
|
|
185
|
+
return message;
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
...message,
|
|
189
|
+
content: message.content.map((block) => {
|
|
190
|
+
if (block.type !== "tool_use" || typeof block.name !== "string") {
|
|
191
|
+
return block;
|
|
192
|
+
}
|
|
193
|
+
return { ...block, name: prefixName(block.name) };
|
|
194
|
+
}),
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (Array.isArray(parsed.messages)) {
|
|
199
|
+
parsed.messages = repairToolPairs(parsed.messages);
|
|
200
|
+
}
|
|
201
|
+
return JSON.stringify(parsed);
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
return body;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
export function stripToolPrefix(text) {
|
|
208
|
+
return text.replace(/"name"\s*:\s*"mcp_([^"]+)"/g, (_match, name) => `"name": "${unprefixName(name)}"`);
|
|
209
|
+
}
|
|
210
|
+
export function transformResponseStream(response) {
|
|
211
|
+
if (!response.body) {
|
|
212
|
+
return response;
|
|
213
|
+
}
|
|
214
|
+
// Don't wrap error responses through the SSE parser — pass them through
|
|
215
|
+
// with only tool-prefix stripping on the raw body. This preserves error
|
|
216
|
+
// messages for OpenCode / AI SDK to handle properly.
|
|
217
|
+
if (!response.ok) {
|
|
218
|
+
const reader = response.body.getReader();
|
|
219
|
+
const decoder = new TextDecoder();
|
|
220
|
+
const encoder = new TextEncoder();
|
|
221
|
+
const passthrough = new ReadableStream({
|
|
222
|
+
async pull(controller) {
|
|
223
|
+
const { done, value } = await reader.read();
|
|
224
|
+
if (done) {
|
|
225
|
+
controller.close();
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const text = decoder.decode(value, { stream: true });
|
|
229
|
+
controller.enqueue(encoder.encode(stripToolPrefix(text)));
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
return new Response(passthrough, {
|
|
233
|
+
status: response.status,
|
|
234
|
+
statusText: response.statusText,
|
|
235
|
+
headers: response.headers,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
const reader = response.body.getReader();
|
|
239
|
+
const decoder = new TextDecoder();
|
|
240
|
+
const encoder = new TextEncoder();
|
|
241
|
+
let buffer = "";
|
|
242
|
+
const stream = new ReadableStream({
|
|
243
|
+
async pull(controller) {
|
|
244
|
+
for (;;) {
|
|
245
|
+
const boundary = buffer.indexOf("\n\n");
|
|
246
|
+
if (boundary !== -1) {
|
|
247
|
+
const completeEvent = buffer.slice(0, boundary + 2);
|
|
248
|
+
buffer = buffer.slice(boundary + 2);
|
|
249
|
+
controller.enqueue(encoder.encode(stripToolPrefix(completeEvent)));
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const { done, value } = await reader.read();
|
|
253
|
+
if (done) {
|
|
254
|
+
if (buffer) {
|
|
255
|
+
controller.enqueue(encoder.encode(stripToolPrefix(buffer)));
|
|
256
|
+
buffer = "";
|
|
257
|
+
}
|
|
258
|
+
controller.close();
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
buffer += decoder.decode(value, { stream: true });
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
return new Response(stream, {
|
|
266
|
+
status: response.status,
|
|
267
|
+
statusText: response.statusText,
|
|
268
|
+
headers: response.headers,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
//# sourceMappingURL=transforms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transforms.js","sourceRoot":"","sources":["../src/transforms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,MAAM,WAAW,GAAG,MAAM,CAAA;AAE1B;;;;GAIG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,GAAG,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AACxE,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC1D,CAAC;AAED,MAAM,eAAe,GACnB,2DAA2D,CAAA;AAS7D,MAAM,UAAU,eAAe,CAAC,QAAmB;IACjD,wDAAwD;IACxD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;IACpC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAA;IAEvC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,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AM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;gBAE3C,IAAI,IAAI,EAAE,CAAC;oBACT,IAAI,MAAM,EAAE,CAAC;wBACX,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;wBAC3D,MAAM,GAAG,EAAE,CAAA;oBACb,CAAC;oBACD,UAAU,CAAC,KAAK,EAAE,CAAA;oBAClB,OAAM;gBACR,CAAC;gBAED,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE;QAC1B,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO;KAC1B,CAAC,CAAA;AACJ,CAAC"}
|
package/installation.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Install opencode-claude-auth
|
|
2
|
+
|
|
3
|
+
These instructions are designed for AI coding agents.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Before installing, verify you have OpenCode and Claude Code installed and authenticated.
|
|
8
|
+
|
|
9
|
+
### Check OpenCode version
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
opencode --version
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You should see a version number (e.g., `1.2.28`).
|
|
16
|
+
|
|
17
|
+
### Check Claude Code credentials (macOS)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
security find-generic-password -s "Claude Code-credentials" -w
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
If this returns credentials, you're authenticated. If it fails or returns nothing, try the fallback:
|
|
24
|
+
|
|
25
|
+
### Check Claude Code credentials (fallback for all platforms)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cat ~/.claude/.credentials.json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If this file exists and contains valid JSON, you're authenticated.
|
|
32
|
+
|
|
33
|
+
### If credentials don't exist
|
|
34
|
+
|
|
35
|
+
Run Claude Code to authenticate:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
claude
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This will prompt you to log in and store credentials in Keychain (macOS) or `~/.claude/.credentials.json` (other platforms).
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
### Step 1: Add to OpenCode configuration
|
|
46
|
+
|
|
47
|
+
Edit the OpenCode configuration file at `~/.config/opencode/opencode.json`.
|
|
48
|
+
|
|
49
|
+
Add `opencode-claude-auth@latest` to the `plugin` array:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"plugin": ["opencode-claude-auth@latest"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or run this command to do it automatically:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
node -e "
|
|
61
|
+
const fs = require('fs'), p = require('path').join(require('os').homedir(), '.config/opencode/opencode.json');
|
|
62
|
+
const c = fs.existsSync(p) ? JSON.parse(fs.readFileSync(p,'utf8')) : {};
|
|
63
|
+
c.plugin = [...new Set([...(Array.isArray(c.plugin) ? c.plugin : []), 'opencode-claude-auth@latest'])];
|
|
64
|
+
fs.mkdirSync(require('path').dirname(p), {recursive:true});
|
|
65
|
+
fs.writeFileSync(p, JSON.stringify(c, null, 2));
|
|
66
|
+
console.log('Added opencode-claude-auth@latest to', p);
|
|
67
|
+
"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The `@latest` tag ensures OpenCode always pulls the newest version on startup. No manual `npm install` is needed — OpenCode [automatically installs npm plugins using Bun at startup](https://opencode.ai/docs/plugins/#how-plugins-are-installed).
|
|
71
|
+
|
|
72
|
+
### Step 2: Verification
|
|
73
|
+
|
|
74
|
+
Verify the plugin was added:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cat ~/.config/opencode/opencode.json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
You should see `opencode-claude-auth@latest` in the `plugin` array.
|
|
81
|
+
|
|
82
|
+
## Upgrading
|
|
83
|
+
|
|
84
|
+
If you previously installed `opencode-claude-auth` without the `@latest` tag, update your config to use `opencode-claude-auth@latest` as shown above.
|
|
85
|
+
|
|
86
|
+
If the plugin isn't picking up a new version, clear the cached package and restart OpenCode:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
rm -rf ~/.cache/opencode/packages/opencode-claude-auth@latest/
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Done
|
|
93
|
+
|
|
94
|
+
The plugin is now installed and configured. When you run OpenCode, it will automatically use your Claude Code credentials — no separate login needed.
|
|
95
|
+
|
|
96
|
+
## Troubleshooting
|
|
97
|
+
|
|
98
|
+
If you encounter issues, see the [main README troubleshooting section](README.md#troubleshooting).
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hypeitnow/opencode-claude-auth",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "OpenCode plugin that uses your Claude Code credentials — no separate login needed. Fork with OAuth fallback for org-locked accounts.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"anthropic",
|
|
7
|
+
"auth",
|
|
8
|
+
"claude",
|
|
9
|
+
"opencode",
|
|
10
|
+
"plugin"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/hypeitnow/opencode-claude-auth.git"
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"opencode-claude-auth.js",
|
|
22
|
+
"dist",
|
|
23
|
+
"installation.md"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"main": "opencode-claude-auth.js",
|
|
27
|
+
"module": "opencode-claude-auth.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./opencode-claude-auth.js"
|
|
33
|
+
},
|
|
34
|
+
"./server": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./opencode-claude-auth.js"
|
|
37
|
+
},
|
|
38
|
+
"./claude-auth-plugin": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"import": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./claude-auth-plugin.js": {
|
|
43
|
+
"types": "./dist/index.d.ts",
|
|
44
|
+
"import": "./dist/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./opencode-claude-auth": {
|
|
47
|
+
"types": "./dist/index.d.ts",
|
|
48
|
+
"import": "./dist/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./opencode-claude-auth.js": {
|
|
51
|
+
"types": "./dist/index.d.ts",
|
|
52
|
+
"import": "./dist/index.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "tsc && cp src/anthropic-prompt.txt dist/",
|
|
57
|
+
"test": "node --test --experimental-strip-types src/**/*.test.ts",
|
|
58
|
+
"test:models": "pnpm run build && node scripts/test-models.ts",
|
|
59
|
+
"intercept": "pnpm run build && node --experimental-strip-types scripts/intercept-claude.ts",
|
|
60
|
+
"intercept:all": "pnpm run build && node --experimental-strip-types scripts/intercept-claude.ts --all",
|
|
61
|
+
"intercept:update": "pnpm run build && node --experimental-strip-types scripts/intercept-claude.ts --all --update",
|
|
62
|
+
"validate:oauth": "pnpm run build && node --experimental-strip-types scripts/validate-oauth-refresh.ts",
|
|
63
|
+
"lint": "oxlint && oxfmt --check .",
|
|
64
|
+
"lint:fix": "oxlint --fix . && oxfmt --write .",
|
|
65
|
+
"format": "oxfmt --write .",
|
|
66
|
+
"prepublishOnly": "pnpm run build && pnpm test"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@opencode-ai/plugin": "latest",
|
|
70
|
+
"@types/node": "^25.5.0",
|
|
71
|
+
"oxfmt": "0.41.0",
|
|
72
|
+
"oxlint": "1.56.0",
|
|
73
|
+
"typescript": "^5.0.0"
|
|
74
|
+
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"@opencode-ai/plugin": "*"
|
|
77
|
+
},
|
|
78
|
+
"packageManager": "pnpm@10.32.1"
|
|
79
|
+
}
|