DEV Community

aldrin312
aldrin312

Posted on

1

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

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

πŸ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay