_ _ _ _
| | | | | | | |
_ __ _ _| |__ | |__ ___ _ __ __| |_ _ ___| | ___ _
| '__| | | | '_ \| '_ \ / _ \ '__/ _` | | | |/ __| |/ / | | |
| | | |_| | |_) | |_) | __/ | | (_| | |_| | (__| <| |_| |
|_| \__,_|_.__/|_.__/ \___|_| \__,_|\__,_|\___|_|\_\\__, |
__/ |
|___/
>(.)__ <(.)__ =(.)__
(___/ (___/ (___/
RubberDuck Shell is an interactive command-line tool that allows you to run Python scripts, diagnose errors using a variety of LLM models, and execute shell commands. It uses the traceback, and takes relevant code functions as context. Currently the default model is set to Llama-3-8B.
This has not been tested extensively. It was a quick fun project and I have not had the time to maintain it!
- An GROQ API key: follow the link to setup a GROQ api key
-
Clone the repository:
git clone https://github.com/yourusername/rubberduck-shell.git cd rubberducky -
Install required Python packages:
pip install -r requirements.txt
-
Start the RubberDuck Shell:
python rubberduck.py
-
Interact with the Shell:
- Get help for commands:
rubberduck>> help - Run a Python script:
rubberduck>> python /path/to/your/script.py arg1 arg2 arg3 - Diagnose the last error:
rubberduck>> diagnose - Execute a shell command:
rubberduck>> ls - Exit the shell:
rubberduck>> exit
- Get help for commands:
# test.py
import sys
def test(option):
if option == "fail":
rise = 1
run = 2 * 0
return rise/run
else:
return True
if __name__ == "__main__":
option = sys.argv[1]
hello = test(option)- Currently the functionality for providing function code as context only works for .py files (
astmodule). There's a couple ideas here:- a more general purpose parse (ex.
tree-sitter) - having intermediate steps and parse/extract function code using LLMs
- a more general purpose parse (ex.
- Code completion:
- Take the solution given by the LLM and have the possibility to inject/replace the problematic code
- Beautify the layout:
- creating something like a visual studio code extension? have some basic UI for it rather than a command line interface