Skip to content

Commit 5d04ee7

Browse files
committed
docs(readme): expand project details, features, and configuration
- Add initial tests for the CLI program. - Export utility functions for improved testability. - Standardize markdown list formatting and improve issue templates.
1 parent 6bd9871 commit 5d04ee7

File tree

11 files changed

+105
-51
lines changed

11 files changed

+105
-51
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
name: Bug Report
33
about: Report a reproducible bug
4-
title: "[BUG] <short description of bug>"
5-
labels: ["bug", "triage"]
4+
title: '[BUG] <short description of bug>'
5+
labels: ['bug', 'triage']
66
assignees: ''
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,11 +24,13 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27+
2728
- OS: [e.g. iOS]
2829
- Browser [e.g. chrome, safari]
2930
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
33+
3234
- Device: [e.g. iPhone6]
3335
- OS: [e.g. iOS8.1]
3436
- Browser [e.g. stock browser, safari]

.github/ISSUE_TEMPLATE/documentation_issue.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Documentation Issue
33
about: Report an issue with the documentation
4-
title: "[DOCS] <short description of documentation issue>"
5-
labels: ["documentation", "triage"]
4+
title: '[DOCS] <short description of documentation issue>'
5+
labels: ['documentation', 'triage']
66
assignees: ''
7-
87
---
98

109
**Describe the documentation issue**

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature Request
33
about: Suggest an idea for this project
4-
title: "[FEATURE] <short description of feature>"
5-
labels: ["enhancement", "triage"]
4+
title: '[FEATURE] <short description of feature>'
5+
labels: ['enhancement', 'triage']
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/ISSUE_TEMPLATE/general_question.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: General Question
33
about: Ask a general question about the project
4-
title: "[QUESTION] <short description of question>"
5-
labels: ["question", "triage"]
4+
title: '[QUESTION] <short description of question>'
5+
labels: ['question', 'triage']
66
assignees: ''
7-
87
---
98

