Observed since 21 Oct, 10:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
An AI-powered tool to automatically comment code using local Ollama models.
An intelligent command-line tool that uses local Ollama models to automatically generate high-quality, structured comments for your code.
The AI Code Commenter is designed for developers who value security, customization, and efficiency. By leveraging the power of local Large Language Models (LLMs), it offers several key advantages:
Follow these steps to get the commenter tool up and running.
The commenter tool requires Ollama to be running on your system.
Linux & macOS: Run the following command in your terminal.
curl \-fsSL https://ollama.com/install.sh | sh
Windows: Download and run the installer from the Ollama website.
After installing, you need to pull a model. llama3 is a great choice for quality. For faster performance on less powerful hardware, phi3:mini is an excellent alternative.
Pull a high-quality model (recommended)
ollama pull llama3
# Or pull a smaller, faster model
ollama pull phi3:mini
Important: Make sure the Ollama application is running before you use the commenter tool.
Install the tool directly from PyPI using pip.
pip install ai-code-commenter-vraj0703
The first time you run the config command, the tool will automatically create a configuration directory and default templates on your system.
commenter config
This command will:
\~/.config/commenter/ (this path works for Linux, macOS, and Windows).format.txt and syntax.txt files into it, which you can then customize.You can easily configure the tool to fit your needs using the config command.
You can tell the commenter which Ollama model to use. If the model isn't downloaded, the tool will pull it for you.
commenter config --model phi3:mini
The real power of this tool comes from its configurable templates. The config command allows you to point the tool to your own custom template files.
Example for a project using custom Java templates
commenter config --format-path "/path/to/my/java\_format.txt" --syntax-path "/path/to/my/java\_syntax.txt"
If you don't set custom paths, the tool will use the default files located in \~/.config/commenter/.
This file controls what goes inside your comments. You can define placeholders for the AI to fill in.
Example format.txt:
Author: AI Assistant
Date: <CURRENT_DATE>
Description: <A high-level summary of the file's purpose.>Functions:- <function_name_1>: <Brief description of what this function does.>
This file tells the AI how to write the comment for a specific language.
Example syntax.txt for Java/JavaScript:
The entire comment block must be a valid documentation comment. It must start with `/**` on its own line, each line must begin with a ` * `, and it must end with ` */` on its own line.
Example syntax.txt for Python:
Every single line of the comment block must start with a `#` character followed by a space.
Once configured, using the tool is simple. Use the run command followed by the path to your code.
commenter run /path/to/your/file.py
The tool will find and comment on all supported source files within the folder and its subdirectories.
commenter run /path/to/your/project/
ollama run \<your\_model\_name\> "Hello\!" in your terminal first.commenter config --model phi3:mini.\~/.config/commenter directory. The next time you run commenter config, the folder and default files will be recreated.This project is open source. If you find a bug or have a feature request, please open an issue on our GitHub repository.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.6 | 6 Oct 2025 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 10:12 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7e4a89f9f6d3b9abd051e62b75b88f60f71ce634ae0ef4f12f60079138e919a6