Chat GPT Code Generation
Apex offers automated base generation of entire packages / systems with the assistance of Chat GPT. Here's how it works:
- Running the gpt generate CLI command will prompt you to write a small description of the system you would like developed.
- An API call will be made to OpenAI to generate the SQL database schema for the system you described.
- The SQL database schema will be saved within the file chat_gpt.sql, and you will be prompted to modify as desired then press enter once done.
- SQL database schema will be appended to
remove.sqlfiles, executed against the database, menus within administration panel will be added, and all models, controllers and views necessary will be automatically generated using the code generation libraries available within Apex Opus.
- Go through everything automatically generated and make any necessary tweaks / modifications.
Generate Code with Chat GPT Assistance
apex gpt init <OPENAI_API_KEY>
This will store your API key for later use when making calls to OpenAI. Next, ensure you have the desired package already created using the package create CLI command that you would like the generated code assigned to, for example:
apex package create my-shop
Then simply go ahead and generate code with Chat GPT's assistance with the command:
apex gpt generate <PACKAGE>
apex gpt generate my-shop
Enter the desired system in plain English, press enter twice and the database schema plus all necessary code files will be automatically generated for you.