feat: Add --frontend-dev-mode CLI option for enhanced frontend development #1590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🚀 Feature: Frontend Development Mode for ADK FastAPI CLI
This PR adds a new
--frontend-dev-mode
CLI option that significantly enhances the development experience when building frontend applications that connect to ADK agents.✨ Key Features
X-Frontend-Dev-Mode
andX-Server-Time
to all responses/dev-info
endpoint provides configuration information to frontend developers🎯 Supported Frontend Frameworks
Automatically configures CORS for:
📋 Usage Examples
🔧 Implementation Details
Files Modified:
src/google/adk/cli/cli_tools_click.py
- Added CLI option and parameter passingsrc/google/adk/cli/fast_api.py
- Implemented core functionality and middlewaretests/unittests/cli/test_fast_api.py
- Added comprehensive teststests/unittests/conftest.py
- Fixed import issue for testingNew Files:
FRONTEND_DEV_MODE_FEATURE.md
- Comprehensive documentation✅ Benefits for Frontend Developers
🔒 Security Considerations
🧪 Testing
/dev-info
endpoint📚 Documentation
Includes detailed documentation covering:
📝 Technical Implementation
CLI Option Addition
Automatic CORS Configuration
Enhanced Error Handling
This enhancement makes ADK FastAPI servers much more developer-friendly when building frontend applications, reducing configuration overhead and improving the debugging experience during development.
🔍 Related Issues
This addresses common pain points developers face when:
🚀 Future Enhancements
Potential future improvements could include:
Pull Request opened by Augment Code with guidance from the PR author