Refactor: Rename gemini to regex throughout the codebase
This commit is contained in:
parent
0a28d985b8
commit
357c20027f
8
argv.go
8
argv.go
|
@ -13,9 +13,9 @@ type args struct {
|
||||||
Add string `arg:"--add" help:"add a new chat"`
|
Add string `arg:"--add" help:"add a new chat"`
|
||||||
Format *EmptyCmd `arg:"subcommand:format" help:"add a conversation"`
|
Format *EmptyCmd `arg:"subcommand:format" help:"add a conversation"`
|
||||||
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'"`
|
||||||
Output string `arg:"--output" help:"should get a string from gemini-cli"`
|
Output string `arg:"--output" help:"should get a string from regex-cli"`
|
||||||
Input string `arg:"--input" help:"should get a string from gemini-cli"`
|
Input string `arg:"--input" help:"should get a string from regex-cli"`
|
||||||
ImportFile string `arg:"--import" help:"import a file from gemini-cli"`
|
ImportFile string `arg:"--import" help:"import a file from regex-cli"`
|
||||||
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"`
|
||||||
Bash bool `arg:"--bash" help:"generate bash completion"`
|
Bash bool `arg:"--bash" help:"generate bash completion"`
|
||||||
|
@ -37,6 +37,6 @@ func (args) Version() string {
|
||||||
|
|
||||||
func (a args) Description() string {
|
func (a args) Description() string {
|
||||||
return `
|
return `
|
||||||
gemini -- interact with Googles' Gemini AI
|
regex -- interact with Googles' Gemini AI
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ func doImport(filename string) {
|
||||||
// If the "auto" chat is found, add the new entry.
|
// If the "auto" chat is found, add the new entry.
|
||||||
if autoChat != nil {
|
if autoChat != nil {
|
||||||
newEntry := &chatpb.ChatEntry{
|
newEntry := &chatpb.ChatEntry{
|
||||||
From: chatpb.Who_GEMINI,
|
From: chatpb.Who_REGEX,
|
||||||
Ctime: timestamppb.New(time.Now()),
|
Ctime: timestamppb.New(time.Now()),
|
||||||
ToolCalls: []*chatpb.ToolCall{
|
ToolCalls: []*chatpb.ToolCall{
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func doInput(s string) {
|
func doInput(s string) {
|
||||||
filename := "/tmp/gemini-input.log"
|
filename := "/tmp/regex-input.log"
|
||||||
f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func doOutput(s string) {
|
func doOutput(s string) {
|
||||||
filename := "/tmp/gemini-output.log"
|
filename := "/tmp/regex-output.log"
|
||||||
f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
@ -42,7 +42,7 @@ func doOutput(s string) {
|
||||||
// If the "auto" chat is found, add the new entry.
|
// If the "auto" chat is found, add the new entry.
|
||||||
if autoChat != nil {
|
if autoChat != nil {
|
||||||
newEntry := &chatpb.ChatEntry{
|
newEntry := &chatpb.ChatEntry{
|
||||||
From: chatpb.Who_GEMINI,
|
From: chatpb.Who_REGEX,
|
||||||
Content: s,
|
Content: s,
|
||||||
Ctime: timestamppb.New(time.Now()),
|
Ctime: timestamppb.New(time.Now()),
|
||||||
}
|
}
|
||||||
|
|
4
exit.go
4
exit.go
|
@ -11,12 +11,12 @@ import (
|
||||||
|
|
||||||
func okExit(thing string) {
|
func okExit(thing string) {
|
||||||
if thing != "" {
|
if thing != "" {
|
||||||
log.Info("gemini exit:", thing, "ok")
|
log.Info("regex exit:", thing, "ok")
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func badExit(err error) {
|
func badExit(err error) {
|
||||||
log.Info("gemini failed: ", err)
|
log.Info("regex failed: ", err)
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -26,7 +26,7 @@ var BUILDTIME string
|
||||||
var resources embed.FS
|
var resources embed.FS
|
||||||
|
|
||||||
// used for shell auto completion
|
// used for shell auto completion
|
||||||
var ARGNAME string = "gemini"
|
var ARGNAME string = "regex"
|
||||||
|
|
||||||
// using this for now. triggers config save
|
// using this for now. triggers config save
|
||||||
var configSave bool
|
var configSave bool
|
||||||
|
|
|
@ -56,7 +56,7 @@ func prettyFormatChat(chat *chatpb.Chat) {
|
||||||
|
|
||||||
// printContent handles the wrapping for the main conversational text.
|
// printContent handles the wrapping for the main conversational text.
|
||||||
func printContent(author, timestamp, content string) {
|
func printContent(author, timestamp, content string) {
|
||||||
// Right-align USER messages, left-align GEMINI messages.
|
// Right-align USER messages, left-align REGEX messages.
|
||||||
if author == "USER" {
|
if author == "USER" {
|
||||||
printRightAligned(author, timestamp, content)
|
printRightAligned(author, timestamp, content)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -14,6 +14,6 @@ var me *mainType
|
||||||
// this app's variables
|
// this app's variables
|
||||||
type mainType struct {
|
type mainType struct {
|
||||||
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
|
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
|
||||||
chats *chatpb.Chats // all our prior conversations with gemini
|
chats *chatpb.Chats // all our prior conversations with regex
|
||||||
myGui *gui.Node // the gui toolkit handle
|
myGui *gui.Node // the gui toolkit handle
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue