CodePro: The Multi-Language Code Generator, that can automatically generates code based on a plain text.
what CodePro can do for me?
The pre-requisite for the code generation is an OpenAI API key. This is used by the extension to access the API and is only sent to OpenAI. Codex is currently free, so does not use up any credits on your account.
To find your OpenAI API key:
- Go to https://platform.openai.com/account/api-keys. You will need to log in (or sign up) to your OpenAI account.
- Click "Create new secret key", and copy it.
- You should then paste it into VS Code extension workspace settings.
|ctrl + enter
||Generate code based on plain text
|alt + enter
||Optimize code for a selected piece of code
|shift + ctrl + g
||Generate unit test code
||Generate unittest code for selected peice of code
Note: if your plain text is multiline, then select the enter text and use ctrl + enter to generate code for complete query
get all files in the folder
open each file
print the first line of each file
# Path to the folder containing the files
path = 'C:/files/'
# Get all files in the folder
files = os.listdir(path)
# Iterate over each file in the folder
for file in files:
# Open each file and print its first line
with open(os.path.join(path, file)) as f:
except Exception as e:
print('Error occured while reading file', e)
OpenAI is evolving, it generates the code that is syntactically correct but probably does not meet the intended functionality. As a result, it's always recommended to thoroughly review, modify and test the generated code before git commit.
||Generate documentation, and code review comments
||Started consuming MS OpenAI
||Removed all the references of OpenAI and started consuming the MS Open AI
||No end user impact, just refacted some code snippets
||End users need not wait for the full response, they start see chunks instantly loading on their editors
||Optimize Code, Generate unit test code
||Optimize code for a selected piece of code, Generate unittest code for selected peice of code