Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/opencode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,25 @@ bun run lint
bun run format:check
```

### Build modes

Two build modes are available:

```bash
bun run build # Deploy: bun build → bundled dist/ with all deps inlined (core + xxhash-wasm)
bun run build:dev # Dev: tsc → individual dist/*.js files (requires workspace node_modules)
```

The default `build` uses `bun build` to bundle `@cortexkit/anthropic-auth-core` and all transitive dependencies into self-contained output files. No `node_modules/` needed at runtime — the plugin works via `file://` path in OpenCode config:

```json
{
"plugin": ["file:///path/to/anthropic-auth/packages/opencode"]
}
```

`@opencode-ai/plugin` remains external (peer dep provided by OpenCode).

Inspect package contents:

```bash
Expand Down
3 changes: 2 additions & 1 deletion packages/opencode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"LICENSE"
],
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.build.json",
"build": "rm -rf dist && bun build src/index.ts src/cli.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --minify && tsc -p tsconfig.build.json --emitDeclarationOnly",
"build:dev": "rm -rf dist && tsc -p tsconfig.build.json",
"dev": "bun ../../scripts/dev.ts",
"dev:clean": "bun ../../scripts/dev-clean.ts",
"extract": "bun ../../scripts/extract-system-prompt.ts",
Expand Down