equinor / radix-cli

https://radix.equinor.com/docs/topic-radix-cli/#use
MIT License
7 stars 1 forks source link

Improve developer experience: improved autocomplete with context aware options #103

Closed Richard87 closed 1 month ago

Richard87 commented 2 months ago

For example in rx get application --application f we could list available applications the user have access to

func init() {
    getCmd.AddCommand(getApplicationCmd)
    getApplicationCmd.Flags().StringP(flagnames.Application, "a", "", "Name of the application")
    getApplicationCmd.RegisterFlagCompletionFunc(flagnames.Application, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
        return []string{"foo", "bar", "baz"}, cobra.ShellCompDirectiveNoFileComp
    })
    setContextSpecificPersistentFlags(getApplicationCmd)
}

Just listing applications, environments, components, jobs, secrets and variables would make rx way nicer to use :)

DoD Implement autocomplete for values for the following 6 properties: