File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env bun
22
33import { $ } from "bun"
4- import { createOpencode } from "@opencode-ai/sdk"
4+ import { createOpencodeClient , createOpencodeServer } from "@opencode-ai/sdk"
55import { Script } from "@opencode-ai/script"
66
77const notes = [ ] as string [ ]
@@ -24,7 +24,15 @@ if (!Script.preview) {
2424 . filter ( ( line ) => line && ! line . match ( / ^ \w + ( i g n o r e : | t e s t : | c h o r e : ) / i) )
2525 . join ( "\n" )
2626
27- const opencode = await createOpencode ( )
27+ createOpencodeServer ( {
28+ port : 4096 ,
29+ } ) . catch ( ( ) => { } )
30+ await new Promise ( ( resolve ) => setTimeout ( resolve , 1_000 ) )
31+ const opencode = {
32+ client : createOpencodeClient ( {
33+ baseUrl : `http://127.0.0.1:4096` ,
34+ } ) ,
35+ }
2836 const session = await opencode . client . session . create ( )
2937 console . log ( "generating changelog since " + previous )
3038 const raw = await opencode . client . session
@@ -68,7 +76,6 @@ if (!Script.preview) {
6876 }
6977 }
7078 console . log ( notes )
71- opencode . server . close ( )
7279}
7380
7481const pkgjsons = await Array . fromAsync (
You can’t perform that action at this time.
0 commit comments