uncomment
A blazing fast Rust-based command-line tool that removes comments from your source code. Perfect for cleaning up AI-generated code that comes with excessive explanations.
Why Use This?
- 🚀 Lightning Fast - Built in Rust for maximum performance
- 🎯 100% Accurate - Never accidentally removes code that looks like comments
- 🛡️ Safe by Default - Preview changes before applying them
- 🌍 Multi-language - 49 built-in languages, 306 available via tree-sitter-language-pack
- 🔧 Zero Dependencies - Downloads a self-contained binary
Installation
pip install uncomment
The installer will automatically download the appropriate pre-compiled Rust binary for your platform (Windows, macOS, or Linux).
Quick Start
Remove comments from a single file:
uncomment main.py
Preview changes without modifying files:
uncomment --dry-run src/
Process all Python files in a directory:
uncomment "src/**/*.py"
Key Features
Smart Comment Detection
Unlike simple regex-based tools, uncomment understands your code's structure:
# This comment will be removed
code = "# But this won't - it's in a string!"
Preserves Important Comments
Keeps what matters:
TODOandFIXMEcomments (configurable)- License headers and copyright notices
- Linting directives (
# noqa,# type: ignore, etc.) - Docstrings (configurable)
Perfect for Python Projects
- Handles all Python comment styles
- Preserves type hints and annotations
- Respects
# pylint:,# flake8:, and other linter directives - Works with
.py,.pyw,.pyi,.pyx, and.pxdfiles
Common Use Cases
Clean up AI-generated code:
uncomment generated_script.py
Remove all comments including TODOs:
uncomment --remove-todo --remove-fixme module.py
Remove docstrings:
uncomment --remove-doc api.py
Process entire packages:
uncomment my_package/
Use multiple threads for large codebases:
uncomment --threads 8 entire_project/
Supported Languages
While this tool works great for Python, it also supports: 49 built-in languages including JavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, Dockerfile, Scala, Dart, and many more. 306 total languages available via tree-sitter-language-pack.
Documentation
For detailed documentation, advanced options, and examples, visit: https://github.com/Goldziher/uncomment
License
MIT - see LICENSE for details.
Metadata
Release files for uncomment 3.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uncomment-3.6.0.tar.gz | 4.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uncomment-3.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.1 kB
Release files / uncomment-3.6.0.tar.gz
| Download URL | uncomment-3.6.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5560d6fc3bb0330568de9ddc230aecdf0d64543a8c7532cdb63311e1a4da369e
|
|
BLAKE2b-256 checksum How to use checksums |
550db6707db0f7c8d3f9b1b0cda591cef5729d063cb3b2b7e18af944f5df03c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency logRelease files / uncomment-3.6.0-py3-none-any.whl
| Download URL | uncomment-3.6.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab18078ef1124130363d4f6cfb2b62d97db67f42311a3f89ec09a9f5d86afa36
|
|
BLAKE2b-256 checksum How to use checksums |
88e796017c5e431b060e50942a22b376ff63da57d8e3988b12dc1f139195f366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 30, 2026.
Transparency log