diff --git a/Makefile b/Makefile index 091bbd2..cbdcdd3 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ VERSION = $(shell git describe --tags) BUILDTIME = $(shell date +%Y.%m.%d_%H%M) default: install - regex --json /tmp/regex.55128216-e93b-4339-8854-622ca11af890.gemini-api-request.128.json + regex --json tmp/regex.55128216-e93b-4339-8854-622ca11af890.gemini-api-request.128.json vet: @GO111MODULE=off go vet diff --git a/argv.go b/argv.go index 375ca06..314adf4 100644 --- a/argv.go +++ b/argv.go @@ -11,9 +11,11 @@ var argv args type args struct { Uuid string `arg:"--uuid" help:"look at this uuid"` + Topic string `arg:"--topic" help:"set the topic"` JsonFile string `arg:"--json" help:"import a JSON file from gemini-cli"` Interact *EmptyCmd `arg:"subcommand:interact" help:"open env EDITOR"` Playback *PlaybackCmd `arg:"subcommand:playback" help:"dump your prior conversations to the terminal'"` + NewChat *PlaybackCmd `arg:"subcommand:newchat" help:"used by gemini-cli on startup"` Stats string `arg:"--stats" help:"add stats to a chat"` Force bool `arg:"--force" help:"try to strong arm things"` Verbose bool `arg:"--verbose" help:"show more output"` diff --git a/doNewChat.go b/doNewChat.go index adb0ee3..089b3df 100644 --- a/doNewChat.go +++ b/doNewChat.go @@ -7,9 +7,14 @@ import ( ) func doNewChat() { + if found := me.chats.FindByUuid(argv.Uuid); found != nil { + found.ChatName = argv.Topic + me.chats.ConfigSave() + return + } chat := &chatpb.Chat{ Uuid: argv.Uuid, - ChatName: "todo: set this", + ChatName: argv.Topic, Ctime: timestamppb.Now(), } diff --git a/main.go b/main.go index 16c2ea7..273a32f 100644 --- a/main.go +++ b/main.go @@ -98,6 +98,11 @@ func main() { okExit("") } + if argv.NewChat != nil { + doNewChat() + okExit("") + } + if argv.Playback != nil { if argv.Uuid != "" { showChat(argv.Uuid)