Skip to content

Commit b39cd64

Browse files
Serhii DziupinSerhii Dziupin
andcommitted
feat: Go-plan ($1) browser OAuth — no API key
Primary auth matches `cmd login`: Studio CLI callback posts a session credential for the Command Code Go plan. Laguna S 2.1 free stays $0 credits. Remove paste-API-key as the primary path. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
1 parent 1e5ec32 commit b39cd64

7 files changed

Lines changed: 406 additions & 59 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
- Initial release: Command Code OpenCode plugin
66
- Local OpenAI-compatible proxy → `api.commandcode.ai/alpha/generate`
7-
- Auth via Command Code CLI sync (`cmd login`) or API key
7+
- Auth via Command Code Go-plan browser OAuth (`cmd login`) — no Studio API key
88
- Default model: Laguna S 2.1 free (`poolside/laguna-s-2.1-free`)
99
- Tools/MCP park-resume, attachment plumbing, context compact, usage endpoints

‎README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</p>
1010

1111
<p align="center">
12-
<strong>Command Code inside OpenCode</strong> — CLI/API-key auth,<br>
12+
<strong>Command Code inside OpenCode</strong> — Go-plan ($1) browser login,<br>
1313
gateway proxy, free Laguna S 2.1, tools/MCP, attachments, compact, usage.
1414
</p>
1515

@@ -52,30 +52,31 @@ opencode plugin file://$PWD
5252

5353
## Authenticate
5454

55-
Requires [Command Code CLI](https://commandcode.ai/docs/quickstart) and a free account:
55+
Uses the **Command Code Go plan ($1/mo)** — same browser login as `cmd login`. No Studio API key.
5656

5757
```bash
5858
npm i -g command-code@latest
59-
cmd login
59+
cmd login # browser → Studio CLI auth (Go plan). Laguna S 2.1 is $0 credits.
60+
6061
opencode auth login --provider command-code
61-
# pick "Use Command Code CLI login" — or paste an API key
62+
# pick "Login with Command Code (Go $1)" — or "Use existing cmd login session"
6263
```
6364

64-
Env alternative: `COMMAND_CODE_API_KEY`.
65-
6665
Then:
6766

6867
```bash
6968
opencode run "Summarise this repository in five bullets." --model command-code/laguna-s-2.1-free
7069
```
7170

71+
Laguna S 2.1 free requires an active Go (or higher) account with credits on file; requests on that model still bill **$0**.
72+
7273
## Why this plugin
7374

7475
| | |
7576
|---|---|
7677
| **Gateway proxy** | Talks to `api.commandcode.ai/alpha/generate` — same transport as the `cmd` CLI. |
7778
| **Laguna S 2.1 free** | 256k context, reasoning, $0 while the deal lasts. |
78-
| **CLI / API auth** | Syncs `~/.commandcode/auth.json` or accepts `COMMAND_CODE_API_KEY`. |
79+
| **Go-plan auth** | Browser OAuth like `cmd login` ($1/mo). Syncs `~/.commandcode/auth.json`. No API key. |
7980
| **Agent-grade tools** | OpenCode tool calls park and resume; MCP-prefixed tools are tracked separately. |
8081
| **Attachments** | Images, PDFs, text/binary files from OpenCode. Text-only models get image placeholders (Command Code behavior). |
8182
| **Compact** | Context-fraction tips + tiered client compact before the 256k window overflows. |
@@ -103,7 +104,7 @@ OpenCode
103104
bun install
104105
bun run build
105106
bun run test # mocked gateway — attachments, tools, compact, usage
106-
bun run test:live # live Laguna S 2.1 (needs COMMAND_CODE_API_KEY)
107+
bun run test:live # live Laguna S 2.1 (needs `cmd login` / Go plan session)
107108
```
108109

109110
Debug: `OPENCODE_COMMANDCODE_DEBUG=1`.
@@ -112,7 +113,6 @@ Optional knobs:
112113

113114
- `OPENCODE_COMMANDCODE_PROXY_PORT` — fixed local proxy port (default `8797`)
114115
- `OPENCODE_COMMANDCODE_CWD` — working directory reported to the gateway
115-
- `COMMAND_CODE_API_KEY` — API key without CLI login
116116
- `COMMANDCODE_API_URL` — override API base (default `https://api.commandcode.ai`)
117117

118118
## License

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@otto-assistant/opencode-commandcode",
33
"version": "0.1.0",
4-
"description": "Command Code in OpenCode — CLI auth sync, gateway proxy, Laguna S 2.1, tools/MCP, attachments, compact, usage.",
4+
"description": "Command Code in OpenCode — Go-plan ($1) browser OAuth, gateway proxy, Laguna S 2.1, tools/MCP, attachments, compact, usage.",
55
"license": "MIT",
66
"type": "module",
77
"main": "./opencode-commandcode.js",

0 commit comments

Comments
 (0)