Remove auto-generated comments from your codebase. A simple, extensible library for cleaning up AI-generated and IDE-generated comments.
Install from PyPI
pip install devibeClone the repository and install in development mode:
git clone https://github.com/nhunter0/devibe.git
cd devibe
pip install -e .After installation, you can run devibe either:
-
As a Python module (works anywhere):
python -m devibe myfile.py
-
Direct command (if pip Scripts directory is in PATH):
devibe myfile.py
Clean a single file:
devibe myfile.pyClean a directory recursively:
devibe ./src -rDry run to see exactly what lines would be removed:
devibe myfile.py --dry-runThis will show output like:
myfile.py - Would remove 3 line(s):
1. # Generated by Claude
2. x = 1 # β
AI-generated
3. # ... rest of implementation
Process only specific file types:
devibe ./src -r -e .py .js .javafrom devibe import CommentRemover
remover = CommentRemover()
# Clean a single file
removed_count, removed_comments = remover.clean_file("myfile.py")
# Clean a directory
stats = remover.clean_directory("./src", recursive=True, extensions=[".py", ".js"])
print(f"Removed {stats['comments_removed']} comments from {stats['files_modified']} files")devibe comes with intelligent rules to detect and remove:
generated by Claude,AI-generated,Created by GPT- Comments from Copilot, Codeium, TabNine, and other AI assistants
- Auto-generated code stubs and boilerplate
- IDE template comments from VSCode, IntelliJ, Eclipse
- Emoji indicators (β , π, π, etc.)
- Status prefixes (
FIXED:,REMOVED:,ENHANCED:,SIMPLIFIED:) - Case-insensitive matching with or without colons
... rest of code,... existing methodsyour code here,insert logic hereTODO: implement,stub,placeholder
List active rules:
devibe --list-rulesI have definetly missed rules so if you have any feel free to go to: /devibe/rules.py add a custom rule send a PR.
Add custom patterns on the fly:
devibe myfile.py --add-pattern "my_rule" "pattern_to_match"from devibe import CommentRemover, PatternRule
remover = CommentRemover()
# Add a custom pattern rule
custom_rule = PatternRule(
name="custom_assistant",
description="Remove specific assistant comments",
patterns=[r"generated by my-assistant", r"my-assistant wrote this"]
)
remover.rule_registry.add_rule(custom_rule)
# Now clean files with your custom rule active
remover.clean_file("myfile.py")from devibe.rules import Rule
class KeywordRule(Rule):
def __init__(self, keywords):
super().__init__("keyword_rule", "Remove comments with specific keywords")
self.keywords = [k.lower() for k in keywords]
def matches(self, comment):
comment_lower = comment.lower()
return any(keyword in comment_lower for keyword in self.keywords)
# Use your custom rule
remover = CommentRemover()
remover.rule_registry.add_rule(KeywordRule(["autogen", "placeholder"]))- Python 3.7+
- No external dependencies for core functionality
Install in development mode with:
git clone https://github.com/nhunter0/devibe.git
cd devibe
pip install -e .Run tests:
pytest tests/We welcome contributions! To add support for new languages or improve detection rules:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Add your parser or rule to the appropriate registry
- Write tests for your changes
- Submit a pull request
- PyPI package publication
- Devibe UI & UX !
- VS Code extension
- More language-specific rules
MIT
Created with β€οΈ to keep codebases clean and professional.