docs/proposals/argocd-cli-pluin.md
Support for kubectl-like plugins for the argocd CLI.
Enhance the Argo CD argocd CLI client to support the ability to provide other CLI tools as "plugins" in a similar way that the Kubernetes kubectl CLI client provides. This will shift argocd to be more of a "building block" or "interface" for interacting with Argo CD and plugins can be a means to develop more complex workflows while leaving the baseline argocd use-case small.
Currently, the argocd CLI client is-getting/already-is pretty bloated. The solution has either been written-in the support for certain solutions (like ApplicationSets) or having a separate CLI tool in Argo Project Labs (like Autopilot and Vault Plugin).
Having a plugin system makes sense, as we add more and more features down the line (OCI, Hydrator, GitOps Promoter, etc). In this way, we can keep the argocd CLI "lean" but also extensible and keep things "out of tree". As mentioned before, other tools that can benefit from this besides the Argo CD OCI cli is a tool like argocd-autopilot. Also, there is a potential for other Argo Project tools to have plugins, like a Rollouts plugin or an argocd-image-updater plugin for Argo CD.
The idea initially came up during a discussion about adding CLI support for the upcoming OCI integration.
The goal is to provide a plugin mechanism without changing the current behavior of argocd's subcommands and options.
Make any guarantees for any public argocd plugins provided by any third party.
Similarly to how kubectl plugins are handled, The argocd CLI tool will look in the end user's $PATH for any binaries that start with argocd- and execute that binary. For example if I had a binary called argocd-mytool in my $PATH, I could call it by running argocd mytool. Support for tab completion should also be taken into account.
Things to consider:
kubectl and just look in $PATH or be more stringent and have users store plugins in ~/.config/argocd/plugins? Similar to Tekton plugins~/.config/argocd/config and provide a new field called .pluginConfigs? For example the argocd-mytool plugin's config will be under .pluginConfigs.mytool Should we even care/have an opinion?