gorilla-llm / gorilla-cli

LLMs for your CLI
https://gorilla.cs.berkeley.edu/
Apache License 2.0
1.3k stars 76 forks source link

[UX] Leave suggestions in terminal when I ctrl-c #12

Open romilbhardwaj opened 1 year ago

romilbhardwaj commented 1 year ago

Great project! Two UX suggestions when I ctrl-c after suggestions are shown:

  1. Leave the suggestions in terminal instead of erasing them, so I refer back to them
  2. Remove the scary traceback when I ctrl-c :)
(base) ➜  ~ gorilla gcloud change project
🦍  Welcome to Gorilla. Use arrows to select

Cancelled by user

Traceback (most recent call last):
  File "/Users/romilb/tools/anaconda3/bin/gorilla", line 8, in <module>
    sys.exit(main())
  File "/Users/romilb/tools/anaconda3/lib/python3.9/site-packages/go_cli.py", line 155, in main
    exit_condition = execute_command(selected_command)
  File "/Users/romilb/tools/anaconda3/lib/python3.9/site-packages/go_cli.py", line 119, in execute_command
    process = subprocess.run(cmd, shell=True, stderr=subprocess.PIPE)
  File "/Users/romilb/tools/anaconda3/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/romilb/tools/anaconda3/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/romilb/tools/anaconda3/lib/python3.9/subprocess.py", line 1680, in _execute_child
    args = list(args)
TypeError: 'NoneType' object is not iterable
ShishirPatil commented 1 year ago

These are great suggestions @romilbhardwaj 💯 Will include them in the next release 🚀 Open source contributions welcome and I'd be happy to merge a PR on this!