Fss-Rag-Mini/cleanup_simple_branch.py
BobAi dc866e6ce3 MAJOR: Remove all Claude references and rename to Mini-RAG
Complete rebrand for v1.0-simple-search branch:

Directory Changes:
- claude_rag/ → mini_rag/ (preserving git history)

Content Changes:
- Updated all imports: from claude_rag → from mini_rag
- Updated all file paths: .claude-rag → .mini-rag
- Updated documentation and comments
- Updated configuration files and examples
- Updated all tests to use mini_rag imports

This ensures complete independence from Claude/Anthropic
branding while maintaining all functionality and git history.

Simple branch contains the basic RAG system without LLM features.
2025-08-12 19:27:55 +10:00

73 lines
2.3 KiB
Python

#!/usr/bin/env python3
"""
Simple cleanup script to rename claude_rag to mini_rag and fix references.
Designed specifically for the v1.0-simple-search branch.
"""
import os
import shutil
import re
from pathlib import Path
def main():
print("🧹 Cleaning up Claude references in v1.0-simple-search branch...")
# 1. Rename the claude_rag directory to mini_rag
claude_dir = Path("claude_rag")
mini_dir = Path("mini_rag")
if claude_dir.exists() and not mini_dir.exists():
print(f"📁 Renaming {claude_dir}{mini_dir}")
os.system(f'git mv claude_rag mini_rag')
else:
print("📁 Directory already renamed or doesn't exist")
# 2. Find and replace references in files
replacements = [
('claude_rag', 'mini_rag'),
('claude-rag', 'mini-rag'),
('.claude-rag', '.mini-rag'),
('from claude_rag', 'from mini_rag'),
('import claude_rag', 'import mini_rag'),
('Claude RAG', 'Mini RAG'),
('Claude Code', 'the development environment'),
]
files_to_update = []
# Find all relevant files
for pattern in ['**/*.py', '**/*.md', '**/*.sh', '**/*.yaml', '**/*.txt']:
files_to_update.extend(Path('.').glob(pattern))
updated_count = 0
for file_path in files_to_update:
if '.git' in str(file_path) or file_path.name == 'cleanup_simple_branch.py':
continue
try:
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
content = f.read()
original_content = content
# Apply replacements
for old, new in replacements:
content = content.replace(old, new)
# Write back if changed
if content != original_content:
with open(file_path, 'w', encoding='utf-8') as f:
f.write(content)
print(f" 📄 Updated: {file_path}")
updated_count += 1
except Exception as e:
print(f" ⚠️ Error processing {file_path}: {e}")
print(f"\n✅ Cleanup complete!")
print(f"📄 Files updated: {updated_count}")
print(f"📁 Directory renamed: claude_rag → mini_rag")
if __name__ == "__main__":
main()