DEV Community

Cover image for Code Alchemist CLI: Transforming Code with Magic
Anik2812
Anik2812 Subscriber

Posted on

Code Alchemist CLI: Transforming Code with Magic

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

πŸš€ What I Built

Code Alchemist CLI is a powerful, elegant command-line tool crafted to automate common code improvement tasks across multiple programming languages. As a student passionate about writing clean, maintainable code, I built this tool to simplify the repetitive parts of development and make code enhancement more accessible.

Whether you're diving into legacy scripts or kicking off a new project, Code Alchemist CLI boosts your productivity by offering:

  • 🧠 Code Analysis – Quickly inspects structure across multiple languages, including:
    • Python, JavaScript, Java
    • C/C++, HTML/CSS
    • Go, Ruby, Rust
    • TypeScript, PHP, Swift
    • And many more text-based file types!
  • πŸ“ Auto-Generated Docstrings – Instantly creates clean, readable documentation for your code.
  • πŸ”„ Refactoring Assistance – Transforms unoptimized code into more efficient and readable forms.
  • βœ‚οΈ Import & Code Optimization – Cleans up unused imports and cluttered comments.
  • πŸͺ„ Multi-Language Support – Works seamlessly with 20+ file types and programming languages.

It's a perfect companion for developers, students, and small teams seeking to improve code hygiene and maintainability without depending on heavy IDEs or paid extensions.


πŸ“¦ Code Repository & Setup

πŸ”— https://github.com/Anik2812/Code-Alchemist

Quick Start Guide:

# Clone the repository
git clone https://github.com/Anik2812/Code-Alchemist.git

# Navigate to the project directory
cd Code-Alchemist

# Make the setup script executable
chmod +x ./setup.sh

# Run the setup script
./setup.sh
Enter fullscreen mode Exit fullscreen mode

πŸ–₯️ Demo

πŸ§ͺ Try the demo to preview changes without writing them:

./demo.sh
Enter fullscreen mode Exit fullscreen mode

πŸ“½οΈ Comprehensive CLI Commands

Here's how easy it is to use Code Alchemist CLI:

# Analyze a file
./code_alchemist.py analyze filename

# Refactor a file
./code_alchemist.py refactor filename

# Generate documentation for the file
./code_alchemist.py document filename

# Suggest performance and security improvements
./code_alchemist.py optimize filename

# Generate project dashboard
./code_alchemist.py dashboard filename

# Setup project structure and config files
./code_alchemist.py setup filename

# Run all transformations at once
./code_alchemist.py transmute filename
Enter fullscreen mode Exit fullscreen mode

πŸ’» Using Code Alchemist in Different Environments

Windows Subsystem for Linux (WSL) Support

If you're using Windows Subsystem for Linux, you can easily access files from your Windows drives:

# Access files in Windows drives
cd "/mnt/(drive name)/path to the file"
# or
cd "/mnt/c/Users/YourUsername/Documents/YourProject"
# or
cd "/mnt/d/Development/YourProject"
Enter fullscreen mode Exit fullscreen mode

Pro Tips for WSL Users:

  • Use /mnt/ prefix to access Windows drives
  • Common drive mappings:
    • /mnt/c/ for C: drive
    • /mnt/d/ for D: drive
    • And so on...
  • Ensure you have the correct permissions to access the directory

Cross-Platform Compatibility

Code Alchemist is designed to work seamlessly across:

  • Linux
  • macOS
  • Windows (via WSL)
  • Windows Git Bash

πŸŽ₯ Video Demonstration

πŸ”— Watch Full Demo Video

Supported Languages and File Types

Code Alchemist supports a wide range of languages and file types:

  • Programming Languages:

    • Python
    • JavaScript
    • Java
    • C/C++
    • Go
    • Ruby
    • Rust
    • TypeScript
    • PHP
    • Swift
  • Configuration and Markup:

    • Markdown
    • JSON
    • XML
    • YAML
    • INI
    • HTML
    • CSS
    • Shell Scripts
    • Batch/PowerShell Scripts
  • Other Text-Based Files:

    • Configuration files
    • Plain text files
    • And more!

Screenshots

Code Analysis Structure
Project Overview
Analyze structure in a single command.

Additional Screenshot 1
Additional Screenshot 2


πŸ€– How I Used Amazon Q Developer

Throughout the development of Code Alchemist CLI, Amazon Q Developer was like a coding partnerβ€”always available to support, debug, and refine my ideas. Here's how I integrated Q Developer into my process:

  • 🧩 Modular Planning: Used Q Developer to brainstorm clean function breakdowns and organize the CLI structure using argparse, os, and pathlib.
  • πŸ› οΈ Refactoring & Docstrings: Q Developer assisted in creating generalized logic for code transformation and accurate docstring generation, handling edge cases gracefully.
  • πŸ§ͺ Debugging: It provided quick, reliable solutions for path resolution issues, encoding errors, and text parsing bugs.
  • πŸ“š Documentation: Helped polish project documentation, CLI help text, and inline comments for better readability and professionalism.

Thanks to Q Developer, I could focus more on logic and user experience rather than getting stuck on syntax or structure.

πŸ™‹β€β™‚οΈ Solo Submission

Top comments (0)