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
- π‘ The Idea
- π οΈ How It Works
- π Getting Started
- π§ͺ Usage
- β¨ Why You'll Love It
- π Whatβs Next
- π§ 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
Hereβs what happens under the hood when you run Quack Docs:
π Reads Your Code File
The tool reads the entire contents of the provided source file β no splitting or chunking needed.π§ Determines Output Mode
It checks whether to:
- generate an external Markdown file, or
- inject inline docstrings (if
--inplace
is used).
- βοΈ 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
2οΈβ£ Set Up Amazon Q CLI
Follow the official setup guide and authenticate:
q login
3οΈβ£ Install Quack Docs
make install
That's it, now quack-docs is ready to use! π
π§ͺ Usage
βΆοΈ Generate Markdown Documentation
quack-docs --file path/to/your_file.py
β‘οΈ 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/
β‘οΈ 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
βΆοΈ Insert Docstrings into Your Code
quack-docs --file path/to/your_file.py --inplace
β‘οΈ 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/
β‘οΈ Saves:
./src/your_file.py
π Before:
def add(a, b):
return a + b
β 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
β οΈ 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)
It's vibe documentation. :)
Vibe-driven development (VDD) is the future hahaha
I love this one!!
Thank you so much π¦
Really cool idea! Love the inline docstring option, thatβs a nice touch. Good luck with the challenge! π¦
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! π
Cool idea. Is Amazon Q free?
Yes, Amazon Q has a free plan, I have used it in my tests and it has a good free tier
that's
that's quackiy
π¦π¦π¦
Great Post! π¦
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