Skip to content

Conversation

@bl3ck
Copy link
Contributor

@bl3ck bl3ck commented Apr 29, 2025

fix: Display full help text for CLI commands when arguments are missing

Addresses issue #431 by implementing a custom Click Command class that shows the complete help text instead of just an error message when a required argument is missing. This improves user experience by following the common CLI convention where commands without options display their full help text.

  • Added HelpfulCommand class to override default Click error behavior
  • Applied the custom class to the "create" command
  • Maintains the original error message at the end for clarity

This change makes the CLI more intuitive and saves users from having to
run an additional --help command to see available options.

How to test:

  • Run adk create without the APP_NAME

@bl3ck bl3ck force-pushed the fix/cli-help-display branch from 874d226 to f2eea8d Compare May 1, 2025 04:57
@bl3ck bl3ck marked this pull request as ready for review May 1, 2025 05:02
@hangfei
Copy link
Collaborator

hangfei commented May 8, 2025

Thanks! @bl3ck could you show before/after command line log?

@hangfei hangfei added the ready to pull [Status] This PR is ready to be importing back to Google label May 8, 2025
@bl3ck
Copy link
Contributor Author

bl3ck commented May 8, 2025

Thanks! @bl3ck could you show before/after command line log?

Hi @hangfei, Thanks for getting back to me on this. Here's the command line log:

Before:

Image

After:

Image

@hangfei
Copy link
Collaborator

hangfei commented May 10, 2025

@bl3ck The error message is lower case "app_name". Could we match to its original case("APP_NAME")?

@bl3ck
Copy link
Contributor Author

bl3ck commented May 13, 2025

@bl3ck The error message is lower case "app_name". Could we match to its original case("APP_NAME")?

@hangfei The update has been made. Sorry, for the delayed response.

copybara-service bot pushed a commit that referenced this pull request May 14, 2025
Copybara import of the project:

--
dcfb9ff by Eugen-Bleck <eugenbleck@gmail.com>:

fix: Display full help text for adk create  CLI command when arguments are missing

--
f2eea8d by Eugen-Bleck <eugenbleck@gmail.com>:

fix: Display full help text for adk run and eval  CLI command when arguments are missing
COPYBARA_INTEGRATE_REVIEW=#443 from bl3ck:fix/cli-help-display c2bca42
PiperOrigin-RevId: 758498242
@bl3ck bl3ck closed this May 14, 2025
@bl3ck bl3ck force-pushed the fix/cli-help-display branch from 0724098 to 71bd808 Compare May 14, 2025 11:42
@bl3ck
Copy link
Contributor Author

bl3ck commented May 14, 2025

@hangfei The code was merged before without my last change. I've created a new PR which ensures the case is matched in the error message.

@hangfei
Copy link
Collaborator

hangfei commented May 29, 2025

Thanks! Let's move the discussion to the other thread.

coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
Copybara import of the project:

--
dcfb9ff by Eugen-Bleck <eugenbleck@gmail.com>:

fix: Display full help text for adk create  CLI command when arguments are missing

--
f2eea8d by Eugen-Bleck <eugenbleck@gmail.com>:

fix: Display full help text for adk run and eval  CLI command when arguments are missing
COPYBARA_INTEGRATE_REVIEW=google#443 from bl3ck:fix/cli-help-display c2bca42
PiperOrigin-RevId: 758498242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull [Status] This PR is ready to be importing back to Google

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants