Worth mentioning as well that there's a good CLI for Arduino these days, at https://arduino.github.io/arduino-cli/latest/. It's written in Go, and shares config etc with the traditional Arduino UI. I have no affiliation with it, but have used it happily along with vim, and not needed to drop back into the traditional UI.