Open eugene70 opened 2 months ago
I think this would be a valuable improvement. We manage multiple clusters, each with its own ArgoCD instance, and many of our developers are familiar with kubectl syntax. Because of that, they often find the ArgoCD syntax difficult to use. Making the syntax more intuitive or closer to kubectl could significantly improve the user experience for many teams.
If it's okay, I'd like to implement it.
I wrote down the usage before proceeding with the task.
Manage contexts
Usage:
argocd context [flags]
argocd context [command]
Examples:
# List Argo CD contexts.
argocd context list
# Login to Argo CD using a username and password and update context
argocd context login CONTEXT SERVER
# Login to Argo CD context using a username and password
argocd context login # login to current context
argocd context login CONTEXT
# Switch Argo CD context
argocd context CONTEXT # for compatibility
argocd context use CONTEXT
# Get the details of a context
argocd context get CONTEXT
# Delete a context
argocd context delete CONTEXT
argocd context CONTEXT --delete # for compatibility
Available Commands:
get Get context details
delete Delete a context
list List contexts
login Login to Argo CD using a username and password
logout Logout current context or specified context
use Switch current context
Looks great! I can take a look at your PR once ready (tho I don't have approvers permissions yet).
In Argo-CD CLI, cluster context is managed through
argocd context
andargocd login
commands. However, these context management commands are a bit different from other command systems, so they can be confusing for beginners. So I want to provide rich functionality by providing various subcommands for theargocd context
command, such as theargocd app
command. Example: