aigc
v1.0.3
Published
Generate content for you with OpenAI
Downloads
3
Readme
aigc
Generate content for you with OpenAI
Installation
require
node >= 14
npm i -g aigc
Usage
The library needs to be configured with your account's secret key which is available on the website. Set it as the OPENAI_API_KEY
environment variable before using the library:
export OPENAI_API_KEY='sk-...'
Command-line interface
This library additionally provides an aigc
command-line utility which makes it easy to interact with the API from your terminal. Run aigc -h
for usage.
# list models
aigc list-models
# create a completion
aigc --prompt "Write unit test for the code below" path/to/your/codeFile
# create image
aigc image "cute cat"
Example 1: Generate document comment for function
Example 2: Generate unit test for function
Changelog
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.