From 7f8f5e3b9b37fccbb357b70e6490823a8b22ae7e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 30 Aug 2025 14:42:57 -0500 Subject: basic JSON parsing into genai struc --- main.go | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 4afcff4..6f91f27 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,8 @@ var ARGNAME string = "regex" var configSave bool func main() { + // f, _ := os.OpenFile("/tmp/regex.secret.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + // log.CaptureMode(f) me = new(mainType) gui.InitArg() me.pp = arg.MustParse(&argv) @@ -58,6 +60,14 @@ func main() { okExit("") } + if argv.Connect != nil { + err := doConnect() + if err != nil { + badExit(err) + } + okExit("") + } + if argv.Editor != nil { doEditor() okExit("") @@ -105,24 +115,29 @@ func main() { } if argv.Playback != nil { - if argv.Playback.Uuid != "" { - showChat(argv.Playback.Uuid) + if argv.Uuid != "" { + showChat(argv.Uuid) } else { doPlayback() } okExit("") } - // if opening the GUI, always check git for dirty repos - log.Info("look for 'auto' here") - // Find the "auto" chat. - for _, chat := range me.chats.GetChats() { - if chat.GetChatName() == "auto" { - prettyFormatChat(chat) - okExit("") + /* + // if opening the GUI, always check git for dirty repos + log.Info("look for 'auto' here") + // Find the "auto" chat. + for _, chat := range me.chats.GetChats() { + if chat.GetChatName() == "auto" { + prettyFormatChat(chat) + okExit("") + } } - } + */ // doGui() + + // by default, start interacting with gemini-cli + doEditor() okExit("") } -- cgit v1.2.3