3 ms·
I’ve found my comfort zone writing my commonly used CLI tasks into a single Go binary as subcommands. It’s a departure from shell scripting but it’s been worth
by disintegrator 2y ago
I’ve found my comfort zone writing my commonly used CLI tasks into a single Go binary as subcommands. It’s a departure from shell scripting but it’s been worth it so far to have the entire suite of CLI building libraries, rich loggers and sane syntax.
If there’s some new task I need then I add a subcommand then `go install`. Fairly quick process end to end.
For example I wrote a `ghcd <org>/<repo>` command to clone GitHub repos or `cd` to them if they already exist. Could’ve been a pure shell script but I enjoyed clobbering cobra, charm bracelet logger and go-got together and I’ve got the foundation down to quickly build more tasks.