mirror of
https://github.com/bendtherules/opencode-multi-model.git
synced 2026-08-18 21:52:11 +00:00
plan: use bun 1
This commit is contained in:
@@ -479,7 +479,7 @@ export * from "./core/index";
|
||||
|
||||
```typescript
|
||||
// src/cli.ts
|
||||
#!/usr/bin/env node
|
||||
#!/usr/bin/env bun
|
||||
import { Command } from "commander";
|
||||
import { launchMultiModel } from "./core/launch";
|
||||
import { closeMultiModel } from "./core/close";
|
||||
@@ -596,7 +596,7 @@ export { openTool, closeTool };
|
||||
// package.json scripts
|
||||
{
|
||||
"scripts": {
|
||||
"build": "bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm",
|
||||
"build": "bun build src/index.ts src/cli.ts --outdir dist --target bun --format esm --experimental-dts",
|
||||
"test": "bun test",
|
||||
"prepublishOnly": "bun run build"
|
||||
}
|
||||
@@ -642,7 +642,9 @@ npm install -g @username/opencode-multi-model
|
||||
opencode-multi-model open my-session -m openai/gpt-4o
|
||||
```
|
||||
|
||||
### As Project Tool (for development)
|
||||
### As Project Tool
|
||||
|
||||
If you installed it via NPM and want to use it as a project tool, import it from the package:
|
||||
|
||||
```typescript
|
||||
// .opencode/tools/multi-model.ts
|
||||
@@ -650,6 +652,15 @@ import { openTool, closeTool } from "@username/opencode-multi-model"
|
||||
export { openTool, closeTool }
|
||||
```
|
||||
|
||||
If you are developing this package locally and want to test it in a project without publishing, import via relative paths:
|
||||
|
||||
```typescript
|
||||
// .opencode/tools/multi-model.ts
|
||||
import { openTool } from "../../src/tools/open"
|
||||
import { closeTool } from "../../src/tools/close"
|
||||
export { openTool, closeTool }
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Plugin Usage
|
||||
@@ -773,13 +784,13 @@ This allows testing the tool without publishing to npm.
|
||||
3. **CLI Test**:
|
||||
```bash
|
||||
# Test open
|
||||
node dist/cli.js open test-session -m openai/gpt-4o
|
||||
bun dist/cli.js open test-session -m openai/gpt-4o
|
||||
|
||||
# Test close
|
||||
node dist/cli.js close test-session
|
||||
bun dist/cli.js close test-session
|
||||
|
||||
# Test env var
|
||||
OPENCODE_MULTI_MODEL_BINARY=kilo node dist/cli.js open test-session -m openai/gpt-4o
|
||||
OPENCODE_MULTI_MODEL_BINARY=kilo bun dist/cli.js open test-session -m openai/gpt-4o
|
||||
```
|
||||
4. **Plugin Test**:
|
||||
- Link package locally with `bun link`
|
||||
|
||||
Reference in New Issue
Block a user