Skip to content

Commit

Permalink
Merge pull request #10 from peterdanwan/README
Browse files Browse the repository at this point in the history
Updating the README file's sections
  • Loading branch information
peterdanwan authored Sep 13, 2024
2 parents 00d17f9 + 913dc8a commit f0e3226
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 39 deletions.
103 changes: 67 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,84 @@
# gimme_readme

`gimme_readme` is a command-line tool powered by AI that generates a comprehensive `README.md` file for your project. It analyzes multiple source code files at once, providing concise explanations of each file's purpose, functionality, and key components, all in a single, easy-to-read document. This makes your project more approachable and understandable for others.

## Table of Contents

1. [What is gimme_readme?][1-what-is-gimme-readme]
2. [Getting Started][2-getting-started]
3. [Example Usage][3-example-usage]
4. [List of supported models by providers][4-list-of-supported-models-by-providers]
5. [Contributing][5-contributing]
1. [Getting Started](#1-getting-started)
2. [Usage](#2-usage)
3. [Example Usage](#3-example-usage)
4. [Supported Models by Providers](#4-supported-models-by-providers)
5. [Contributing](#5-contributing)
6. [Author](#6-author)

## 1. Getting Started

To get started with `gimme_readme`, follow these steps:

1. Install the latest version of [Node.js](https://nodejs.org/en/download/package-manager) for your operating system.
2. Run the following command to install `gimme_readme` globally:

```sh
npm i -g gimme_readme
```

## 1. What is gimme_readme?
3. Generate a configuration file by running:

`gimme_readme` is a command-line tool that uses `OpenAI` to generate a `README.md` file that explains a given source code file.
```sh
gr-ai -c
```

## 2. Getting Started
This command creates a `.gimme_readme_config` file in your home directory. **Do not move this file from this location.**

To use the `gimme_readme`, you must:
4. Open the `.gimme_readme_config` file and add your API keys and preferred default values as prompted. Ensure you leave the variable names unchanged.

1. Install the latest version of [node](https://nodejs.org/en/download/package-manager) for your `operating system`.
2. Run `npm i -g gimme_readme`, which installs `gimme_readme` globally.
3. Run `gr-ai -c` to generate your own `.gimme_readme_config` file in your `home` directory.
- `NOTE`: Do _not_ move this file from this location.
- Follow the prompts in recently created `.gimme_readme_config` file to add your API keys and preferred default values
- Leave the variable names in the newly generated config file alone.
- subsequent runs of `gr-ai -c` will just show you the path of your config file
- Subsequent runs of `gr-ai -c` will display the path to your existing config file.
- See [here](./env.sample) for an example of what a `.gimme_readme_config` file looks like!

## 2. Usage

`gimme_readme` uses AI to generate a `README.md` file that explains a given source code file or files. Below are the available options:

| Option | Description |
| ------------------------------ | ------------------------------------------------------------------------- |
| `-v`, `--version` | Output the current version |
| `-f`, `--file [files...]` | Specify one or more files to generate explanations for |
| `-o`, `--outputFile <string>` | Specify the file to output the generated README to |
| `-m`, `--model <string>` | Choose a free-tier AI model to use (e.g., gemini, openai, grok) |
| `-p`, `--prompt <string>` | Provide a custom prompt to the AI |
| `-c`, `--config` | Show the location of the configuration file and provide links to examples |
| `-t`, `--temperature <number>` | Set the level of determinism for the AI (value between 0 and 1) |
| `-h`, `--help` | Display help for the command |

## 3. Example Usage

### Display help
Below are some examples to help you get started with `gimme_readme`.

```sh
# Can do this
gr-ai
### Display Help

# Or this
To display the help menu with all available commands:

```sh
gr-ai -h
```

### Display version number
### Display Version Number

To show the current version of `gimme_readme`:

```sh
# Can do this
gr-ai -v
# Or this
gr-ai --version
```

###
### Generate a README for a Source File

To generate a `README.md` file for one or more source files:

## 4. List of supported models by providers
```sh
gr-ai -f example.js anotherFile.py -o README.md -m gemini-1.5-flash
```

## 4. Supported Models by Providers

| Provider | Models |
| -------- | ---------------- |
Expand All @@ -56,16 +87,16 @@ gr-ai --version

## 5. Contributing

Contributions to this project are welcomed!
We welcome contributions to improve `gimme_readme`! To contribute, please follow these steps:

1. Check the [existing issues](https://github.com/peterdanwan/gimme_readme/issues) to see if your issue or feature request has already been logged.
2. If your issue or feature request is already listed, add your comments or create a pull request with your proposed changes.
3. If your issue or suggestion is not listed, feel free to create a new issue. If possible, provide a pull request that addresses the issue.

We ask that you first check to see if the issue you've encountered or feature you wish to add is under the existing list of [issues](https://github.com/peterdanwan/gimme_readme/issues).
When making a pull request, please ensure that your changes are well-documented and adhere to the coding standards of the project.

If your issue or suggested feature is already, please add onto the existing issue by adding your comments or making `pull request` with what you believe to be a valid change to the code.
## 6. Author

Otherwise, if your issue or suggestion is not already list, please feel free to create a new issue, and if possible create a `pull request` that you think will resolve your issue.
Developed by [Peter Wan](https://github.com/peterdanwan).

[1-what-is-gimme-readme]: #1-what-is-gimme_readme
[2-getting-started]: #2-getting-started
[3-example-usage]: #3-example-usage
[4-list-of-supported-models-by-providers]: #4-list-of-supported-models-by-providers
[5-contributing]: #5-contributing
For any questions or feedback, feel free to reach out through the GitHub repository.
50 changes: 50 additions & 0 deletions _examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Example Commands

## Display Help

```sh
# Can run this...
gr-ai

# This...
gr-ai -h

# Or this
gr-ai --help
```

![help](assets/images/help.png)

> `NOTE`: there is always going to be a `shorthand version` of a flag/option. The subsequent examples will prefer the shorthand flags when writing commands.
## Show version

```sh
gr -v
```

![version](assets/images/version.png)

## Make a .gimme_readme_config file / find its location

```sh
# Makes a .gimme_readme_config file if it's not there already
# Or, helps you find the path to your existing .gimme_readme_config file
gr -c
```

Creates a config file if it doesn't exist already:

![create-config](assets/images/create-config.png)

Locates the config file if it does exist:

![find-config-file](assets/images/find-config.png)

## Explain a file, output the result to a specific file, and set the temperature for the model

```sh
gr-ai -m gemini-1.5-flash -f tests/unit/_gr.test.js -o explanation.md -t 0.1
```

![explain-file](assets/images/explain-file.png)
Binary file added _examples/assets/images/create-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _examples/assets/images/explain-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _examples/assets/images/find-config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _examples/assets/images/help.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _examples/assets/images/version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ OPENAI_KEY=YOUR_OPENAI_KEY
# Make your Gemini API Key: https://aistudio.google.com/app/apikey
GEMINI_KEY=YOUR_GEMINI_KEY

# Make your Gemini API Key: https://console.groq.com/keys
# Make your Groq API Key: https://console.groq.com/keys
GROQ_KEY=YOUR_GROQ_KEY

# Default model you prefer to use.
# List of supported models: https://github.com/peterdanwan/gimme_readme#4-list-of-supported-models-by-providers
MODEL=llama3-8b-8192

# Default temperature you prefer to use (0-1)
TEMPERATURE=YOUR_TEMPERATURE_VALUE
TEMPERATURE=0.5
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gimme_readme",
"version": "0.0.1",
"description": "gimme_readme is a command-line tool that uses AI to generate a README.md file that explains a given source code file.",
"description": "gimme_readme is a command-line tool powered by AI that generates a comprehensive README.md file for your project. It analyzes multiple source code files at once, providing concise explanations of each file's purpose, functionality, and key components, all in a single, easy-to-read document. This makes your project more approachable and understandable for others.",
"author": "Peter Wan",
"license": "MIT",
"main": "_gr.js",
Expand Down

0 comments on commit f0e3226

Please sign in to comment.