cleodora icon indicating copy to clipboard operation
cleodora copied to clipboard

[Idea] Design a great cleoc CLI tool

Open omarkohl opened this issue 2 years ago • 0 comments

cleoc of course already exists and works. Here is just a place to collect some resources to make it even better.

Design Command-Line Tools People Love

Title: GopherCon 2019: Carolyn Van Slyck - Design Command-Line Tools People Love

Video: https://www.youtube.com/watch?v=eMz0vni6PAw

Code: https://github.com/carolynvs/emote

Slides: https://carolynvanslyck.com/talk/go/cli/

  • Use verb-noun
  • Avoid positional arguments unless they are all the same type (e.g. delete a b c -> fine)
  • Add a --json flag to every command
  • Default to human output
  • Dates -> go humanize
  • Use aliases to compromise between brevity and discoverability (have 'aliases' section in help)
  • combine multiple commands to achieve tasks. avoid piping except for scripts.

https://github.com/getporter/porter is a professional tool that applies many of these ideas and can serve as inspiration.

cmd/porter/main.go

pkg/porter/porter.go

Command Line Interface Guidelines

https://clig.dev/

omarkohl avatar Jun 18 '23 07:06 omarkohl