Skip to content

Conversation

@majiayu000
Copy link
Contributor

Summary

This PR fixes #3049

Changes

  • cmd/thv/app/auth_flags.go
  • cmd/thv/app/list.go
  • cmd/thv/app/rm.go
  • cmd/thv/app/run_flags.go
  • cmd/thv/app/stop.go

Add default values to flag descriptions for improved user experience.
This provides better visibility into default behavior when viewing help
text for various CLI commands including run, list, stop, and rm.

The pattern "(default: X)" is added consistently to flag descriptions
where meaningful defaults exist.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: majiayu000 <[email protected]>
Copy link
Member

@eleftherias eleftherias 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 PR @majiayu000. As I was reviewing it I noticed many of these changes are not needed because Cobra will automatically add the default value to the description.
Instead of adding (default: X) everywhere, could you run thv run --help, thv list ---help etc, and verify that the default value is not already listed?

Note that I've called out some cases where the change is not needed in the comments below, but I have not listed every single one.

"Skip opening browser for remote server OAuth flow")
"Skip opening browser for remote server OAuth flow (default: false)")
cmd.Flags().DurationVar(&config.RemoteAuthTimeout, "remote-auth-timeout", 30*time.Second,
"Timeout for OAuth authentication flow (e.g., 30s, 1m, 2m30s)")
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed. If you run thv run --help you will see that Cobra shows the default value in the description. Cobra will do this when the default value is something other than false.

"Timeout for OAuth authentication flow (e.g., 30s, 1m, 2m30s) (default: 30s)")
cmd.Flags().IntVar(&config.RemoteAuthCallbackPort, "remote-auth-callback-port", runner.DefaultCallbackPort,
"Port for OAuth callback server during remote authentication")
"Port for OAuth callback server during remote authentication (default: 8666)")
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed. If you run thv run --help you will see that Cobra shows the default value in the description.

listCmd.Flags().BoolVarP(&listAll, "all", "a", false, "Show all workloads (default shows just running)")
listCmd.Flags().StringVar(&listFormat, "format", FormatText, "Output format (json, text, or mcpservers)")
listCmd.Flags().BoolVarP(&listAll, "all", "a", false, "Show all workloads (default shows just running) (default: false)")
listCmd.Flags().StringVar(&listFormat, "format", FormatText, "Output format (json, text, or mcpservers) (default: text)")
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed. If you run thv list --help you will see that Cobra shows the default value in the description.

"proxy-mode",
"streamable-http",
"Proxy mode for stdio (streamable-http or sse (deprecated, will be removed))")
"Proxy mode for stdio (streamable-http or sse (deprecated, will be removed)) (default: streamable-http)")
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed. If you run thv run --help you will see that Cobra shows the default value in the description.

@dmjb
Copy link
Member

dmjb commented Jan 13, 2026

@majiayu000 Let us know if you plan on addressing some of the feedback raised above.

@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Jan 13, 2026
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.67%. Comparing base (bc0d112) to head (99ffab0).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3166      +/-   ##
==========================================
+ Coverage   63.64%   63.67%   +0.03%     
==========================================
  Files         361      361              
  Lines       35449    35449              
==========================================
+ Hits        22560    22571      +11     
+ Misses      11082    11063      -19     
- Partials     1807     1815       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@majiayu000
Copy link
Contributor Author

Thanks for the feedback @eleftherias. I've synced with main and removed the redundant default values from the flag descriptions, as Cobra adds them automatically. I also resolved the merge conflicts with the recent upstream changes. Ready for review!

@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Jan 13, 2026
@majiayu000
Copy link
Contributor Author

@majiayu000 Let us know if you plan on addressing some of the feedback raised above.

Thanks for the reminder. I was too busy this time. Feel free to close this pr if also questionable.

@majiayu000 majiayu000 force-pushed the fix-3049-add-default-values-to-cli-flag-help-text branch from e9d28e6 to 99ffab0 Compare January 13, 2026 16:45
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Jan 13, 2026
@amirejaz amirejaz requested a review from eleftherias January 15, 2026 12:50
@eleftherias
Copy link
Member

Thanks for the reminder. I was too busy this time. Feel free to close this pr if also questionable.

Looking at the updates it seems like no new defaults were added and that one of the defaults was removed. I'll go ahead and close this PR since it's removing some of the functionality we want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add default values to CLI flag help text

3 participants