Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 11, 2025

This PR adds usage examples to the coder exp task create command help text to improve discoverability and user experience.

Changes

  • Added a Long field to the serpent.Command in exp_task_create.go using the existing FormatExamples() function
  • Added a comprehensive test in exp_task_create_test.go to verify examples appear correctly in help output
  • Fixed formatting issues (import ordering and trailing whitespace) to resolve CI checks
  • Fixed examples to use correct positional argument syntax instead of non-existent --input flag

Examples Added

The help text now includes two practical examples:

  1. Create a task with all flags specified:

    coder exp task create "Refactor CLI auth to use OAuth flow" --template coder --org coder
  2. Create a task with a preset:

    coder exp task create "Add new API endpoint" --template coder --preset backend

Before

$ coder exp task create --help
USAGE:
  coder exp task create [flags] [input]

  Create an experimental task

OPTIONS:
  ...

After

$ coder exp task create --help
USAGE:
  coder exp task create [flags] [input]

  Create an experimental task

    - Create a task with all flags specified:
  
       $ coder exp task create "Refactor CLI auth to use OAuth flow" --template coder --org coder
  
    - Create a task with a preset:
  
       $ coder exp task create "Add new API endpoint" --template coder --preset backend

OPTIONS:
  ...

The implementation follows existing patterns in the codebase and maintains consistency with other CLI commands that include examples.

Fixes #19656.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@cdr-bot cdr-bot bot added the community Pull Requests and issues created by the community. label Sep 11, 2025
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@Copilot Copilot AI changed the title [WIP] Add usage examples to coder exp task create help text Add usage examples to coder exp task create help text Sep 11, 2025
@Copilot Copilot AI requested a review from matifali September 11, 2025 15:39
Copilot finished work on behalf of matifali September 11, 2025 15:39
@matifali
Copy link
Member

matifali commented Sep 11, 2025

@copilot fix the failing CI checks

- Fixed import ordering using gci tool
- Removed trailing whitespace using gofumpt
- Resolves CI formatting checks

Co-authored-by: matifali <[email protected]>
Copy link
Author

Copilot AI commented Sep 11, 2025

@copilot fix the failing CI checks

Fixed the failing CI checks in commit 67e8c9a. The issues were:

  1. Import ordering - github.com/coder/serpent needed to be grouped with external dependencies
  2. Trailing whitespace in the test file

Both have been resolved using gci and gofumpt formatting tools. All tests pass and the CLI builds successfully.

Co-authored-by: matifali <[email protected]>
Copilot finished work on behalf of matifali September 11, 2025 16:28
@DanielleMaywood
Copy link
Contributor

@copilot why is your example using --input? That is outdated, the input is taken as either a positional argument or from stdin when the --stdin flag is set.

…-existent --input flag

Co-authored-by: DanielleMaywood <[email protected]>
Copy link
Author

Copilot AI commented Sep 11, 2025

@copilot why is your example using --input? That is outdated, the input is taken as either a positional argument or from stdin when the --stdin flag is set.

You're absolutely right! I fixed the examples to use the correct positional argument syntax instead of the non-existent --input flag. The examples now show:

  • coder exp task create "Refactor CLI auth to use OAuth flow" --template coder --org coder
  • coder exp task create "Add new API endpoint" --template coder --preset backend

This matches the actual command signature [input] where input is provided as a positional argument (or via --stdin flag). Fixed in commit f303145.

Copilot finished work on behalf of DanielleMaywood September 11, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Pull Requests and issues created by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add usage examples to coder exp task create help text
3 participants