diff --git a/install.sh b/install.sh index c98938f..ea61ddf 100644 --- a/install.sh +++ b/install.sh @@ -18,14 +18,15 @@ echo "alias yolo=$TARGET_FULLPATH" >> ~/.bash_aliases echo "alias computer=$TARGET_FULLPATH" >> ~/.bash_aliases # Windows -# Copy yolo.bat to System32 or : +# Copy yolo.bat to System32 or Home Directory : +cp yolo.bat ~ + # (This doesn't work, havent figured it out) - # Creates two aliases for use -alias yolo=$TARGET_FULLPATH -alias computer=$TARGET_FULLPATH +#alias yolo=$TARGET_FULLPATH +#alias computer=$TARGET_FULLPATH # Add the aliases to the logon scripts -echo "alias yolo=$TARGET_FULLPATH" >> ~/.bash_aliases -echo "alias computer=$TARGET_FULLPATH" >> ~/.bash_aliases \ No newline at end of file +#echo "alias yolo=$TARGET_FULLPATH" >> ~/.bash_aliases +#echo "alias computer=$TARGET_FULLPATH" >> ~/.bash_aliases \ No newline at end of file diff --git a/yolo.bat b/yolo.bat index 13fdc30..f68cd91 100644 --- a/yolo.bat +++ b/yolo.bat @@ -4,4 +4,5 @@ REM Work around to not have to type in python.exe yolo.py every time. REM Put in C:/Windows/System32 to allow command to work anywhere set /P "prompt=Enter Prompt: " -python.exe ~/yolo-ai-cmdbot/yolo.py %prompt% +cd ~ +python.exe yolo-ai-cmdbot/yolo.py %prompt% \ No newline at end of file diff --git a/yolo.py b/yolo.py index b5664bd..78e1775 100755 --- a/yolo.py +++ b/yolo.py @@ -12,6 +12,8 @@ import subprocess from termcolor import colored from colorama import init +import dotenv + # Check if the user globally disabled the safety switch def get_yolo_safety_switch_config(): @@ -78,10 +80,12 @@ if __name__ == "__main__": ask_flag = False # safety switch -a command line argument yolo = "" # user's answer to safety switch (-a) question y/n - # Two options for the user to specify they openai api key - home_path = os.path.expanduser("~") - openai.api_key = os.getenv("OPENAI_API_KEY") + + # Two options for the user to specify they openai api key. Windows: Comment out the one you are not using (Causes extra line to appear) + home_path = os.path.expanduser("~") openai.api_key_path = os.path.join(home_path,".openai.apikey") + dotenv.load_dotenv() + openai.api_key = os.getenv("OPENAI_API_KEY") # Parse arguments and make sure we have at least a single word if len(sys.argv) < 2: