tumblr / collins

groovy kind of love
tumblr.github.com/collins
Apache License 2.0
571 stars 99 forks source link

Docs for the golang collins cli #598

Open michaeljs1990 opened 5 years ago

michaeljs1990 commented 5 years ago

Hey, I have been messing around with a golang build for collins CLI for a bit now and have been using it for a while without any major issue outside of a few minor bug fixes. Just thought I would add it here as well in case it's useful for others.

byxorna commented 5 years ago

@komapa @defect @alex-laties

defect commented 5 years ago

Good stuff! As with https://github.com/tumblr/go-collins/pull/23 I can't check this out until a couple of days from now, but I'll review and merge ASAP if no one gets to it before me.

Remind me, what does the feature parity with @byxorna 's ruby CLI look like?

An unrelated comment below so feel free to ignore, but i thought it made sense in this context. cc @tumblr/collins @byxorna @komapa

Should we clean up collins-shell from there? It hasn't been maintained for quite a few years, and I'm pretty sure no one at tumblr uses it (or even knows about it) anymore.

alex-laties commented 5 years ago

collins-shell needs to die in a fire. It was unsupported as of 4 years ago... so at this point 🔥.

michaeljs1990 commented 5 years ago

@defect the feature parity for the collins-go-cli is targeted for you to be able to replace the collins-cli gem if you so wish and pretend like nothing ever happened. You should be able to go back through your bash history and run all of the same commands and get the same outputs. In addition to that I added some features of which I documented some example usage here.

From the main readme these are the changes/additions to the client from the ruby one.

  1. JSON output format is a valid JSON dump
  2. YAML output format is valid YAML in all languages and not limited to ruby
  3. You can pipe IPs, tags, hostnames, or anything else to collins query to get more info about them
  4. Additional fields that are computed client side. See func fieldToAssetStruct or the docs for the full list
  5. collins provision has a wait flag for that pesky rate limiter
  6. collins power issues commands inside goroutines so bad BMCs don't slow you down
  7. If you have been using the collins ruby cli it should function 100% the same for basic workflows
  8. collins query has negative matching key:~valueidontwant that is available for all flags -n "~devnode"