Skip to main content

AI-powered CLI tool that builds professional '*.md' documentation files of a project for internal teams using the Google Gemini API.

Project description


PKG NAME๐Ÿ“˜: devDocs โ€“ AI-powered automated project documentation writer

devDocs is a command-line tool that automatically creates high-quality README.md files by analyzing your projectโ€™s folder structure, source code, and any existing documentation. It uses the Google Gemini API to generate clear, structured, and professional Markdown documentation.

Perfect for:

  • Open-source contributors ๐Ÿ’ก
  • Developers maintaining internal tools ๐Ÿ› ๏ธ
  • Hackathon projects needing clean docs fast ๐Ÿš€

๐Ÿ“‚ Example Project Structure

Hereโ€™s how your project might look before and after using devDocs:

your-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ””โ”€โ”€ utils.py
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ README.md   <-- Generated/Overwritten by devDocs

โš™๏ธ How It Works (Behind the Scenes)

Here's what happens when you run devDocs:

  1. Scans your project โ€“ Analyzes directory structure, code files, and existing README files.
  2. Parses content โ€“ Gathers code and documentation from each relevant file/folder.
  3. Generates documentation โ€“ Sends context to Google Gemini API to craft a structured README.md.
  4. Saves output โ€“ Writes the generated Markdown into your project (or into a custom output folder).

๐Ÿ” Optional features:

  • Preserves your original README unless you use --overwrite.
  • Includes/excludes specific files or folders with filters.

๐Ÿ“ฆ Installation

Install from PyPI:

pip install devDocs

๐Ÿ”‘ Requirements


๐Ÿš€ Usage

Inside the root folder of your project, run:

devDocs [OPTIONS]

The CLI will prompt for your Google Gemini API key. Paste it once when asked.

CLI Options

Option Description
--path Root path to scan (default: current directory)
--name Project name to display in the README
--description Short description for the project
--authors Comma-separated list of authors
--keywords Comma-separated list of keywords (e.g., cli, docs, auto)
--overwrite Overwrite existing README.md files (default: False)
--output Output folder to save generated docs (default: docs/)
--exclude Comma-separated folders/files/extensions to exclude
--include Comma-separated folders/files/extensions to force include

โœ… Example Command

devDocs --path . \
        --name "Cool Dev Tool" \
        --description "Generate AI-based READMEs effortlessly" \
        --authors "Gantavya Bansal" \
        --keywords "cli, docs, automation, openai" \
        --output docs \
        --overwrite

This will:

  • Walk through all folders from current directory
  • Create a docs/README.md and other structured markdowns
  • Overwrite existing README if one exists

๐Ÿง  Features

  • โœ… Generates structured, professional README.md files automatically
  • โœ… Preserves original docs unless --overwrite is set
  • โœ… Supports include/exclude filtering for granular control
  • โœ… Smart project tree visualization included in docs
  • โœ… Outputs all documentation to a single folder (--output)
  • โœ… Powered by Google Gemini AI (clean & readable Markdown)

๐Ÿ—๏ธ Example Output (Generated)

Hereโ€™s a sample snippet of what the generated README might look like:

# Cool Dev Tool

This is a CLI tool for generating clean README.md files using Google Gemini.

## Folder Structure
your-project/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ””โ”€โ”€ utils.py
โ”œโ”€โ”€ README.md
...

## Usage
...

๐Ÿงฑ Technologies Used

  • Python 3.8+
  • google-genai
  • argparse, os, logging, time โ€“ for CLI and system interaction

๐Ÿงฐ Developer Notes

If you're contributing or extending this project:

Core Files

File Purpose
cli.py CLI interface + core logic
README.md The README template output (can be regenerated)
LookFolder() Recursive folder/file scanner
GenerateReadMe() Sends data to Gemini and processes results
print_tree() Generates folder structure view in tree format

Data Flow

  1. CLI parses args โ†’
  2. Filters folders/files โ†’
  3. Reads source + existing docs โ†’
  4. Calls GenerateReadMe() โ†’
  5. Writes Markdown to output

API Instruction Logic (Simplified)

system_instruction = '''
You are Gantavya Bansal, a senior engineer and tech writer.
Generate clean, professional Markdown documentation using code + structure context.
Include:
- Title
- Folder Tree
- Description
- Usage
- Tech Stack
- Known Issues
- Licensing
'''

โš ๏ธ Known Limitations

  • ๐Ÿ“ก Needs an internet connection for Gemini API
  • ๐Ÿ” Limited retry logic for failed API calls
  • โš™๏ธ Include/exclude filters don't yet support regex
  • ๐Ÿ“„ Only supports .md output format

๐Ÿ“œ License

MIT License โ€“ Youโ€™re free to use, modify, and share. Attribution is appreciated!


๐Ÿ’ฌ Contributing

Feel free to open issues, suggest improvements, or contribute directly. Pull requests are always welcome!


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devdocs-2.0.3.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devdocs-2.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file devdocs-2.0.3.tar.gz.

File metadata

  • Download URL: devdocs-2.0.3.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for devdocs-2.0.3.tar.gz
Algorithm Hash digest
SHA256 92f1308ef7d21cb2f58cdcd70792cc29db5922d0440ea77908afa98e529c6ab1
MD5 fb5cb0cb40bbb5b935133d7f71a1a5a7
BLAKE2b-256 4ff0194fd2b4663f8d90579585db4c572e7817b030fe91c4e0764bb9c1649ebe

See more details on using hashes here.

Provenance

The following attestation bundles were made for devdocs-2.0.3.tar.gz:

Publisher: publish.yml on bgantavya/devDocs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file devdocs-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: devdocs-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for devdocs-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e136b4ddaa7dea2ed76b878050c1e9d2b4d96ed483cb66dab3391ffead977789
MD5 dca2dc15070907337ba15b751bda0a61
BLAKE2b-256 bd3be84d49227bed38d0e0dc5daf55f273d2f2796701d496bfe328f6ea90e669

See more details on using hashes here.

Provenance

The following attestation bundles were made for devdocs-2.0.3-py3-none-any.whl:

Publisher: publish.yml on bgantavya/devDocs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page