The ChatGPT CLI (Command Line Interface) example is a PowerShell script that allows developers to interact with the ChatGPT model through the command line. With the ChatGPT CLI PowerShell script, developers can easily generate text, complete text, or answer questions using the power of the ChatGPT model. ChatGPT is a large language model developed by OpenAI that can generate human-like text.
Download the script and put it somewhere, make sure updating the API Key [1] with your own; then go to the path and execute the script:
.\chatgpt.ps1 -p "Iran Capital"
The capital of Iran is Tehran.
You can make an alias to access the script easily everywhere like this:
notepad $profile
At the end of Powershell profile append this:
Set-Alias chat c:\path\to\file\chatgpt.ps1
Now you can access to script by typing chat
everywhere.
Ok, as a persian guy if you want to get persian result add -fa
as a switch like:
.\chatgpt.ps1 -p "Iran Capital" -fa
تهران
Describe a game or a program and redirect the output to a file like:
.\chatgpt.ps1 -o tic-tac-toe.py