BLOG

Chatgpt from CLI

Hi Folks,

We know how chatgpt is useful in many domains and how we can leverage its usage in CyberSecurity as security researcher.

Below are the steps to get the python script that can be used from CLI for quering ChatGPT.

$ mkdir -p openai/chatgpt
$ virtualenv openai/chatgpt
$ source openai/chatgpt/bin/activate
$ pip3 install -U pip
$ pip3 install openai
$ cd openai/chatgpt
$ wget https://raw.githubusercontent.com/godishala/Python/master/chatgpt/chatbot.py 
python3 chatbot.py "<query-here>"
eg: python3 chatbot.py "write socket program in python"

Note: Don't forget to add "API-Key" in the script.

chatgptone chatgpttwo chatgptthree