---
title: "Automate code commenting using VS Code and Ollama"
url: https://daily.dev/posts/automate-code-commenting-using-vs-code-and-ollama-zduwmqh57
source_url: https://blog.logrocket.com/automate-code-commenting-using-vs-code-ollama/
type: article
source: "LogRocket"
published: 2024-11-05T16:11:17.238Z
updated: 2026-03-15T05:31:16.462Z
tags: ["ai", "devtools", "privacy", "typescript", "vscode"]
reading_time: 19
upvotes: 337
comments: 8
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Automate code commenting using VS Code and Ollama

**[LogRocket](https://daily.dev/sources/logrocket)** · 19 min read · 337 upvotes · 8 comments

## Summary

Learn how to create a VS Code extension that uses Ollama to automate code comment generation. The tutorial covers the setup of Ollama, creating a new extension project in VS Code with TypeScript, and implementing functions to interact with an LLM model for generating comments. It provides step-by-step instructions to build prompt-based comment generation within the IDE, ensuring productivity without sacrificing data privacy.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.logrocket.com/automate-code-commenting-using-vs-code-ollama/>

## Community discussion

Top comments from developers on daily.dev.

**@thecapedcoder** · 16 upvotes

> Nice proof of concept. I would be a bit concerned if anyone on my team was doing this though. Code should not need many comments and if it does then there are probably better places to spend your time than LLMs to actually fix it. I think we are starting to get dependent on LLMs to do the tasks that are "below" us, but in turn forgetting all the things we learned to reduce the dependency on those things. Well written code almost never needs comments, and when it does I don't think an LLM is going to have the context to know what to write.

**@nh24** · 3 upvotes

> I think code comments should reflect a person's view of that portion of code. When I read a comment I try to understand how the person who leave the comment was thinking about that code. Because some times it's important to understand the thought process behind the code.

**@mlepath** · 1 upvotes

> This is an insane idea. In the event you actually need to comment code, it needs to be based on some conceptual understanding: the exact thing that LLMs are NOT capable of.

**@ngthuongdoan** · 0 upvotes

> Mintlify Doc Writer
> I wonder that your solution is the same as this extension. All I know until now is using the AiI to generate code comments

**@lvmbdv** · 0 upvotes

> Cool article on integrating VSCode with ollama, bad examples though. Almost all of your examples are and should be self-documenting already.

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#ai](https://daily.dev/tags/ai), [#devtools](https://daily.dev/tags/devtools), [#privacy](https://daily.dev/tags/privacy), [#typescript](https://daily.dev/tags/typescript), [#vscode](https://daily.dev/tags/vscode)

[View this post on daily.dev](https://daily.dev/posts/automate-code-commenting-using-vs-code-and-ollama-zduwmqh57)
