With this guide you can use a bash shell script inside a Termux terminal on your Android phone, to connect to your Chromecast using it's WiFi hotspot and do the Chromecast initial setup, without having to install Google spyware apps.
Warning
This is specifically for 1st, 2nd & 3rd Generation Chromecast, Chromecast Audio and Chromecast Ultra.
It's not applicable for any Chromecast with Google TV, as they can be configured directly using a remote or keyboard.
This guide uses the castanet.sh fork by @DavidePrincipi, which swaps the problematic nodejs dependency for openssl. Using openssl allows for easy use of this script on many Linux distributions, as a large number already have openssl installe