readme-generate-tool
v4.0.0
Published
A tool to generate professional README files based on project structure
Maintainers
Readme
readme-generate-tool
Introduction
readme-generate-tool is a sophisticated command-line tool designed to automatically generate professional README files based on a project's directory structure and package.json file. This tool leverages AI capabilities for enhanced description generation and offers a structured approach to README creation, significantly reducing the time and effort required for this crucial documentation task. It's built for complex projects requiring detailed README files.
Installation
Clone the repository:
git clone <repository_url>Navigate to the project directory:
cd readme-generate-toolInstall dependencies:
npm installBuild the project:
npm run build
This will compile the TypeScript code into JavaScript in the dist directory.
Usage
The tool uses the Commander.js library for command-line argument parsing. To generate a README file, run the following command:
readme-generate-toolThe tool will analyze the project structure from the current directory. It will then generate a README.md file in the root directory.
Optional Arguments:
While not currently implemented, future versions may include options for customizing the output, such as specifying the output file name or including additional sections.
File Structure
The project's code is organized as follows:
src: Contains the source code.utils: Houses utility functions for interacting with the AI client, generating charts (if applicable), reading files, and building the README structure.aiClient.ts: Handles communication with the Google Generative AI API.chartGenerator.ts: (Placeholder - Functionality not yet implemented) Handles chart generation from project data (e.g., dependency counts, code complexity metrics).fileReader.ts: Reads and processes files within the project directory.readmeBuilder.ts: Constructs the README content based on project data.
index.ts: Main entry point of the application.
dist: Contains the compiled JavaScript code after runningnpm run build. Mirrors thesrcdirectory structure..env: Stores environment variables (e.g., Google Generative AI API key). This file should be added to.gitignore..gitignore: Specifies files and directories to exclude from version control.package.json: Contains project metadata and dependencies.package-lock.json: Contains the exact versions of all dependencies installed.tsconfig.json: Configuration file for TypeScript compiler.node_modules: Contains project dependencies.
Dependencies
The project utilizes the following dependencies:
@google/generative-ai: For leveraging Google's Generative AI APIs to enhance README descriptions.commander: For parsing command-line arguments.dotenv: For loading environment variables from a.envfile.
Development Dependencies:
@types/node: TypeScript type definitions for Node.js.ts-node: Allows running TypeScript code directly without compilation (for development).typescript: TypeScript compiler.
Contributing
Contributions are welcome! Please open an issue or submit a pull request. Before contributing, please ensure you have read and understand the project's coding style and contribution guidelines (to be added).
License
This project is licensed under the MIT License - see the LICENSE file for details.
