Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sgpt command doesn't work on macos and misc comments #66

Closed
ecsplendid opened this issue Mar 14, 2023 · 2 comments · Fixed by #70
Closed

sgpt command doesn't work on macos and misc comments #66

ecsplendid opened this issue Mar 14, 2023 · 2 comments · Fixed by #70

Comments

@ecsplendid
Copy link

ecsplendid commented Mar 14, 2023

It installed OK but couldn't run with the sgpt command, I had to add a function into my zprofile

sgpt() {
    python3 /Users/[...]/Library/Python/[version]/lib/python/site-packages/sgpt/app.py "$@"
}

I think the most important and exciting feature (on your roadmap) is the interactive chat mode, where you can ask questions, it will execute commands, and the responses of those commands become part of the context, so you can then refine and refine i.e.

  • What are the files in this directory
  • Sort them by name
  • Concatenate them using FFMPEG
  • Convert the resulting file into an MP3
  • ...

I didn't check if you already do this, assume you do, but it's very important that the outputs from the shell command become part of the context too.

Also we need some prompt engineering:

sgpt --chat number "whats in this directory"
I'm sorry, I cannot answer this question as you have not provided me with the name or path of the directory.

You see, it doesn't even know that we expect it to give us shell commands, and it doesn't even have the basic context of which directory I am in

Also often ChatGPT responds with hedging text like "as a language model I can't do XYZ, but here you go anyway.." we should prompt it to not say that, as it's super annoying

Great work though, looking very promising :)

@go-dockly
Copy link

try like so
➜ ~ python3 -m sgpt

@TheR1D
Copy link
Owner

TheR1D commented Mar 14, 2023

@ecsplendid
Thank you for such detailed feedback.
Make sure you have site-packages in your $PATH:

pip show shell-gpt
...
# In my case it is located in homebrew dir where my Python lives.
Location: /opt/homebrew/lib/python3.10/site-packages  # Should be in $PATH

You can add context to your prompt using --shell option (it will add "provide only shell command as output" to the prompt), and it works as you are expecting:

sgpt --shell --chat c1 "whats in this directory"
# -> ls

@TheR1D TheR1D linked a pull request Mar 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants