Compare commits
2 commits
25ed7d3f8d
...
51c8fed888
| Author | SHA1 | Date | |
|---|---|---|---|
| 51c8fed888 | |||
| 1312bf10c0 |
2 changed files with 4 additions and 6 deletions
4
main.go
4
main.go
|
|
@ -85,7 +85,7 @@ func main() {
|
||||||
case "fish":
|
case "fish":
|
||||||
fmt.Printf(`function _llm_shell_hint
|
fmt.Printf(`function _llm_shell_hint
|
||||||
set -l LLM_SUGGESTION_FILE (mktemp)
|
set -l LLM_SUGGESTION_FILE (mktemp)
|
||||||
llm-shell-hint %s query --output $LLM_SUGGESTION_FILE (commandline -b)
|
llm-shell-hint %s --output $LLM_SUGGESTION_FILE query (commandline -b)
|
||||||
set -l LLM_SUGGESTION (cat $LLM_SUGGESTION_FILE)
|
set -l LLM_SUGGESTION (cat $LLM_SUGGESTION_FILE)
|
||||||
rm $LLM_SUGGESTION_FILE
|
rm $LLM_SUGGESTION_FILE
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ bind ctrl-q _llm_shell_hint
|
||||||
case "bash":
|
case "bash":
|
||||||
fmt.Printf(`_llm_shell_hint() {
|
fmt.Printf(`_llm_shell_hint() {
|
||||||
local suggestion_file=$(mktemp)
|
local suggestion_file=$(mktemp)
|
||||||
llm-shell-hint %s query --output "$suggestion_file" -- "$READLINE_LINE"
|
llm-shell-hint %s --output "$suggestion_file" query -- "$READLINE_LINE"
|
||||||
local suggestion=$(<"$suggestion_file")
|
local suggestion=$(<"$suggestion_file")
|
||||||
rm "$suggestion_file"
|
rm "$suggestion_file"
|
||||||
|
|
||||||
|
|
|
||||||
6
tui.go
6
tui.go
|
|
@ -69,6 +69,7 @@ func initialModel(config *Config, query string, verbose bool) model {
|
||||||
|
|
||||||
l := list.New([]list.Item{}, delegate, width, 20)
|
l := list.New([]list.Item{}, delegate, width, 20)
|
||||||
l.SetShowTitle(false)
|
l.SetShowTitle(false)
|
||||||
|
l.SetShowHelp(false)
|
||||||
l.SetShowStatusBar(false)
|
l.SetShowStatusBar(false)
|
||||||
l.SetFilteringEnabled(false)
|
l.SetFilteringEnabled(false)
|
||||||
l.Title = "" // Set empty title
|
l.Title = "" // Set empty title
|
||||||
|
|
@ -85,7 +86,7 @@ func initialModel(config *Config, query string, verbose bool) model {
|
||||||
query: query,
|
query: query,
|
||||||
verbose: verbose,
|
verbose: verbose,
|
||||||
loading: true,
|
loading: true,
|
||||||
status: "Initializing...",
|
status: "Querying",
|
||||||
spinner: sp,
|
spinner: sp,
|
||||||
list: l,
|
list: l,
|
||||||
}
|
}
|
||||||
|
|
@ -114,10 +115,7 @@ func (m model) Init() tea.Cmd {
|
||||||
return tea.Batch(
|
return tea.Batch(
|
||||||
m.spinner.Tick,
|
m.spinner.Tick,
|
||||||
func() tea.Msg {
|
func() tea.Msg {
|
||||||
m.status = "Building prompt..."
|
|
||||||
prompt := buildPrompt(m.config, m.query)
|
prompt := buildPrompt(m.config, m.query)
|
||||||
|
|
||||||
m.status = "Querying LLM..."
|
|
||||||
commands, err := queryLLM(m.config, prompt, m.verbose)
|
commands, err := queryLLM(m.config, prompt, m.verbose)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue