Skip to content

olegsu/cli-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card

CLI-GENERATOR

Generate CLI entrypoints from spec file Any feedback on the spec is welcome

Install

go get -u github.com/olegsu/cli-generator

Run Example

  • git clone git@github.com:olegsu/cli-generator.git
  • cd cli-generator
  • make example

The main idea is to define a spec that can describe a CLI in YAML or JSON format. Spec must include:

  1. Name of the application(project)
    • Example: docker, kubectl
  2. Global flags the CLI would support
    • Example: kubectl --context
  3. Commands, including nasted sub-commands and aliases
    • Example: kubectl get, docker system prune, kubectl get po, kubectl get pods
  4. Flags per command, including types [array of strings] [enum] definition, default values and environment variables are eqvivalent
    • Example: kubectl logs -f [NAME]
  5. Positional argumens, including multiple arguments
    • Example: kubectl delete po [PO_1] [PO_2]
  6. Auto generate help or provide a way to override help per command

About

Generate CLI entrypoints from spec file

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy