first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

59
cli/main.go Normal file
View File

@@ -0,0 +1,59 @@
package main
import (
"context"
"flag"
"fmt"
"os"
"github.com/maximhq/bifrost/cli/internal/app"
"github.com/maximhq/bifrost/cli/internal/update"
)
var (
version = "dev"
commit = "none"
)
// main is the CLI entry-point
func main() {
var cfgPath string
var noResume bool
var worktree string
flag.StringVar(&cfgPath, "config", "", "Path to config.json")
flag.BoolVar(&noResume, "no-resume", false, "Skip resume flow and open setup")
flag.StringVar(&worktree, "worktree", "", "Create a git worktree for the session (harness must support it)")
flag.Parse()
if args := flag.Args(); len(args) > 0 {
switch args[0] {
case "update":
if err := update.RunSelfUpdate(version); err != nil {
fmt.Fprintf(os.Stderr, "bifrost: %v\n", err)
os.Exit(1)
}
return
case "version":
fmt.Printf("bifrost %s (%s)\n", version, commit)
return
default:
fmt.Fprintf(os.Stderr, "bifrost: unknown command %q\n", args[0])
fmt.Fprintf(os.Stderr, "Available commands: update, version\n")
os.Exit(1)
}
}
a := app.New(os.Stdin, os.Stdout, os.Stderr, app.Options{
Version: version,
Commit: commit,
NoResume: noResume,
Config: cfgPath,
Worktree: worktree,
})
if err := a.Run(context.Background()); err != nil {
fmt.Fprintf(os.Stderr, "bifrost: %v\n", err)
os.Exit(1)
}
}