Skip to content

Comments

feat(user): add fuzzy, match, range flags for commands#682

Open
Mujib-Ahasan wants to merge 2 commits intogoharbor:mainfrom
Mujib-Ahasan:new-query-flags
Open

feat(user): add fuzzy, match, range flags for commands#682
Mujib-Ahasan wants to merge 2 commits intogoharbor:mainfrom
Mujib-Ahasan:new-query-flags

Conversation

@Mujib-Ahasan
Copy link

Description

Only harbor-cli project list and harbor-cli label list support fuzzy, match, and range flags. All the other commands does not follow this way to query resource.
This PR has been raised to make fuzzy, match, range flag available to other required commands(eg: user, artifact, instance, registry etc).

Resolves #674

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
@Mujib-Ahasan
Copy link
Author

Hello @NucleoFusion, this is yet to be tested, but I am really confused to find the keys to be used in list subcommands. Changes have been made for user list command for now. Could you please help me to get the keys for other commands?!

@NucleoFusion
Copy link
Contributor

@Mujib-Ahasan the keys are the fields/keys in the JSON object they return. They are available on the demo.goharbor.io swagger api

@Mujib-Ahasan
Copy link
Author

Great, Thank you @NucleoFusion!

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
@Mujib-Ahasan
Copy link
Author

@NucleoFusion , PTAL at these changes. after that I will do some tests against my local setup.

@NucleoFusion
Copy link
Contributor

@Mujib-Ahasan

  • Repositories
    • All Repo's
    • Project Repositories
  • Artifacts
  • Tags
  • Accessories
  • Auditlogs
  • Preheat
    • instances
    • policies
    • executions
    • execution tasks
  • Immutable Tag Rules
  • Webhooks
    • policies
    • execs
    • execution tasks
  • Robots
  • Replication
    • policies
    • executions
    • execution tasks
  • Registries
  • Scanner
  • Users
  • Labels
  • SecurityHub - Vuln List

All these are supported via the q param as per the swagger API. Can you make a checklist and check if they all are implemented as the q param.
And if they are not present in the CLI as of now, please mention the same

@Mujib-Ahasan
Copy link
Author

Mujib-Ahasan commented Feb 11, 2026

  • Repositories (--query)
    • All Repos
    • Project Repositories
  • Artifacts (--query)
  • Tags ( No CLI)
  • Immutable Tags Rule (CLI implemented, --query not present)
  • Accessories (No CLI)
  • Auditlogs (--query)
  • Preheat
    • instances (--query)
    • policies (No CLI)
    • executions (No CLI)
    • execution tasks (No CLI)
  • Webhooks
    • policies(CLI implemented, --query not present)
    • execs (No CLI)
    • execution tasks (No CLI)
  • Robots (--query)
  • Replication
    • policies (--query)
    • executions (--query)
    • execution tasks (No CLI)
  • Registries (--query)
  • Scanner(CLI implemented, --query not present)
  • Users (--query)
  • Labels )--query)
  • SecurityHub - Vuln List(No CLI)

(only for list subcommand)

@NucleoFusion PTAL.

@NucleoFusion
Copy link
Contributor

Have you done all those? In the checklist that have CLI present?
If so I will have a look ASAP

@Mujib-Ahasan
Copy link
Author

I did only for those which has --query flag (--query in the bracket in my prev comment) . I have not worked in CLI which do not have --query flag ( ex:- https://github.com/goharbor/harbor-cli/blob/main/cmd/harbor/root/webhook/list.go).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Refactor old commands that support the q query paramater to now utilize the new format.

2 participants