How to Install Gemini CLI on Android using Termux

How to Install Gemini CLI on Android using Termux

Loading

On June 25, 2025, Google published Gemini CLI is a powerful AI command-line interface agent for interacting with Google’s Gemini models, offering developers and enthusiasts a way to access AI directly from the terminal. It supports up to 60 requests per minute and 1000 requests per day for free using Google authentication instead of limited Gemini API Key. This makes it ideal for high-volume tasks without any extra costs.

However, installing Gemini CLI on Android presents a challenge: command-line environments like Termux don’t support pop-up windows for Google login, which is required for authentication. In this blog, I’ll show you two simple methods to solve this and get Gemini CLI running smoothly on your Android device.

Installing Gemini CLI on Android

The installation process is identical to Linux. You’ll need Termux or a similar terminal emulator. I prefer Termux, make sure to download it from F-Droid store or GitHub. Version on Google Play is discontinued.

Here are the steps:

Update packages.

pkg update && pkg upgrade

Install node js.

pkg install nodejs

Install the Gemini CLI.

npm install -g @google/gemini-cli

You now have Gemini CLI installed on your Android device!

Run gemini cli:

gemini

When you try to authenticate, you will be presented with endless Waiting for auth... message, without option to login using Google credentials.

To solve this problem, you can use one of the two methods.

Method 1: Authenticate Using debug Mode

This is the simplest method. Run Gemini CLI with the --debug flag:

gemini --debug

Then, initiate authentication:

/auth

Choose Google Login. The CLI will display a login URL in the terminal.

Copy this link into your browser, authenticate with your Google account, and return to Termux. Gemini CLI will now be successfully authenticated.

Method 2: Use Termux:API to Trigger Browser Login

For a more seamless experience, you can use Termux:API to open the login URL directly in your browser. Termux-api allows you to send commands to the Android system and send command to open a browser. This means that Termux would trigger Google authentication automatically by opening a browser, just like it would behave on desktop system. For that you need to install:

  1. Install Termux:API app from F-Droid.
  2. In Termux, install the API package:
pkg install termux-api

This will open the browser automatically, mimicking desktop behavior. Once authenticated, return to Termux and continue using Gemini CLI.

Conclusion

Gemini CLI is a powerful and free tool for accessing Google’s Gemini models from the command line. With up to 1000 free requests per day, it’s perfect for developers. Thanks to Termux and Termux:API, you can now run Gemini CLI conveniently on Android—even in headless environments—without sacrificing functionality or ease of use.

Leave a Reply

Your email address will not be published. Required fields are marked *