DEV Community

aldrin312
aldrin312

Posted on

Autocomment 0.1 release!!

About the project

Autocomment is a Cli tool that automates the process of adding meaningful comments to your source code. By integrating with OpenAIโ€™s language models, Autocomment generates insightful comments that enhance code readability and documentation.

Key Features

  • Supports multiple coding languages: Javascript, C#, C++, TypeScript, ect.
  • Easy and simple.
  • Able to save output to a file.
  • Works in any directory.

Installation Guide

  1. Get a free API Key at https://console.groq.com
  2. Clone the repo
   git clone https://github.com/aldrin312/AutoCommentingTool.git
Enter fullscreen mode Exit fullscreen mode
  1. Install NPM packages
   npm install
Enter fullscreen mode Exit fullscreen mode
   npm install --save groq-sdk
Enter fullscreen mode Exit fullscreen mode
   npm install commander
Enter fullscreen mode Exit fullscreen mode
   npm install dotenv
Enter fullscreen mode Exit fullscreen mode
  1. Create a .env file and add your api into it

    GROQ_API_KEY=<api-key>
    

Usage

To use the CLI tool make sure to change the excecution policies for windows.

To do this run windows powershell in administration mode and run the command:

    Set-ExecutionPolicy RemoteSigned
Enter fullscreen mode Exit fullscreen mode

And then run the command:

    npm link
Enter fullscreen mode Exit fullscreen mode

To create the CLI tool avialable to use in powershell in any directory.

Tool Execution:

    autocomment <filename> ...
Enter fullscreen mode Exit fullscreen mode

Command can also be executed without changing execution policy or running npm link by running this command:

   node index.js <filename> ...
Enter fullscreen mode Exit fullscreen mode

Options:

  • --version or -v: Shows the current version of Autocomment.
  • --help or -h: Shows help menu.
  • --save <output-filename> or -s <output-filename>: saves the output to the output folder with the designated filename.
 autocomment -s <output-filename> <filename>...
Enter fullscreen mode Exit fullscreen mode

Demo:
tool demo

Future features

  • Customization: Allow user to specify how they want the comments to be generated
  • Option to add the api in Cli.
  • Save the outputs to multiple files.
  • File restrictions: Only allow specific file formats.

GitHub link

https://github.com/aldrin312/AutoCommentingTool

Top comments (0)