This message was deleted.
# platform-toolbox
s
This message was deleted.
h
I haven't for a idp but I built a go cli that unifies a lot of our stuff, for example it controls our local environments, runs custom commands for infra maintenance, helps upgrading our kubernetes clusters etc, it is quite a handy pattern.
I started with this as base https://github.com/mumoshu/variant but wrote my own since then with some gpt help ( I'm not a dev 😂 )
p
Cool, thats effectively what I'd like to do (maybe slightly different tasks, but similar idea)
Looks neat, similar definitions to Taskfile
I'm looking into Cobra right now. Might be a heavy hammer, but we'll see lol
h
Ya I started with taskfile but I wanted the ability to name it my own thing ( branding is important 😂 )
Reason why I picked variant is I wanted to have the ability for non devs to contribute to it
Cobra can get a bit complicated if your not a dev 😂
p
Yeah, that definitely makes sense. If its too hard to contribute then the one Go dev is stuck coding everything lolsob
l
In the past, yes. But, what functionality are you ideally looking for? Simply a CLI framework? Or are you wanting more goodies like custom-built plugins, etc? Do you care what language it’s in? Are you going to build it for developers, or do you hope that they collaborate, etc?
p
I imagine we (my team is a platform/infra/SRE team) will maintain it for the most part, maybe the dev CI team will contribute as well, but I wouldn’t expect non-engineers to contribute
If there are frameworks with plugins that would be helpful, but I think more important is a framework to keep code well architected/organized
l
Yeah, from memory we did write most of ours from scratch, but a lot was also wrapping other CLIs like Vault, AWS, aws-vault, etc, and that was also with Cobra. We also use* Cobra in the Gitpod CLI* today. It’s not a very sophisticated CLI, but feel free to copy any patterns if they’re useful…
a
Yup, I have used cobra before as well. We did a lot of the logic client side, but eventually needed to implement a server side application which in the end was pretty useful because it let us enable a chatbot as well as the CLI without duplicating too much logic.
p
That’s actually the route I started on awhile ago. Wrote a slack chat bot, which I was thinking could be extended with a cli eventually. Authentication and authorization were the tricky part. I ended up integrating into our Okta SSO in a similar way to the aws sso functionality, where we send the user a link which redirects them to okta for auth, we then store that token and verify it on subsequent calls. The downside to this now you have to implement an rbac system
I’m actually thinking about making the cli a wrapper around the Port api, so that will handle authc/authn. It’ll call GitHub workflows, which implement the logic
Centralizing auth and logic in a server has the added bonus of enabling audit logging
f
Yeah absolutely. I’ve built one in my last job for our in-house IDP on public clouds. Mostly translating from a developer-facing spec to the actual underlying manifest (terraform, helm, kubernetes, etc), with the ability to orchestrate application onboarding/deployments, validation, IPAM, traffic management, state management and stuff like that. It’s written go and built with cobra framework. We are actually building a similar CLI tool called Kusion in my current job as well and it’s open source. It started with it being centered around deploying Kubernetes workloads but now extends to managing the environment altogether including the standardization of cloud resources and such. It’s built around the logical concept of an Application and is expected to encapsulate all the application requirements in a single, DSL-driven spec. Let us know what you think!