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