1.0.4 • Published 8 months ago

genereadme v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Contrubutions

Contributions to GENEREADME are welcome! Please checkout CONTRIBUTING.md for guidelines on setting up the environment, how to run and test the tool, and submitting changes.

GENEREADME

GENEREADME is a command-line tool that takes in a file, processes it, and generates a README file with an explanation or documentation of the contents of the file. The tool utilizes OpenAI chat completion to analyze the file and generate content.

genereadme demo

Usage

Install the tool by running the following command:

npm i -g genereadme

The tool currently supports Groq and OpenRouter, which uses Groq by default. A valid API key for the appropriate provider must be provided.

Provide a valid API key either by creating a .env file or through the -a or --api-key flag when using the command:

API_KEY=API_KEY

or

genereadme <files> -a API_KEY
genereadme <files> --api-key API_KEY

Run the tool with the existing sample files or start using your own:

genereadme <files>
genereadme examples/sum.js
genereadme examples/createUser.js examples/sum.js

NOTE: The tool accepts any file, but will only provide appropriate generated results for files that have code as content. Files to be used can be placed anywhere as long as you provide the appropriate path.

Flag options

flagdescriptionusage
-v--versionDisplays the tool's name and the current version.genereadme -vgenereadme --version
-p--providerProvider to be used for chat completions.genereadme -p providergenereadme --provider provider
-o--outputWrites the generated result into the specified filename.genereadme -o filenamegenereadme --output filename
-a--api-keyAllows you to provide your own API key to use for Groq API.genereadme -a keygenereadme --api-key key
-t--temperatureAllows your to provide your preferred temperature for the chat completion generation. Currently supports 0.1 to 1.5.genereadme -t temperaturegenereadme --temperature temperature
-tu--token-usageShows the count of the tokens sent in the prompt and returned in the completiongenereadme -tu filenamegenereadme --token-usage filename
-h--helpDisplays how to use the tool, the arguments accepted, and the available flags.genereadme -hgenereadme --help

TOML Config File

If you don't want to specify the options as command line arguments, you could add an optional TOML config file.

Create genereadme-config.toml in your home directory. For eg. in windows, it is: C:\Users\yourusername

Here is an example:

genereadme-config.toml

apiKey = "your-api-key"
provider = "openrouter" or "groq"
output = "output-file.md"
temperature = 0.5
tokenUsage = true

If you want to override any of the options, you can enter them as command line arguments.

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago