Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
jakethekoenig committed Feb 5, 2024
2 parents d33af5a + 02c8213 commit b5f5e2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rawdog/__main__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import argparse
import io
import os
import readline

from contextlib import redirect_stdout

from rawdog.llm_client import LLMClient
from rawdog.utils import history_file


llm_client = LLMClient() # Will prompt for API key if not found


Expand Down Expand Up @@ -71,14 +71,15 @@ def main():
readline.read_history_file(history_file)
readline.set_history_length(1000)

host = os.uname()[1]
if len(args.prompt) > 0:
rawdog(" ".join(args.prompt))
else:
banner()
while True:
try:
print("\nWhat can I do for you? (Ctrl-C to exit)")
prompt = input("> ")
prompt = input(f"{host}@{os.getcwd()} > ")
# Save history after each command to avoid losing it in case of crash
readline.write_history_file(history_file)
print("")
Expand Down

0 comments on commit b5f5e2e

Please sign in to comment.