This project is designed to rename image files based on specific criteria. It supports various image formats and integrates with the OpenAI API.
To install the necessary dependencies, run:
pnpm install
To start the project, use the following command:
pnpm start
This will compile the TypeScript files and run the main script.
Ensure you have a .env
file in the root directory with the necessary environment variables. The project uses the following environment
variables
OPENAI_API_KEY
: Your OpenAI API key.
These formats are defined in the SUPPORTED_IMAGE_FORMATS
constant.
image-files/
: Directory containing the image files to be renamed.src/
: Source code directory.OpenAIHandler.ts
: Handles interactions with the OpenAI API.ImageDirectory.ts
: Contains theImageDirectory
class for managing image files and all fine handling operationsImageFileRenamer.ts
: Main class that utilizes rest of the classes to rename the files.index.ts
: Main entry point of the application.