Skip to content

Instantly share code, notes, and snippets.

@kcubeterm
Last active November 19, 2024 06:59
Show Gist options
  • Save kcubeterm/7e2792366bd6e8c14064f7e2ac109cc7 to your computer and use it in GitHub Desktop.
Save kcubeterm/7e2792366bd6e8c14064f7e2ac109cc7 to your computer and use it in GitHub Desktop.
How to install google cloud sdk in termux and run cloud shell interactively.

Now Google cloud sdk support python3.9 as well. Lets start.

Without any surprise,use your copy-paste skills to fire following script into your innocent terminal.

pkg install python3 openssh
curl -o sdk.sh sdk.cloud.google.com
chmod +x sdk.sh
./sdk.sh --install-dir=$PREFIX
Previous version with python2

python 2.7 requires because gcloud does't support python 3.9

pkg install python2 openssh

export CLOUDSDK_PYTHON='python2.7'
echo "export CLOUDSDK_PYTHON='python2.7'" >> ~/.bashrc
echo "export PATH=$PATH:$PREFIX/google-cloud-sdk/bin"
curl -o sdk.sh sdk.cloud.google.com
chmod +x sdk.sh
./sdk.sh --install-dir=$PREFIX
Now just attend few questions and authenticate yourself. reload shell so that all Commmand reloads in your PATH

gcloud auth login

copy link and paste in your default browser, Choose account and copy code then fill that in terminal. now done. Let's do ssh in cloud shell.

gcloud cloud-shell ssh

@mobagenie
Copy link

mobagenie commented Aug 28, 2024

amazing! finally i g rid from absolutelly nightmare cloud browser based cli and also app based cli. now i can control my cloud shell from termux CLI!!!

Screenshot_2024-08-28-22-01-01-387_com termux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment