Skip to content

Conversation

@aviatco
Copy link
Collaborator

@aviatco aviatco commented Dec 31, 2025

📥 Pull Request

✨ Description of new changes

🎯 Overview

This PR implements automatic REPL (Read-Eval-Print-Loop) functionality by making the Fabric CLI automatically enter interactive mode when users run the fab command without arguments, eliminating the need for manual mode configuration.

🚀 Key Changes

Auto-Interactive Mode Entry

Add logic to detect when fab is run without arguments and automatically launch interactive mode
Enhanced Error Handling: Refactored main error handling with dedicated functions _handle_keyboard_interrupt() and _handle_unexpected_error() for better separation of concerns
Graceful Startup: Interactive mode now starts automatically with proper exception handling and user feedback
Interactive Mode Improvements

Enhanced interactive CLI with better command handling:

Added specific handling for fab command within interactive mode (shows helpful message instead of error)
Improved empty input handling to gracefully continue session
Better error handling for SystemExit and unexpected exceptions in command execution
Enhanced keyboard interrupt (Ctrl+C) and EOF handling with informative messages
More user-friendly error messages for invalid commands
Mode Configuration Deprecation

Added deprecation warnings for mode configuration:

Shows warning that mode configuration is deprecated when users try to set interactive/command-line mode
Maintains backward compatibility while guiding users toward the new auto-interactive behavior
Improved messaging for mode transitions
Constants and Configuration
Removed "fab" from interactive help commands list to prevent conflicts with the new auto-interactive functionality

🔄 User Experience Improvements

Simplified Workflow: Users can now simply run fab to enter interactive mode
Better Error Messages: More helpful guidance when commands fail or are invalid in interactive mode
Graceful Interruption Handling: Improved Ctrl+C behavior that doesn't exit the session immediately
Backward Compatibility: Existing mode configuration still works with deprecation guidance

🎨 Technical Implementation

Auto-Detection Logic: Main entry point detects when no command is provided and launches interactive mode
Error Isolation: Separated error handling functions for cleaner main() function
Enhanced Interactive Loop: Better command parsing and error recovery in interactive sessions
Singleton Pattern: Maintains proper InteractiveCLI singleton behavior

✅ Breaking Changes

None - this is a backward-compatible enhancement that adds functionality while maintaining existing behavior.

@aviatco aviatco marked this pull request as ready for review December 31, 2025 17:27
@aviatco aviatco requested a review from a team as a code owner December 31, 2025 17:27
@aviatco aviatco changed the title feat: Switching to interactive on fab feat: Switching to interactive when running "fab" Jan 1, 2026
@aviatco aviatco merged commit 7b148f5 into microsoft:main Jan 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants