Skip to content

Improve CLI error messages with actionable setup guidance (#15)#19

Open
bilaldev05 wants to merge 1 commit intoai-dashboad:mainfrom
bilaldev05:improve-error-messages-cli
Open

Improve CLI error messages with actionable setup guidance (#15)#19
bilaldev05 wants to merge 1 commit intoai-dashboad:mainfrom
bilaldev05:improve-error-messages-cli

Conversation

@bilaldev05
Copy link

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.

Copy link
Member

@charliewwdev charliewwdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! A few concerns:

  1. 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.

  2. Indentation changes — The toJson() reformatting and other whitespace changes make the diff harder to review. Please revert formatting-only changes.

  3. exit(1) in library code — Calling exit() directly is an anti-pattern in Dart libraries. Consider throwing exceptions instead and letting the CLI handle them.

  4. 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!

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.

2 participants