Improve CLI error messages with actionable setup guidance (#15)#19
Improve CLI error messages with actionable setup guidance (#15)#19bilaldev05 wants to merge 1 commit intoai-dashboad:mainfrom
Conversation
charliewwdev
left a comment
There was a problem hiding this comment.
Thanks for the contribution! A few concerns:
-
Flutter validation is too strict — flutter-skill works without Flutter SDK for CDP/Web/Electron platforms. Requiring Flutter in PATH would break the majority of use cases. The
_validateFlutterEnvironment()check should only run when connecting to Flutter apps, not on server startup. -
Indentation changes — The
toJson()reformatting and other whitespace changes make the diff harder to review. Please revert formatting-only changes. -
exit(1)in library code — Callingexit()directly is an anti-pattern in Dart libraries. Consider throwing exceptions instead and letting the CLI handle them. -
Good ideas though! — The
_printCliError()helper and port-in-use messaging are useful. Could you scope this down to just the error formatting improvements without the Flutter validation?
Happy to merge a focused version!
1-Summary :
This PR improves the developer experience by providing clearer and actionable error messages during CLI setup and server startup.
It addresses Issue #15 by enhancing error handling for common setup failures.
2- Improvements
The following scenarios now provide structured and helpful error messages:
Missing Flutter SDK (Flutter not in PATH)
Unsupported Flutter version
Missing platform tools (Xcode / Android SDK)
Port already in use
Lock file conflict (multiple server instances)
Network socket errors
3- What Was Added :
_printCliError() helper for consistent CLI error formatting
_validateFlutterEnvironment() to check Flutter setup before startup
Improved port binding error handling in startBridgeListener
Better lock file conflict messaging
More actionable troubleshooting guidance in SDK connection errors
4- Example Output
❌ Port 50000 is already in use
Another process is already using this port.
🔧 Suggested Fixes:
• Run: lsof -i :50000
• Kill the process using that port
• flutter-skill --bridge-port=9090
5- Result
Developers now receive clear guidance instead of cryptic failures, reducing confusion during setup.