A utility to generate MERMAID code from terraform code using OPENAI API.
TBD
$ terraform-imgs --help
A utility to generate MERMAID code from terraform code using GPT API.
Usage:
terraform-imgs [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
mermaid Generate mermaid diagrams from terraform files
version Print the version number of terraform-imgs
Flags:
-h, --help help for terraform-imgs
-o, --output-file string output file path(e.g. README.md)
Use "terraform-imgs [command] --help" for more information about a command.
Set the environment variable OPENAI_API_KEY
to the API key of the GPT API.
export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx >> ~/.bash_profile
$ terraform-imgs mermaid ./path/to/terraform-root
$ terraform-imgs mermaid ./path/to/terraform-root -o ./path/to/README.md
The mermaid code block is inserted between the following comment-outs. If it is not mentioned, it will be added to the end of the file.
<!-- BEGIN_TF_IMGS -->
mermaid code block
<!-- END_TF_IMGS -->
- The GPT API is used to generate the MERMAID code; API keys are the user's own, so API usage fees apply(https://openai.com/pricing).
- Also, the API has a token limit, so it may not work for large terraforms.
- Please be sure to check the output results and modify them accordingly.