109
**What is your question?**

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ Please note that this project is released with a [Code of Conduct](RULES_OF_COND
1010

1111
If you find a bug, please open an issue on our [GitHub Issues page](https://github.com/IonGireada/repo-description/issues). When reporting a bug, please include:
1212

13-
* A clear and concise description of the bug.
14-
* Steps to reproduce the behavior.
15-
* Expected behavior.
16-
* Screenshots or error messages if applicable.
17-
* Your operating system and Node.js version.
13+
- A clear and concise description of the bug.
14+
- Steps to reproduce the behavior.
15+
- Expected behavior.
16+
- Screenshots or error messages if applicable.
17+
- Your operating system and Node.js version.
1818

1919
### Suggesting Enhancements
2020

@@ -72,8 +72,8 @@ You can then use the scripts defined in `package.json` for linting, formatting,
7272

7373
This project uses ESLint and Prettier to enforce code style. Please ensure your code is formatted and linted correctly before submitting a pull request.
7474

75-
* Format your code: `npm run format`
76-
* Lint your code: `npm run lint`
77-
* Fix linting issues: `npm run lint:fix`
75+
- Format your code: `npm run format`
76+
- Lint your code: `npm run lint`
77+
- Fix linting issues: `npm run lint:fix`
7878

7979
Thank you for contributing!

README.md

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
# repo-description
22

3-
> AI‑powered CLI that automatically generates clear, natural‑language descriptions of every file in a repository.
3+
> An AI-powered CLI tool that automatically generates clear, natural-language descriptions for every file within a given repository. `repo-description` helps developers quickly understand unfamiliar codebases, onboard new team members, and maintain comprehensive documentation effortlessly. By leveraging advanced AI, it transforms raw code into insightful summaries, making project navigation and collaboration significantly smoother.
4+
5+
## Features
6+
7+
- **AI-Powered Descriptions**: Generates concise, natural-language summaries for individual files using advanced AI models.
8+
- **Flexible Output Formats**: Supports output in JSON or Markdown, allowing for easy integration into various workflows.
9+
- **Repository Agnostic**: Works with both local directories and remote GitHub repositories (automatically clones them).
10+
- **Customizable Ignoring**: Exclude specific files or directories (e.g., `node_modules`, `.git`) from the description process.
11+
- **Markdown-Magic Integration**: Seamlessly updates `markdown-magic.config.js` files to embed descriptions directly into your documentation.
12+
- **CLI & Module Usage**: Can be used as a standalone command-line tool or integrated as a JavaScript module within other projects.
413

514
<!-- doc-gen BADGES -->
615

716
[![npm version](https://img.shields.io/npm/v/repo-description.svg?style=for-the-badge)](https://www.npmjs.com/package/repo-description) [![npm downloads](https://img.shields.io/npm/dw/repo-description.svg?style=for-the-badge)](https://www.npmjs.com/package/repo-description) [![license](https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge)](https://www.npmjs.com/package/repo-description) [![actions status](https://img.shields.io/github/actions/workflow/status/IonGireada/repo-description/ci.yml?branch=main&style=for-the-badge)](https://github.com/IonGireada/repo-description/actions) [![codecov](https://img.shields.io/codecov/c/github/IonGireada/repo-description?branch=main&style=for-the-badge)](https://codecov.io/gh/IonGireada/repo-description) [![release](https://img.shields.io/github/v/release/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/releases) [![maintained](https://img.shields.io/github/commit-activity/y/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/graphs/commit-activity) [![stars](https://img.shields.io/github/stars/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/stargazers) [![forks](https://img.shields.io/github/forks/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/network/members) [![watchers](https://img.shields.io/github/watchers/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/watchers) [![last commit](https://img.shields.io/github/last-commit/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/commits) [![contributors](https://img.shields.io/github/contributors/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/graphs/contributors) [![issues](https://img.shields.io/github/issues/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/issues) [![pull requests](https://img.shields.io/github/issues-pr/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/pulls) [![repo size](https://img.shields.io/github/repo-size/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description) [![top language](https://img.shields.io/github/languages/top/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description) [![languages](https://img.shields.io/github/languages/count/IonGireada/repo-description?style=for-the-badge)](https://github.com/IonGireada/repo-description/search?l=)
817

918
<!-- end-doc-gen -->
1019

11-
## Installation
20+
## Getting Started
21+
22+
:::note
23+
**Important:** Before running, create a `.env` file in your project root with your Groq API key. The key must be named `GROQ_API_KEY`. You can obtain an API key by creating an account and visiting [https://console.groq.com/keys](https://console.groq.com/keys).
24+
:::
25+
26+
### Installation
1227

1328
<!-- doc-gen INSTALL global=true -->
1429

@@ -22,11 +37,7 @@ yarn add -g repo-description
2237

2338
<!-- end-doc-gen -->
2439

25-
## Usage
26-
27-
:::note
28-
**Important:** Before running, create a `.env` file in your project root with your Groq API key. The key name should be `GROQ_API_KEY`. You can obtain an API key by creating an account and visiting [https://console.groq.com/keys](https://console.groq.com/keys).
29-
:::
40+
### Usage
3041

3142
### As a JavaScript Module
3243

@@ -108,6 +119,19 @@ repo-describer . -i "dist" "build" --update-config ./md.config.js --transform-na
108119
repo-describer --help
109120
```
110121

122+
## Configuration
123+
124+
`repo-description` requires an API key from [Groq](https://groq.com) to function. Follow these steps to configure your API key:
125+
126+
1. **Obtain an API Key**: Visit [https://console.groq.com/keys](https://console.groq.com/keys) and create a new API key.
127+
2. **Create `.env` file**: In the root directory of your project (or where you run `repo-describer`), create a file named `.env`.
128+
3. **Add API Key**: Add your Groq API key to the `.env` file in the format:
129+
```
130+
GROQ_API_KEY=your_groq_api_key_here
131+
```
132+
133+
Ensure your `.env` file is included in your `.gitignore` to prevent your API key from being committed to version control.
134+
111135
## CLI API
112136
113137
### Help Output
@@ -157,43 +181,43 @@ Options:
157181
158182
<!-- doc-gen COMMANDS format=list -->
159183
160-
- `describe` — Generates AI-powered descriptions for repository files and outputs them in various formats. (line [89](./package.json#L89))
184+
- `describe` — Generates AI-powered descriptions for repository files and outputs them in various formats. (line [86](./package.json#L86))
161185
162186
```bash
163187
node src/cli.js . descriptions.json && node src/cli.js . descriptions.md --format markdown && node src/cli.js . descriptions-table.md --format markdown --table && node src/cli.js . descriptions-summary.md --format markdown --summary && node src/cli.js . descriptions-table-summary.md --format markdown --table --summary
164188
```
165189

166-
- `docs` — Generates documentation by processing Markdown files with markdown-magic. (line [94](./package.json#L94))
190+
- `docs` — Generates documentation by processing Markdown files with markdown-magic. (line [91](./package.json#L91))
167191

168192
```bash
169193
npx [email protected] **/*.md -c md.config.js
170194
```
171195

172-
- `format` — Formats the codebase using Prettier. (line [92](./package.json#L92))
196+
- `format` — Formats the codebase using Prettier. (line [89](./package.json#L89))
173197

174198
```bash
175199
prettier --write .
176200
```
177201

178-
- `lint` — Lints the codebase for potential errors and style violations. (line [90](./package.json#L90))
202+
- `lint` — Lints the codebase for potential errors and style violations. (line [87](./package.json#L87))
179203

180204
```bash
181205
eslint src/ **/*.js **/*.json
182206
```
183207

184-
- `lint:fix` — Lints the codebase and automatically fixes fixable issues. (line [91](./package.json#L91))
208+
- `lint:fix` — Lints the codebase and automatically fixes fixable issues. (line [88](./package.json#L88))
185209

186210
```bash
187211
eslint --fix src/ **/*.js **/*.json
188212
```
189213

190-
- `prep` — Prepares the codebase by generating documentation, linting, and formatting. (line [93](./package.json#L93))
214+
- `prep` — Prepares the codebase by generating documentation, linting, and formatting. (line [90](./package.json#L90))
191215

192216
```bash
193217
npm run docs && npm run lint:fix && npm run format
194218
```
195219

196-
- `test` — Runs the test suite using Jest. (line [88](./package.json#L88))
220+
- `test` — Runs the test suite using Jest. (line [85](./package.json#L85))
197221

198222
```bash
199223
jest --passWithNoTests
@@ -242,6 +266,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
242266

243267
```
244268
repo-description/
269+
├── __tests__
270+
│ ├── .gitkeep
271+
│ └── cli.test.js
245272
├── .qodo
246273
│ ├── agents
247274
│ └── workflows
@@ -255,11 +282,14 @@ repo-description/
255282
├── .gitignore
256283
├── .prettierrc.json
257284
├── babel.config.js
285+
├── CONTRIBUTING.md
258286
├── eslint.config.js
287+
├── LICENSE
259288
├── md.config.js
260289
├── package-lock.json
261290
├── package.json
262-
└── README.md
291+
├── README.md
292+
└── RULES_OF_CONDUCT.md
263293
```
264294

265295
<!-- end-doc-gen -->

RULES_OF_CONDUCT.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
24-
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
37-
professional setting
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
3838

3939
## Enforcement Responsibilities
4040

__tests__/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// This is a placeholder file to create the __tests__ directory.

__tests__/cli.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { program } = require('../src/cli');
2+
3+
describe('CLI Program', () => {
4+
test('should have the correct name', () => {
5+
expect(program.name()).toBe('repo-describer');
6+
});
7+
8+
test('should have the correct version', () => {
9+
expect(program.version()).toBe('1.0.0');
10+
});
11+
12+
test.skip('should execute the action correctly for local repo', async () => {
13+
// This test would require mocking fs, child_process, and the imported functions
14+
// from index.js (describeRepo, saveOutput, updateMarkdownMagicConfig).
15+
// It would also involve simulating command-line arguments.
16+
// For now, it's skipped.
17+
});
18+
19+
test.skip('should execute the action correctly for remote repo', async () => {
20+
// Similar to the local repo test, but also involves mocking git clone.
21+
});
22+
});

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"prettier-plugin-packagejson": "^2.5.19",
8181
"yaml-eslint-parser": "^1.3.0"
8282
},
83-
8483
"scriptsMeta": {
8584
"test": "Runs the test suite using Jest.",
8685
"describe": "Generates AI-powered descriptions for repository files and outputs them in various formats.",

0 commit comments

Comments
 (0)