uncomment-cli
v2.11.0
Published
A fast Rust-based CLI tool for removing comments from source code
Maintainers
Readme
uncomment-cli
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 - Supports 12+ programming languages
- 🔧 Zero Dependencies - Downloads a self-contained binary
Installation
npm install -g uncomment-cliThe 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.pyPreview 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 (
eslint-disable,@ts-ignore, etc.) - Documentation strings and JSDoc comments (configurable)
Supported Languages
Python, JavaScript, TypeScript, Rust, Go, Java, C/C++, Ruby, YAML, Terraform/HCL, Makefile, and more!
Common Use Cases
Clean up AI-generated code:
uncomment generated_code.jsRemove all comments including TODOs:
uncomment --remove-todo --remove-fixme src/Remove documentation comments:
uncomment --remove-doc api.tsUse multiple threads for large codebases:
uncomment --threads 8 entire_project/Documentation
For detailed documentation, advanced options, and examples, visit: https://github.com/Goldziher/uncomment
License
MIT - see LICENSE for details.
