storybook-gpt
v1.0.3
Published
A package for creating storybook component stories using GPT-4.
Maintainers
Readme
Storybook-GPT
Storybook-GPT is a tool designed to automate the creation of Storybook stories for React components. The tool leverages the power of GPT-4 to generate clean, readable, and standardized story code. This generated code adheres strictly to CSF3 (Component Story Format 3) conventions.
Installation
pnpm i storybook-gptUsage
You have to provide an OpenAi key through a env variable
OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThen you can generate your stories with the following command
pnpm run storybook-gptConfiguration
A storybook-gpt-config.json file must be created before launching the script.
The config file accept the following properties:
- components: the path where your components live
- stories: the path where tout stories love
- exclude: an array of regex defining paths/files to be excluded when reading components
Example:
{
"components": "components",
"stories": "storybook",
"exclude": ["ui"]
}Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
