Skip to content

Commit c02a8d8

Browse files
authored
Merge pull request cli#11760 from cli/kw/update-gh-agent-root-cmd-help
`gh agent-task`: update help text
2 parents 151b971 + a7c8fa4 commit c02a8d8

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

pkg/cmd/agent-task/agent_task.go

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"strings"
77

8+
"github.com/MakeNowJust/heredoc"
89
cmdCreate "github.com/cli/cli/v2/pkg/cmd/agent-task/create"
910
cmdList "github.com/cli/cli/v2/pkg/cmd/agent-task/list"
1011
cmdView "github.com/cli/cli/v2/pkg/cmd/agent-task/view"
@@ -16,9 +17,37 @@ import (
1617
// NewCmdAgentTask creates the base `agent-task` command.
1718
func NewCmdAgentTask(f *cmdutil.Factory) *cobra.Command {
1819
cmd := &cobra.Command{
19-
Use: "agent-task",
20+
Use: "agent-task <command>",
2021
Aliases: []string{"agent-tasks", "agent", "agents"},
21-
Short: "Manage agent tasks (preview)",
22+
Short: "Work with agent tasks (preview)",
23+
Long: heredoc.Doc(`
24+
Working with agent tasks in the GitHub CLI is in preview and
25+
subject to change without notice.
26+
`),
27+
Annotations: map[string]string{
28+
"help:arguments": heredoc.Doc(`
29+
A task can be identified as argument in any of the following formats:
30+
- by pull request number, e.g. "123"; or
31+
- by session ID, e.g. "12345abc-12345-12345-12345-12345abc"; or
32+
- by URL, e.g. "https://github.com/OWNER/REPO/pull/123/agent-sessions/12345abc-12345-12345-12345-12345abc";
33+
34+
Identifying tasks by pull request is not recommended for non-interactive use cases as
35+
there may be multiple tasks for a given pull request that require disambiguation.
36+
`),
37+
},
38+
Example: heredoc.Doc(`
39+
# List your most recent agent tasks
40+
$ gh agent-task list
41+
42+
# Create a new agent task on the current repository
43+
$ gh agent-task create "Improve the performance of the data processing pipeline"
44+
45+
# View details about agent tasks associated with a pull request
46+
$ gh agent-task view 123
47+
48+
# View details about a specific agent task
49+
$ gh agent-task view 12345abc-12345-12345-12345-12345abc
50+
`),
2251
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
2352
return requireOAuthToken(f)
2453
},

0 commit comments

Comments
 (0)