DEV Community

Cover image for πŸ¦† Quack Docs β€” AI-Powered Code Documentation From Your CLI
Wesley Bertipaglia
Wesley Bertipaglia Subscriber

Posted on

πŸ¦† Quack Docs β€” AI-Powered Code Documentation From Your CLI

This is a submission for the Amazon Q Developer "Quack The Code" Challenge: Crushing the Command Line

Hey devs! πŸ‘‹

Introducing Quack Docs β€” a powerful command-line tool that generates complete, high-quality documentation for code in any programming language, leveraging the capabilities of the Amazon Q Developer CLI. No chunking, no partials β€” just clean, comprehensive docs with a single command.

πŸ“¦ Source Code: GitHub Repository
πŸ› οΈ Built With: Python and Amazon Q Developer CLI


πŸ“š Table of Contents

  1. πŸ’‘ The Idea
  2. πŸ› οΈ How It Works
  3. πŸš€ Getting Started
  4. πŸ§ͺ Usage
  5. ✨ Why You'll Love It
  6. πŸ”­ What’s Next
  7. 🧠 Final Thoughts

πŸ’‘ The Idea

Let’s be honest: writing documentation isn't most developers idea of fun.
So I thought β€” what if you could skip the boring part and instantly generate beautiful, structured docs right from your terminal for any programming language?

Quack Docs was born to solve just that.

What It Does:

  • πŸ“„ Generates Markdown documentation for your code files.
  • 🧠 Adds smart, context-aware docstrings directly into your code.
  • ⚑ Works with a single command β€” no chunking or manual editing required.

πŸ› οΈ How It Works

Quack Docs

Here’s what happens under the hood when you run Quack Docs:

  1. πŸ“‚ Reads Your Code File
    The tool reads the entire contents of the provided source file β€” no splitting or chunking needed.

  2. 🧠 Determines Output Mode
    It checks whether to:

  • generate an external Markdown file, or
  • inject inline docstrings (if --inplace is used).
  1. ✍️ Builds a Prompt and Sends It to Amazon Q Based on the selected mode, it creates a tailored prompt, sends it to Amazon Q Developer CLI, and saves the output β€” either as a .md file or a modified code file with docstrings.

πŸš€ Getting Started

πŸ“¦ Prerequisites

  • Python 3.8 or higher, you can download it from python.org.
  • pipx for installing Python applications in isolated environments.
  • Amazon Q CLI for code analysis and documentation generation.

⚑ Setup

1️⃣ Clone the Repo

git clone https://github.com/wesleybertipaglia/quack-docs.git
cd quack-docs
Enter fullscreen mode Exit fullscreen mode

2️⃣ Set Up Amazon Q CLI

Follow the official setup guide and authenticate:

q login
Enter fullscreen mode Exit fullscreen mode

3️⃣ Install Quack Docs

make install
Enter fullscreen mode Exit fullscreen mode

That's it, now quack-docs is ready to use! πŸŽ‰


πŸ§ͺ Usage

▢️ Generate Markdown Documentation

quack-docs --file path/to/your_file.py
Enter fullscreen mode Exit fullscreen mode

➑️ Creates a Markdown file like:
./docs/quack_your_file_20250510_103000.md

You can also choose a custom output directory:

quack-docs --file path/to/your_file.py --output ./my_docs/
Enter fullscreen mode Exit fullscreen mode

➑️ Creates:
./my_docs/quack_your_file_20250510_103000.md

πŸ“„ Sample Markdown Output:

# Quack Docs β€” calculator.py

file: calculator.py  
created at: 2025-05-10  
---

## Overview
The Calculator class provides basic arithmetic functions and stores the result of the last operation.

## Methods

### add(a, b)
Performs addition of two numbers and stores the result in memory.

Parameters:
β€’ a: First number  
β€’ b: Second number

Returns:
β€’ The sum of the two numbers
Enter fullscreen mode Exit fullscreen mode

▢️ Insert Docstrings into Your Code

quack-docs --file path/to/your_file.py --inplace
Enter fullscreen mode Exit fullscreen mode

➑️ Overwrites your file with inline docstrings.

You can optionally save the modified file into a different directory while preserving its filename:

quack-docs --file path/to/your_file.py --inplace --output ./src/
Enter fullscreen mode Exit fullscreen mode

➑️ Saves:
./src/your_file.py

πŸ“ Before:

def add(a, b):
    return a + b
Enter fullscreen mode Exit fullscreen mode

βœ… After:

def add(a, b):
    """
    Add two numbers and return the result.

    Args:
        a: First number
        b: Second number

    Returns:
        The sum of a and b.
    """
    return a + b
Enter fullscreen mode Exit fullscreen mode

⚠️ Important: The --output parameter must always be a directory path, not a full file path.


✨ Why You'll Love It

Quack Docs:

  • πŸ¦† Instantly documents your code with zero hassle
  • πŸ“‘ Outputs well-structured Markdown or enhances your source files with rich docstrings
  • ⚑ Automates a boring task so you can focus on building
  • πŸŽ‰ Adds a touch of duck-themed joy to your terminal experience

πŸ”­ What’s Next

Planned improvements include:

  • πŸ“Š Documentation coverage stats
  • 🧩 VS Code extension
  • 🐣 Terminal duck animation while docs generate

🧠 Final Thoughts

Quack Docs is a no-nonsense, fun little tool that helps developers focus on what they love β€” coding β€” while Amazon Q Developer CLI handles the documentation.

Thanks to AWS and DEV for a fun, productive challenge.

Let the ducks document. πŸ¦†βœ¨

Top comments (15)

Collapse
 
srbhr profile image
πš‚πšŠπšžπš›πšŠπš‹πš‘ πšπšŠπš’

It's vibe documentation. :)

Collapse
 
wesleybertipaglia profile image
Wesley Bertipaglia

Vibe-driven development (VDD) is the future hahaha

Collapse
 
dev_99718084404de profile image
Dev

I love this one!!

Collapse
 
wesleybertipaglia profile image
Wesley Bertipaglia

Thank you so much πŸ¦†

Collapse
 
sarahkeithp profile image
Sarah Keith

Really cool idea! Love the inline docstring option, that’s a nice touch. Good luck with the challenge! πŸ¦†

Collapse
 
wesleybertipaglia profile image
Wesley Bertipaglia

Thank you so much! πŸ¦†βœ¨ I’m glad you liked the inline docstring option, it was one of those little features I knew had to be in there. Appreciate the support and good luck to you too if you're participating! πŸš€

Collapse
 
perisicnikola37 profile image
Nikola PeriΕ‘iΔ‡ • Edited

Cool idea. Is Amazon Q free?

Collapse
 
wesleybertipaglia profile image
Wesley Bertipaglia

Yes, Amazon Q has a free plan, I have used it in my tests and it has a good free tier

Collapse
 
omaryousifkamal profile image
Omar Yosuif

that's

that's quackiy

Collapse
 
wesleybertipaglia profile image
Wesley Bertipaglia

πŸ¦†πŸ¦†πŸ¦†

Collapse
 
michael_liang_0208 profile image
Michael Liang • Edited

Great Post! πŸ¦†

Collapse
 
wesleybertipaglia profile image
Wesley Bertipaglia

Hi Michael, thank you so much πŸ¦†

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more