Compare commits
5 Commits
7e69b1d83d
...
83d59c4095
Author | SHA1 | Date |
---|---|---|
|
83d59c4095 | |
|
d0a00107b9 | |
|
73e3cbef06 | |
|
2c7099c1cc | |
|
0228ce6afa |
|
@ -1,3 +1,4 @@
|
||||||
*.swp
|
*.swp
|
||||||
go.mod
|
go.mod
|
||||||
go.sum
|
go.sum
|
||||||
|
*.pb.go
|
||||||
|
|
9
Makefile
9
Makefile
|
@ -23,3 +23,12 @@ gemini-config:
|
||||||
|
|
||||||
gemini-go:
|
gemini-go:
|
||||||
~/go/bin/gemini playback
|
~/go/bin/gemini playback
|
||||||
|
|
||||||
|
add-BACnet:
|
||||||
|
~/go/bin/gemini --add log/BACnet.text
|
||||||
|
ls -lt ~/.config/gemini/
|
||||||
|
|
||||||
|
add-shell:
|
||||||
|
ls -lt ~/.config/gemini/
|
||||||
|
gemini --add log/2025-08-21-shell-v2.text
|
||||||
|
ls -lt ~/.config/gemini/
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package main;
|
||||||
|
|
||||||
|
message Row {
|
||||||
|
repeated string fields = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Table {
|
||||||
|
int32 columns = 1;
|
||||||
|
repeated Row rows = 2;
|
||||||
|
}
|
||||||
|
message Chat {
|
||||||
|
bool gemini = 1;
|
||||||
|
bool user = 2;
|
||||||
|
string content = 3;
|
||||||
|
repeated string mountpoints = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Chats { // `autogenpb:marshal` `autogenpb:mutex`
|
||||||
|
string uuid = 1; // `autogenpb:uuid:9fd31f10-c25d-4d66-bc8d-5f6eb7c79057`
|
||||||
|
string version = 2; // `autogenpb:version:v0.0.1`
|
||||||
|
repeated Chat Chats = 3; // THIS MUST BE Chat and then Chats
|
||||||
|
}
|
|
@ -60,7 +60,38 @@ func main() {
|
||||||
for _, toolCall := range chat.GetToolCalls() {
|
for _, toolCall := range chat.GetToolCalls() {
|
||||||
printToolCallBox(toolCall)
|
printToolCallBox(toolCall)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle the new CodeSnippet field.
|
||||||
|
if snippets := chat.GetSnippets(); snippets != nil {
|
||||||
|
logDir := filepath.Dir(filename)
|
||||||
|
for _, snippet := range snippets {
|
||||||
|
printCodeSnippet(snippet, logDir)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// printCodeSnippet formats a code snippet block by reading its content from a file.
|
||||||
|
func printCodeSnippet(snippet *chatpb.CodeSnippet, logDir string) {
|
||||||
|
snippetPath := filepath.Join(logDir, snippet.GetFilename())
|
||||||
|
|
||||||
|
codeBytes, err := os.ReadFile(snippetPath)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("┌─[ ERROR: Could not read snippet file %s ]─\n\n", snippetPath)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
code := string(codeBytes)
|
||||||
|
language := filepath.Base(snippet.GetFilename()) // Use the filename as the language for display
|
||||||
|
|
||||||
|
fmt.Printf("┌─[ Code Snippet: %s ]──────────────────────────────────\n", language)
|
||||||
|
|
||||||
|
// Print each line of the code indented.
|
||||||
|
for _, line := range strings.Split(strings.TrimSpace(code), "\n") {
|
||||||
|
fmt.Printf("│ %s\n", line)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("└─────────────────────────────────────────────────────────\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
// printToolCallBox handles the decorative formatting for a single tool call.
|
// printToolCallBox handles the decorative formatting for a single tool call.
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
uuid: "shell-path-log-02"
|
||||||
|
version: "v0.0.4 go.wit.com/lib/protobuf/chatpb"
|
||||||
|
Chats: {
|
||||||
|
from: USER
|
||||||
|
ctime: { seconds: 1724168400 }
|
||||||
|
ContentFile: "content/shell_v2_q1.content"
|
||||||
|
}
|
||||||
|
Chats: {
|
||||||
|
from: GEMINI
|
||||||
|
ctime: { seconds: 1724168460 }
|
||||||
|
ContentFile: "content/shell_v2_a1.content"
|
||||||
|
Snippets: {
|
||||||
|
filename: "content/shell_v2_a1.snippet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Chats: {
|
||||||
|
from: USER
|
||||||
|
ctime: { seconds: 1724168520 }
|
||||||
|
ContentFile: "content/shell_v2_q2.content"
|
||||||
|
}
|
||||||
|
Chats: {
|
||||||
|
from: GEMINI
|
||||||
|
ctime: { seconds: 1724168580 }
|
||||||
|
ContentFile: "content/shell_v2_a2.content"
|
||||||
|
Snippets: {
|
||||||
|
filename: "content/shell_v2_a2.snippet"
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,10 +3,10 @@ version: "v0.0.3 go.wit.com/lib/protobuf/chatpb"
|
||||||
Chats: {
|
Chats: {
|
||||||
from: USER
|
from: USER
|
||||||
ctime: { seconds: 1724166000 }
|
ctime: { seconds: 1724166000 }
|
||||||
content_file: "content/bacnet_q1.content"
|
ContentFile: "content/bacnet_q1.content"
|
||||||
}
|
}
|
||||||
Chats: {
|
Chats: {
|
||||||
from: GEMINI
|
from: GEMINI
|
||||||
ctime: { seconds: 1724166060 }
|
ctime: { seconds: 1724166060 }
|
||||||
content_file: "content/bacnet_a1.content"
|
ContentFile: "content/bacnet_a1.content"
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
You are absolutely right in your understanding, and your confusion is completely justified. The `PATH` variable **is** processed in order from left to right. The output you are seeing means that the `PATH` your shell is *actually* using is different from the one you've posted. The problem almost always comes from the shell startup files. The solution is to **prepend, don't append** your custom directories to the PATH.
|
|
@ -0,0 +1 @@
|
||||||
|
export PATH="/home/jcarr/go/bin:$PATH"
|
|
@ -0,0 +1 @@
|
||||||
|
You've found the root cause perfectly. This is a classic shell precedence issue. The order is: Aliases -> Keywords -> Functions -> Built-ins -> $PATH lookup. Your alias is being found at step 1, so the shell never even gets to step 5. The best solution is often to rename the alias in your `~/.bashrc` to something more specific, like `gemini-cli`.
|
|
@ -0,0 +1,5 @@
|
||||||
|
# To bypass the alias for a single command:
|
||||||
|
\gemini --version
|
||||||
|
|
||||||
|
# To rename the alias permanently in your ~/.bashrc:
|
||||||
|
alias gemini-cli='node /home/jcarr/go/src/github.com/google-gemini/gemini-cli/scripts/start.js'
|
|
@ -0,0 +1,2 @@
|
||||||
|
My PATH is: PATH=/home/jcarr/.local/bin/:/home/jcarr/jcarr/bin/:/home/jcarr/go/bin/:/sbin:/usr/sbin:/home/jcarr/go/bin:/usr/games:/home/jcarr/.local/bin/:/home/jcarr/go/bin/:/sbin:/usr/sbin:/home/jcarr/go/bin:/usr/games:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
|
||||||
|
but for some reason it is finding binaries in /usr/local/bin before /home/jcarr/go/bin. I thought the PATH was processed in order?
|
|
@ -0,0 +1,10 @@
|
||||||
|
I see the problem. gemini is an alias. I'm not sure how to resolve this problem
|
||||||
|
jcarr@framebook:~/go/src/gemini$ which gemini
|
||||||
|
/home/jcarr/go/bin/gemini
|
||||||
|
jcarr@framebook:~/go/src/gemini$ /home/jcarr/go/bin/gemini --version
|
||||||
|
gemini v0.0.1-3-ga10b75d Built on 2025.08.21_1551
|
||||||
|
jcarr@framebook:~/go/src/gemini$ gemini --version
|
||||||
|
Checking build status...
|
||||||
|
Build is up-to-date.
|
||||||
|
jcarr@framebook:~/go/src/gemini$ alias |grep gemini
|
||||||
|
alias gemini='node /home/jcarr/go/src/github.com/google-gemini/gemini-cli/scripts/start.js'
|
Loading…
Reference in New Issue