@@ -108,16 +108,40 @@ try:
108108 prompt_config = config.prompt_config
109109 get_auto_config = config.get_auto_config
110110 save_config = config.save_config
111- load_profile = config.load_profile
112- save_profile = config.save_profile
113- is_profile_enabled = config.is_profile_enabled
114- needs_profile_rebuild = config.needs_profile_rebuild
115- enable_profile = config.enable_profile
116- build_profile = profile.build_profile
117- suggest_commit_message = profile.suggest_commit_message
118- get_stack_suggestions = profile.get_stack_suggestions
119- get_structure_suggestions = profile.get_structure_suggestions
120- play_sound = profile.play_sound
111+ try:
112+ load_profile = config.load_profile
113+ save_profile = config.save_profile
114+ is_profile_enabled = config.is_profile_enabled
115+ needs_profile_rebuild = config.needs_profile_rebuild
116+ enable_profile = config.enable_profile
117+ except AttributeError:
118+ # Fallback if profile functions don't exist in older version
119+ def load_profile(): return None
120+ def save_profile(p): return True
121+ def is_profile_enabled(): return False
122+ def needs_profile_rebuild(): return True
123+ def enable_profile(e): return True
124+
125+ try:
126+ build_profile = profile.build_profile
127+ suggest_commit_message = profile.suggest_commit_message
128+ get_stack_suggestions = profile.get_stack_suggestions
129+ get_structure_suggestions = profile.get_structure_suggestions
130+ get_commit_size_suggestions = profile.get_commit_size_suggestions
131+ get_til_tag_suggestions = profile.get_til_tag_suggestions
132+ update_freeform_feedback = profile.update_freeform_feedback
133+ play_sound = profile.play_sound
134+ except AttributeError:
135+ # Fallback if profile module doesn't exist
136+ def build_profile(p): return {}
137+ def suggest_commit_message(r, p, m): return []
138+ def get_stack_suggestions(r, p): return []
139+ def get_structure_suggestions(r, p): return []
140+ def get_commit_size_suggestions(r): return []
141+ def get_til_tag_suggestions(r, p, t): return []
142+ def update_freeform_feedback(p, r, f): return p
143+ def play_sound(s): pass
144+
121145 get_current_git_repo = path_detector.get_current_git_repo
122146 add_til_entry = til.add_til_entry
123147 view_til = til.view_til
@@ -173,12 +197,14 @@ def main():
173197 parser.add_argument("--stats", action="store_true", help="Show ASCII commit trend charts")
174198 parser.add_argument("--diagnose", action="store_true", help="Run system diagnostics")
175199 parser.add_argument("--update", action="store_true", help="Check for updates")
200+ parser.add_argument("--version", action="store_true", help="Show version information")
176201
177- # Smart Profile System flags (v0.7.0 )
202+ # Smart Profile System flags (v0.7.1 )
178203 parser.add_argument("--build-profile", action="store_true", help="Build or rebuild your coding profile")
179204 parser.add_argument("--coach", type=str, nargs='?', const='', help="Get commit message coaching suggestions")
180205 parser.add_argument("--insights", action="store_true", help="Show personalized coding insights")
181206 parser.add_argument("--no-profile", action="store_true", help="Skip profile-based suggestions")
207+ parser.add_argument("--feedback", choices=["good", "bad"], help="Give feedback on coaching suggestions")
182208
183209 # Repository management
184210 parser.add_argument("--scan", action="store_true", help="Scan repo folder for git repositories")
@@ -231,6 +257,12 @@ def main():
231257 print("🌐 GitHub: https://github.com/AmariahAK")
232258 sys.exit(0)
233259
260+ if args.version:
261+ print("🚀 commit-checker v0.7.2")
262+ print("📅 Smart Profile System")
263+ print("🔗 https://github.com/AmariahAK/commit-checker")
264+ sys.exit(0)
265+
234266 if args.update:
235267 manual_update_check()
236268 sys.exit(0)
@@ -269,6 +301,89 @@ def main():
269301 show_commit_stats(local_paths)
270302 sys.exit(0)
271303
304+ # Handle Smart Profile System commands
305+ if args.build_profile:
306+ local_paths = config.get('local_paths', [])
307+ if not local_paths:
308+ print("❌ No local paths configured. Run --init or --setup first.")
309+ sys.exit(1)
310+
311+ print("🧙 Building your smart coding profile...")
312+ print(" 📊 Analyzing commit history patterns...")
313+ print(" 🔍 Detecting project tech stacks...")
314+ print(" 📁 Scanning project structures...")
315+
316+ try:
317+ # Import profile functions
318+ profile_module = load_module("profile", os.path.join(script_dir, "profile.py"))
319+ build_profile = profile_module.build_profile
320+
321+ profile = build_profile(local_paths)
322+
323+ # Save profile using config functions
324+ if save_profile(profile):
325+ repo_count = len(profile.get("repos", {}))
326+ print(f"\n✅ Profile built successfully!")
327+ print(f" 📈 Analyzed {repo_count} repositories")
328+ print(f" 💡 Smart suggestions now enabled")
329+
330+ # Enable profile if not already enabled
331+ config['enable_profile'] = True
332+ save_config(config)
333+ else:
334+ print("❌ Failed to save profile. Check file permissions.")
335+ except Exception as e:
336+ print(f"❌ Profile building failed: {e}")
337+
338+ sys.exit(0)
339+
340+ if args.insights:
341+ if not config.get('enable_profile', False):
342+ print("🧙 Smart profile system is disabled.")
343+ print("💡 Run --build-profile to enable insights.")
344+ sys.exit(1)
345+
346+ # Load profile from config
347+ profile = config.get('profile', {})
348+ if not profile:
349+ print("🧙 No profile found. Run --build-profile first.")
350+ sys.exit(1)
351+
352+ print("🧠 Personal Coding Insights")
353+ print("=" * 50)
354+
355+ global_profile = profile.get("global", {})
356+ repos = profile.get("repos", {})
357+
358+ # Global insights
359+ print(f"📊 Overall Style:")
360+ print(f" • Average commit length: {global_profile.get('avg_length', 0)} words")
361+ print(f" • Preferred mood: {global_profile.get('mood', 'unknown').title()}")
362+ print(f" • Uses emojis: {'Yes' if global_profile.get('uses_emoji', False) else 'No'}")
363+
364+ # Repository insights
365+ if repos:
366+ print(f"\n📁 Repository Analysis ({len(repos)} repos):")
367+
368+ # Count tech stacks
369+ tech_stacks = {}
370+ for repo_data in repos.values():
371+ for tech in repo_data.get("tech_stack", []):
372+ tech_stacks[tech] = tech_stacks.get(tech, 0) + 1
373+
374+ if tech_stacks:
375+ print(" 🔧 Tech Stack Distribution:")
376+ for tech, count in sorted(tech_stacks.items(), key=lambda x: x[1], reverse=True):
377+ percentage = (count / len(repos)) * 100
378+ print(f" • {tech.title()}: {count} repos ({percentage:.0f}%)")
379+
380+ last_scan = profile.get("last_scan", "")
381+ if last_scan:
382+ print(f"\n🕒 Profile last updated: {last_scan[:19].replace('T', ' ')}")
383+
384+ print("\n💡 Run --build-profile to refresh your profile data")
385+ sys.exit(0)
386+
272387 # Gamification commands
273388 if args.achievements:
274389 print(display_achievements())
0 commit comments