hub-tool icon indicating copy to clipboard operation
hub-tool copied to clipboard

`hub-tool org search [TERM]` - Add feature to find organizations from the CLI?

Open g0t4 opened this issue 3 years ago • 0 comments

Why?

Occasionally, I want to find an org on Docker Hub.

  • Sometimes I'm looking for an org for the first time and I don't know what the org name(s) might be.
  • Quite often, cats got my tongue and I can't recall the exact phrasing or spelling of the org name(s).
    • Because, as with GitHub, orgs are often used as namespaces resulting in many orgs to any one real-world organization (community, ecosystem).
    • For example docker / dockersamples / moby
    • or jenkins / jenkinsci
  • docker search always made sense. It would rock for orgs too!

How I search now

  • It's often painful ;)
  • I usually resort to googling.
  • Or, githubbing for the org
    • Especially if it's known to me (or Google) already
    • Then perusing repos for Docker Hub references / links
  • Or, sometimes, searching for repos via Docker Hub's web UI
    • Skimming the results for the org I may want
    • Clicking (carefully so I don't open the repo) on the blue org name link
    • Can involve paging and backing up to look at other results.
  • Certainly, Docker Hub's web search UI could be improved (or I could RTFM if there's already a better way)
    • That said, the impetus of hub-tool is to help keep people in the CLI

Ideas

# perhaps `search`? (reminiscent of `docker search`)
hub-tool org search [TERM]

# or, considering consistency and the existing docker CLI, maybe `ls` is a better place for this to reside?
hub-tool org ls [TERM] 

TERM could:

  • be an exact match
  • be a fragment (AFAIK this is not supported by current CLI ls commands - a partial name doesn't match anything unless you use asterisks)
  • include wildcards, glob or regex

TERM could match against: name, company, location, urls, linked accounts and other public metadata provided in org settings. A description of an org would be nice to search against but to my knowledge that doesn't exist as a setting for orgs?

TERM could also mirror the ubiquitous, explicit ls --filter arg that specifies what field to search against (--filter name=foo or --filter company=bar)

g0t4 avatar May 08 '21 10:05 g0t4