Poly-Glot — AI Code Comments, JSDoc Generator & Code Documentation
🎬 See It In Action
✨ What is Poly-Glot?Poly-Glot is a VS Code extension that uses AI to write your code documentation for you — in seconds. Select a function, press a shortcut, and get perfect, language-native comments inserted directly into your file.
Powered by OpenAI (GPT-4.1, GPT-4o, o3), Anthropic (Claude Sonnet 4, Claude Opus 4, Claude Haiku 4), and Google (Gemini 2.5 Flash, Gemini 2.5 Pro, Gemini 2.5 Flash Lite). You bring your own API key — no middleman, no markup, no data collection. 🆓 Free vs 💎 Pro vs 👥 Team vs 🏢 Enterprise
💎 Upgrade👉 View plans → poly-glot.ai/#pg-pricing-section 📧 Enterprise & Team inquiries: hwmoses2@icloud.com After subscribing, open the Command Palette ( 🚀 Getting Started in 60 Seconds
That's it. No backend, no account required for the Free tier, no telemetry. 🛠 Features📝 Generate AI Comments —
|
| Analysis | Detail |
|---|---|
| 📖 Plain-English summary | What this code does, for any audience |
| 📊 Complexity score (1–10) | Cyclomatic complexity with visual indicator |
| 🔬 Function/method breakdown | Params, return types, side effects |
| 🐛 Potential bugs | Issues the AI detected |
| 💡 Improvement suggestions | Refactoring and optimization ideas |
| 📈 Documentation quality score | 0–100 rating of existing comments |
📚 Templates Sidebar (Free)
Browse a curated library of comment templates for all 12 supported languages. One-click copy to clipboard for:
- Class/module headers
- Function doc-comment skeletons
- License headers
- TODO / FIXME / HACK / DEPRECATED blocks
- API endpoint documentation stubs
💰 Real-Time Cost Tracking (Free)
Every generation displays the exact token cost in the status bar. A typical function documentation costs < $0.001. Document an entire file for pennies.
⌨️ All Commands & Shortcuts
| Command | Mac | Windows / Linux | Plan | Description |
|---|---|---|---|---|
Poly-Glot: Generate AI Comments |
Cmd+Shift+/ |
Ctrl+Shift+/ |
Free | Generate & insert doc-comments inline |
Poly-Glot: Why Comments |
Cmd+Shift+W |
Ctrl+Shift+W |
Pro | Insert intent & trade-off inline notes |
Poly-Glot: Both Comments |
Cmd+Shift+B |
Ctrl+Shift+B |
Pro | Doc-comments + why-comments in one pass |
Poly-Glot: Explain Code |
Cmd+Shift+E |
Ctrl+Shift+E |
Free | Open deep AI analysis side panel |
Poly-Glot: Configure API Key |
— | — | Free | Set provider, model & API key |
Poly-Glot: Configure License Token |
— | — | Pro | Activate Pro license |
Poly-Glot: Open Templates Sidebar |
— | — | Free | Browse comment templates |
⚙️ Settings
| Setting | Default | Description |
|---|---|---|
polyglot.provider |
openai |
AI provider: openai, anthropic, or google |
polyglot.model |
gpt-4.1-mini |
Any valid model ID from your provider (see tables below, or enter a custom ID) |
polyglot.licenseToken |
— | Pro license token from poly-glot.ai |
polyglot.insertInline |
true |
true = insert into file · false = open side panel |
polyglot.commentStyle |
auto |
Force a style: jsdoc, javadoc, pydoc, doxygen, etc. |
🤖 Supported AI Models
Poly-Glot accepts any valid model ID from OpenAI, Anthropic, or Google — including models not listed here. Just type the model ID into the polyglot.model setting.
OpenAI Models
| Model | Notes | Est. cost / request* |
|---|---|---|
gpt-4.1-mini ⭐ Recommended |
Best quality-to-cost ratio | ~$0.001 |
gpt-4.1 |
Best GPT-4.1 quality | ~$0.004 |
gpt-4.1-nano 💵 Cheapest |
Fastest & lowest cost | ~$0.0002 |
gpt-4o |
Great quality, widely supported | ~$0.005 |
gpt-4o-mini |
Budget option, very fast | ~$0.0003 |
o3-mini |
Fast reasoning model | ~$0.002 |
o3 |
Most powerful reasoning | ~$0.018 |
o1-mini |
Budget reasoning | ~$0.002 |
o1 |
Full reasoning, slower | ~$0.027 |
gpt-4-turbo |
Previous-gen turbo | ~$0.014 |
gpt-3.5-turbo |
Legacy, lightest output | ~$0.0007 |
Get an OpenAI API key at platform.openai.com/api-keys.
Anthropic Models
| Model | Notes | Est. cost / request* |
|---|---|---|
claude-sonnet-4-5 ⭐ Recommended |
Excellent quality & speed | ~$0.007 |
claude-opus-4-5 🏆 Most Powerful |
Deepest analysis | ~$0.033 |
claude-haiku-4-5 💵 Cheapest |
Fastest & lowest cost | ~$0.002 |
claude-3-5-sonnet-20241022 |
Proven quality, previous gen | ~$0.007 |
claude-3-5-haiku-20241022 |
Budget Claude, very fast | ~$0.002 |
claude-3-opus-20240229 |
Deep reasoning, older gen | ~$0.033 |
claude-3-haiku-20240307 |
Lightest legacy Claude | ~$0.0006 |
Get an Anthropic API key at console.anthropic.com/settings/keys.
Google Gemini Models 🆕
| Model | Notes | Est. cost / request* |
|---|---|---|
gemini-2.5-flash ⭐ Recommended |
Best speed & quality balance, 1M context | ~$0.001 |
gemini-2.5-pro 🏆 Most Powerful |
Deepest code reasoning, 1M context | ~$0.005 |
gemini-2.5-flash-lite 💵 Cheapest |
Ultra-fast, lowest cost | ~$0.0003 |
gemini-2.0-flash-001 |
Stable GA release | ~$0.0003 |
Get a Google AI key (free) at aistudio.google.com/app/apikey.
* Estimates based on ~200-token input / 400-token output (a typical small function). Costs scale with file size. Check platform.openai.com/pricing, anthropic.com/pricing, and ai.google.dev/pricing for current rates.
Using a custom or unlisted model
Set polyglot.model in VS Code settings to any model ID your provider supports:
// settings.json — OpenAI
{
"polyglot.provider": "openai",
"polyglot.model": "gpt-4o-2024-11-20"
}
// Anthropic
{
"polyglot.provider": "anthropic",
"polyglot.model": "claude-3-7-sonnet-20250219"
}
// Google
{
"polyglot.provider": "google",
"polyglot.model": "gemini-2.5-flash"
}
🌍 Supported Languages
| Language | Comment Standard | Format |
|---|---|---|
| JavaScript | JSDoc | /** @param … */ |
| TypeScript | TSDoc / JSDoc | /** @param … */ |
| Python | Google-style docstrings | """Args: …""" |
| Java | Javadoc | /** @param … */ |
| C# | XML doc comments | /// <summary>… |
| C / C++ | Doxygen | /** \param … */ |
| Go | GoDoc | // FunctionName … |
| Rust | rustdoc | /// … |
| Ruby | YARD | # @param … |
| PHP | PHPDoc | /** @param … */ |
| Swift | Swift markup | /// - Parameter … |
| Kotlin | KDoc | /** @param … */ |
| SQL | Header block | -- ============… |
🔌 MCP Server — Use Poly-Glot from Goose, Claude Desktop & Cursor
poly-glot-mcp is now live on npm — use Poly-Glot's full feature set from any MCP-compatible AI client without leaving your chat interface.
{
"mcpServers": {
"poly-glot": {
"command": "npx",
"args": ["-y", "poly-glot-mcp"],
"env": {
"POLYGLOT_PROVIDER": "openai",
"POLYGLOT_API_KEY": "sk-your-key-here",
"POLYGLOT_MODEL": "gpt-4.1-mini"
}
}
}
}
6 MCP tools available:
| Tool | Description |
|---|---|
polyglot_add_doc_comments |
JSDoc, Javadoc, PyDoc, Doxygen — all 12 styles |
polyglot_add_why_comments |
Inline WHY-comments explaining intent & trade-offs |
polyglot_add_all_comments |
Doc + WHY in one two-pass call |
polyglot_explain_code |
Complexity score, bugs, doc quality analysis |
polyglot_list_languages |
All 12 supported languages |
polyglot_list_models |
Models + cost tiers for your provider |
Compatible with: Goose · Claude Desktop · Cursor · Windsurf · any MCP client
🤖 GitHub Copilot Chat Integration
Prerequisite: The Poly-Glot VS Code Extension must be installed and configured with an API key before using Poly-Glot in Copilot Chat. Requires VS Code v1.95+ and an active GitHub Copilot subscription.
Poly-Glot registers itself as a Copilot Chat participant (@poly-glot), so you can generate comments, explain code, and get documentation analysis directly inside the Copilot Chat panel — no switching tabs, no copy-paste.
🔧 Setup (3 steps)
- Install the Poly-Glot extension from the VS Code Marketplace
- Configure your API key → Command Palette (
Cmd+Shift+P) →Poly-Glot: Configure API Key→ choose provider, paste key, pick model - Open Copilot Chat →
Cmd+Shift+I(Mac) /Ctrl+Shift+I(Windows/Linux) → type@poly-glotto activate
That's it. No extra config. The participant is registered automatically when the extension is active.
💬 Commands
| Command | What it does | Plan |
|---|---|---|
@poly-glot /comment |
Generate doc-comments for selected code | Free |
@poly-glot /explain |
Deep code analysis — complexity, bugs, doc quality | Free |
@poly-glot /why |
Add WHY-comments explaining intent & trade-offs | Pro |
@poly-glot /both |
Doc-comments + WHY-comments in one pass | Pro |
🗣 Prompt Examples
Generate doc-comments for a function:
@poly-glot /comment
Select the function in the editor first, then send the command. Poly-Glot generates JSDoc, Javadoc, PyDoc, etc. and shows an Apply to Editor button to insert inline.
Explain what a block of code does:
@poly-glot /explain
Returns a plain-English summary, complexity score (1–10), function-by-function breakdown, potential bugs, refactoring suggestions, and a documentation quality score (0–100).
Add WHY-comments to explain decisions (Pro):
@poly-glot /why
Inserts inline comments explaining why the code is written the way it is — trade-offs, algorithm choices, business constraints. Makes PRs self-reviewing and helps Copilot give you better suggestions.
Document everything in one shot (Pro):
@poly-glot /both
Runs two passes — first generates doc-comments, then adds WHY-comments — and delivers both in a single response with an Apply to Editor button.
Ask a follow-up question after /explain:
@poly-glot /explain
Why is the time complexity O(n²) here? Can it be improved?
Poly-Glot uses the same AI context window as your configured model, so you can follow up with natural language questions after any command.
❓ Copilot Chat FAQ
Does @poly-glot use my API key?
Yes — Poly-Glot uses whichever OpenAI, Anthropic, or Google key you configured in the extension. GitHub Copilot and Poly-Glot are completely separate; Poly-Glot does not use your Copilot subscription's token budget.
Why doesn't @poly-glot appear in chat?
The participant only registers if the extension is active and VS Code v1.95+ is installed. Try: Command Palette → Developer: Reload Window.
Can I use /why and /both without Pro?
No — WHY-comments and Both mode are Pro features. Upgrade at poly-glot.ai to unlock all languages, why-comments, and unlimited files for $12/mo.
Does it work with VS Code Insiders? Yes — any VS Code build ≥ 1.95 with Copilot Chat enabled works.
🔒 Privacy & Security
Your code and API keys are 100% private:
- 🔑 API keys stored in OS keychain — VS Code
SecretStorage(macOS Keychain, Windows Credential Manager, Linuxlibsecret). Never written tosettings.jsonor any log file. - 📡 Direct API calls only — requests go from your machine straight to OpenAI, Anthropic, or Google. Poly-Glot has no backend server, no relay, no proxy.
- 🚫 Zero telemetry — no usage data, no error reporting, no analytics are ever collected.
- 🏠 Your code never touches our servers — because we don't have any.
OpenAI, Anthropic, and Google may use API request data per their own privacy policies. If you're working with sensitive code, check your provider's data-handling settings (all three offer zero-data-retention options for API users).
💎 Unlock Pro — $12/mo
If you've tried the Pro features and want to unlock them permanently:
- Visit poly-glot.ai/#pg-pricing-section
- Choose Pro Monthly and complete checkout at $12/mo
- Copy your license token from your account dashboard
- In VS Code: Command Palette →
Poly-Glot: Configure License Token→ paste token → Pro activates instantly
Pro unlocks:
- ✅ Why-Comments (
Cmd+Shift+W) - ✅ Both Mode (
Cmd+Shift+B) - ✅ All 12 language support (C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, SQL)
- ✅ Unlimited file generations per month
❓ FAQ
Do I need a Poly-Glot account? No account is required for the Free tier. Just bring your own OpenAI, Anthropic, or Google API key.
Does Poly-Glot work offline? No — it needs to reach the OpenAI, Anthropic, or Google API. But no other internet connection is required.
Can I switch between OpenAI, Anthropic, and Google?
Yes — switch providers any time via Poly-Glot: Configure API Key. Only one provider is active at a time.
Do I need a paid Google account? No — Google AI Studio API keys are free to create at aistudio.google.com/app/apikey. Free-tier rate limits apply; enabling billing in Google Cloud unlocks higher quotas.
Will comments be inserted into my file or shown in a panel?
By default, comments are inserted inline at the correct position in your file. Set polyglot.insertInline: false to open a diff panel instead.
What if I select nothing? Poly-Glot documents the entire active file — great for batch documentation.
Is there a team or enterprise plan? Email support@poly-glot.ai for team licensing.
🗺 Roadmap
- [ ] Auto-comment on save
- [ ] Bulk comment entire workspace / folder
- [ ] GitHub Actions integration
- [ ] Custom comment templates editor
- [ ] Team shared templates
Have a feature request? Open an issue on GitHub or email support@poly-glot.ai.
🌐 Get It Everywhere
| Platform | Link |
|---|---|
| 💻 VS Code Marketplace | marketplace.visualstudio.com |
| ⬛ Open VSX · Cursor · Windsurf | open-vsx.org |
| 🌐 Web App | poly-glot.ai |
| ⌨️ CLI | npmjs.com/package/poly-glot-ai-cli |
| 🔌 MCP Server | npmjs.com/package/poly-glot-mcp |
| 🐙 GitHub App | github.com/apps/poly-glot-ai |
📦 About
Version: 1.4.14
Publisher: poly-glot-ai
Marketplace: poly-glot-ai.poly-glot
Open VSX: open-vsx.org/extension/poly-glot-ai/poly-glot
Website: poly-glot.ai
License: MIT © Harold Moses
Keywords: AI code comments, JSDoc generator, Javadoc generator, PyDoc generator, Doxygen, KDoc, rustdoc, GoDoc, PHPDoc, YARD, Swift markup, code documentation, why comments, code explainer, OpenAI, Anthropic, Google, Gemini, Gemini 2.5, Claude, GPT-4, GPT-4o, GPT-4.1, o3-mini, Claude Sonnet, Claude Opus, AI documentation, automatic comments, VS Code AI, code commenting tool
