Skip to content

Commit

Permalink
add current directory info while chatting for insight
Browse files Browse the repository at this point in the history
  • Loading branch information
tikendraw committed Feb 5, 2024
1 parent 7b20e78 commit 9bf7ec3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/rawdog/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import argparse
import io

import os
from contextlib import redirect_stdout

from rawdog.llm_client import LLMClient


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


Expand Down Expand Up @@ -64,15 +63,15 @@ def main():
parser.add_argument('prompt', nargs='*', help='Prompt for direct execution. If empty, enter conversation mode')
parser.add_argument('--dry-run', action='store_true', help='Print the script before executing and prompt for confirmation.')
args = parser.parse_args()

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("> ")
print("What can I do for you? (Ctrl-C to exit)")
prompt = input(f"\n{host}@{os.getcwd()} > ")
print("")
rawdog(prompt, verbose=args.dry_run)
except KeyboardInterrupt:
Expand Down

0 comments on commit 9bf7ec3

Please sign in to comment.