code: func NewCmdConfigGetContexts(streams genericclioptions.IOStreams, configAccess clientcmd.ConfigAccess) *cobra.Command {
  	options := &GetContextsOptions{
  		configAccess: configAccess,
  
  		IOStreams: streams,
  	}
  
  	cmd := &cobra.Command{
  		Use:                   "get-contexts [(-o|--output=)name)]",
  		DisableFlagsInUseLine: true,
  		Short:                 i18n.T("Describe one or many contexts"),
  		Long:                  getContextsLong,
  		Example:               getContextsExample,
  		Run: func(cmd *cobra.Command, args []string) {
  			validOutputTypes := sets.NewString("", "json", "yaml", "wide", "name", "custom-columns", "custom-columns-file", "go-template", "go-template-file", "jsonpath", "jsonpath-file")
  			supportedOutputTypes := sets.NewString("", "name")
  			outputFormat := cmdutil.GetFlagString(cmd, "output")
  			if !validOutputTypes.Has(outputFormat) {
  				cmdutil.CheckErr(fmt.Errorf("output must be one of '' or 'name': %v", outputFormat))
  			}
  			if !supportedOutputTypes.Has(outputFormat) {
  				fmt.Fprintf(options.Out, "--output %v is not available in kubectl config get-contexts; resetting to default output format\n", outputFormat)
  				cmd.Flags().Set("output", "")
  			}
  			cmdutil.CheckErr(options.Complete(cmd, args))
  			cmdutil.CheckErr(options.RunGetContexts())
  		},
  	}
  
  	cmd.Flags().Bool("no-headers", false, "When using the default or custom-column output format, don't print headers (default print headers).")
  	cmd.Flags().StringP("output", "o", "", "Output format. One of: name")
  	return cmd
  }
docs: // NewCmdConfigGetContexts creates a command object for the "get-contexts" action, which
  // retrieves one or more contexts from a kubeconfig.