Compared to yesterday’s basic json path query, the example below is a bit complex with conditional. This displays the context name of a context that has “aws-user” user.
k config view --kubeconfig=/root/my-kube-config -o jsonpath='{.contexts[?(@.context.user=="aws-user")].name}'