Giter Site home page Giter Site logo

gpt-do's Introduction

gpt-do

This is a handy-dandy CLI for when you don't know wtf to do.

Instead of furiously grepping through man pages, simply use do (or ddo if on bash/zsh), and have GPT-3 do all the magic for you.

Check out the blog post here.

Demo

Click to play:

asciicast

Installation

We recommend using pipx:

$ pipx install gpt-do
$ which do
~/.local/bin/do

However you can also use brew:

$ brew install yasyf/do/do
$ which do
/opt/homebrew/bin/do

Or pip:

$ pip install gpt-do
$ which do
~/.asdf/installs/python/3.11.0/bin/do

Usage

n.b. If you're on bash or zsh, do is a reserved keyword, so you'll have to use the alias ddo.

n.b. The default model used is GPT-3. Please ensure you have sufficient credits in your OpenAI account to use it.

$ export OPENAI_API_KEY=xxx # stick this in your bash_profile
$ do amend the message of my last commit to "It works!"
This command will amend the message of the last commit to 'It works!'.
git commit --amend -m 'It works!'
Do you want to continue? [y/N]: y
[main 3e6a2f6] It works!!
 Date: Thu Dec 22 01:15:40 2022 -0800
 5 files changed, 1088 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 .gitmodules
 create mode 100644 README.md
 create mode 100644 poetry.lock
 create mode 100644 pyproject.toml

gpt-do's People

Contributors

contreux avatar yasyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gpt-do's Issues

Quota error

I'm receiving openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

Either this is a block from openai on this prompt or something else, but I didn't exceeded the quota (only have been using chatgpt for one or to questions a day) and I do have credits on a business account.

davinci deprecated

    self._interpret_response_line(
  File "/Users/cellis/Library/Application Support/pipx/venvs/gpt-do/lib/python3.12/site-packages/openai/api_requestor.py", line 429, in _interpret_response_line
    raise self.handle_error_response(
openai.error.InvalidRequestError: The model `text-davinci-003` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations```

Command doesn't run after "Do you want to continue? [y/N]: y"

On a remote machine, entering y does not execute the command. I've successfully used the tool locally.
Here is what my terminal looks like:

(base) √√ ~ % ddo echo hello world
This command will print 'hello world' to the terminal.
echo 'hello world'
Do you want to continue? [y/N]: y
(base) √√ ~ % 

I use kitty, zsh, there is a conda env activated, it's on Ubuntu 20.04, the tool was installed with pip. Not sure which additional details to provide here.

FR: confirm with one keypress

Hi, thanks for the nice tool.

I was wondering whether you could make it that the confirmation prompt accepts just on keypress, essentially only "y" or "n" instead of "y+return" or "n+return".

With shell script, you can get this behavior with read -k, but unfortunately I do not know how to do this with python (otherwise I would have made a PR myself).

Prints text in zsh before command

After pressing y to accept a command in zsh, several errors are printed to the console:

» ddo echo hello                                                                                                                                                                                   3:27PM
This command will print the string 'hello' to the terminal.
echo hello
Do you want to continue? [y/N]: y
/home/user/.zsh/oh-my-zsh/oh-my-zsh.sh:46: ZSH_CACHE_DIR: parameter not set
/home/user/.zsh/config/zshrc.d/044_functions-vcsh.zsh:3: no match
/home/user/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh:42: unmatched "
/home/user/.zsh/plugins/hhighlighter/h.sh:1: unmatched "
/home/user/.zsh/config/zshrc.d/061_plugins-hstr.zsh:4: command not found: bindkey
compinit:170: unmatched '
/home/user/.bun/_bun:630: command not found: compdef
/home/user/.zsh/oh-my-zsh/oh-my-zsh.sh:46: ZSH_CACHE_DIR: parameter not set
/home/user/.zsh/config/zshrc.d/044_functions-vcsh.zsh:3: no match
/home/user/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh:42: unmatched "
/home/user/.zsh/plugins/hhighlighter/h.sh:1: unmatched "
compinit:170: unmatched '
/home/user/.bun/_bun:630: command not found: compdef
hello

When using ChatGPT: ModuleNotFoundError: No module named 'playwright'

When executing the following command with the chatgpt model: ddo whats the highest CPU process --model=chatgpt

I receive the following error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/ddo", line 8, in <module>
    sys.exit(do())
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/gpt_do/cli.py", line 49, in do
    do = get_doer(model)(debug=debug)
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/gpt_do/cli.py", line 8, in get_doer
    from gpt_do.doers.pywright_doer import PywrightDoer
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/gpt_do/doers/pywright_doer.py", line 2, in <module>
    from gpt_do.vendor.chatgpt_wrapper.chatgpt_wrapper import ChatGPT
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/gpt_do/vendor/chatgpt_wrapper/chatgpt_wrapper/__init__.py", line 1, in <module>
    from .chatgpt import ChatGPT
  File "/opt/homebrew/Cellar/do/0.1.16/libexec/lib/python3.10/site-packages/gpt_do/vendor/chatgpt_wrapper/chatgpt_wrapper/chatgpt.py", line 19, in <module>
    from playwright.sync_api import sync_playwright
ModuleNotFoundError: No module named 'playwright'

I assume the installation scripts of gpt-do is missing playwright in the requirements.

ModuleNotFoundError: No module named 'gpt_do.vendor'

I have installed gpt-do with pipx and when using --model=chatgpt the scripts raises an error

$ ddo echo hello to file hello.txt --model=chatgpt                                                                                    
Traceback (most recent call last):
  File "/home/tester/.local/bin/ddo", line 8, in <module>
    sys.exit(do())
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/gpt_do/cli.py", line 37, in do
    do = get_doer(model)(debug=debug)
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/gpt_do/cli.py", line 6, in get_doer
    from gpt_do.doers.pywright_doer import PywrightDoer
  File "/home/tester/.local/pipx/venvs/gpt-do/lib/python3.10/site-packages/gpt_do/doers/pywright_doer.py", line 2, in <module>
    from gpt_do.vendor.chatgpt_wrapper.chatgpt_wrapper import ChatGPT
ModuleNotFoundError: No module named 'gpt_do.vendor'

The vendor directory is actually missing (I guess the git submodule is not populated by pipx)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.