This commit is contained in:
Dax Raad
2025-05-17 21:31:42 -04:00
parent 96fbc37f01
commit a34d020bc6
26 changed files with 979 additions and 54 deletions

32
cmd/opencode/opencode.go Normal file
View File

@@ -0,0 +1,32 @@
package main
import (
"context"
"os"
"os/signal"
"github.com/sst/opencode/pkg/app"
"github.com/sst/opencode/pkg/server"
"golang.org/x/sync/errgroup"
)
func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
cwd, _ := os.Getwd()
app, err := app.New(ctx, cwd)
if err != nil {
panic(err)
}
server, err := server.New(app)
var wg errgroup.Group
wg.Go(func() error {
defer stop()
return server.Start(ctx)
})
<-ctx.Done()
wg.Wait()
}