@@ -29,39 +29,37 @@ func ListRobotCommand() *cobra.Command {
2929 cmd := & cobra.Command {
3030 Use : "list [projectName]" ,
3131 Short : "list robot" ,
32- Long : `List robot accounts in a Harbor project .
32+ Long : `List robot accounts in Harbor.
3333
34- This command displays a list of robot accounts, either from a specific project
35- or by prompting you to select a project interactively. The list includes basic
34+ This command displays a list of system-level robot accounts. The list includes basic
3635information about each robot account, such as ID, name, creation time, and
3736expiration status.
3837
39- The command supports multiple ways to specify the project:
40- - By providing a project name as an argument
41- - By using the --project-id flag
42- - By using the -q/--query flag with a project filter
43- - Without any arguments, which will prompt for project selection
38+ System-level robots have permissions that can span across multiple projects, making
39+ them suitable for CI/CD pipelines and automation tasks that require access to
40+ multiple projects in Harbor.
4441
4542You can control the output using pagination flags and format options:
4643- Use --page and --page-size to navigate through results
47- - Use --sort to order the results
44+ - Use --sort to order the results by name, creation time, etc.
45+ - Use -q/--query to filter robots by specific criteria
4846- Set output-format in your configuration for JSON, YAML, or other formats
4947
5048Examples:
51- # List robots in a specific project by name
52- harbor-cli project robot list myproject
49+ # List all system robots
50+ harbor-cli robot list
5351
54- # List robots in a project by ID
55- harbor-cli project robot list --project-id 123
52+ # List system robots with pagination
53+ harbor-cli robot list --page 2 --page-size 20
5654
57- # List robots with pagination
58- harbor-cli project robot list --page 2 --page-size 20
55+ # List system robots with custom sorting
56+ harbor-cli robot list --sort name
5957
60- # List robots with custom sorting
61- harbor-cli project robot list --sort name
58+ # Filter system robots by name
59+ harbor-cli robot list -q name=ci-robot
6260
63- # Interactive listing (will prompt for project selection)
64- harbor-cli project robot list` ,
61+ # Get robot details in JSON format
62+ harbor-cli robot list --output-format json ` ,
6563 Args : cobra .MaximumNArgs (0 ),
6664 Run : func (cmd * cobra.Command , args []string ) {
6765 robots , err := api .ListRobot (opts )
@@ -84,7 +82,6 @@ Examples:
8482 flags := cmd .Flags ()
8583 flags .Int64VarP (& opts .Page , "page" , "" , 1 , "Page number" )
8684 flags .Int64VarP (& opts .PageSize , "page-size" , "" , 10 , "Size of per page" )
87- flags .Int64VarP (& opts .ProjectID , "project-id" , "" , 0 , "Project ID" )
8885 flags .StringVarP (& opts .Q , "query" , "q" , "" , "Query string to query resources" )
8986 flags .StringVarP (
9087 & opts .Sort ,
0 commit comments