minor cleanups

This commit is contained in:
Jeff Carr 2025-08-30 16:17:01 -05:00
parent b750fb9252
commit 6888512b3b
4 changed files with 14 additions and 2 deletions

View File

@ -2,7 +2,7 @@ VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M) BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
default: install 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: vet:
@GO111MODULE=off go vet @GO111MODULE=off go vet

View File

@ -11,9 +11,11 @@ var argv args
type args struct { type args struct {
Uuid string `arg:"--uuid" help:"look at this uuid"` 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"` JsonFile string `arg:"--json" help:"import a JSON file from gemini-cli"`
Interact *EmptyCmd `arg:"subcommand:interact" help:"open env EDITOR"` Interact *EmptyCmd `arg:"subcommand:interact" help:"open env EDITOR"`
Playback *PlaybackCmd `arg:"subcommand:playback" help:"dump your prior conversations to the terminal'"` 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"` Stats string `arg:"--stats" help:"add stats to a chat"`
Force bool `arg:"--force" help:"try to strong arm things"` Force bool `arg:"--force" help:"try to strong arm things"`
Verbose bool `arg:"--verbose" help:"show more output"` Verbose bool `arg:"--verbose" help:"show more output"`

View File

@ -7,9 +7,14 @@ import (
) )
func doNewChat() { func doNewChat() {
if found := me.chats.FindByUuid(argv.Uuid); found != nil {
found.ChatName = argv.Topic
me.chats.ConfigSave()
return
}
chat := &chatpb.Chat{ chat := &chatpb.Chat{
Uuid: argv.Uuid, Uuid: argv.Uuid,
ChatName: "todo: set this", ChatName: argv.Topic,
Ctime: timestamppb.Now(), Ctime: timestamppb.Now(),
} }

View File

@ -98,6 +98,11 @@ func main() {
okExit("") okExit("")
} }
if argv.NewChat != nil {
doNewChat()
okExit("")
}
if argv.Playback != nil { if argv.Playback != nil {
if argv.Uuid != "" { if argv.Uuid != "" {
showChat(argv.Uuid) showChat(argv.Uuid)