
The recent release of the Gemini CLI has generated significant buzz within the developer community. Unlike the Gemini integration available in Android Studio, the Gemini CLI introduces a powerful agent mode capable of autonomously handling complex, multi-step coding tasks.
What sets the Gemini CLI apart from other agent-like tools such as Cursor or GitHub Copilot is its open-source nature and its generous free tier. It provides access to Gemini 2.5 Pro, though it’s important to note some usage caveats which we will cover below.
The quotas for free tier are also high enough for individuals.

While more integrated Gemini AI features are also available in the latest Android StudioPreview versions, the Gemini CLI offers a stable and powerful alternative if you prefer not to alter your primary development environment. Also, it is not limited to Android Development!
This guide provides consolidated steps to get you up and running with the Gemini CLI in under 5 minutes.
- Install Node.js version 18+
# Download and install nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash # in lieu of restarting the shell \. "$HOME/.nvm/nvm.sh" # Download and install Node.js: nvm install 22
2. Install Gemini CLI
npm install -g @google/gemini-cli
3. Join the Gemini Code Assist Standard Plan
To use the Gemini CLI, you need to be enrolled in the Google Developer Program and join the Gemini Code Assist Standard Plan.
Click “Join now” under Standard Plan through this link.

4. Configure Your Google Cloud Project
4.1 Create a New Google Cloud Project
Gemini CLI requires a properly configured Google Cloud project to function. Create a new project through this link. Assign a new project name and click “Create”

4.2 Enable Gemini for Google Cloud
You can enable it through this link.

4.3 Grant Required IAM Roles
Grant the necessary permissions to your account for the project through this link
First, find your own account and click edit button.

Then, click “Add another role” to assign the following 2 roles:
Gemini for Google Cloud User
Service Usage Consumer

Then, click “Save”
After saving, take note of your Project ID, which is visible on your Google Cloud Console dashboard. You will need it in the next step.

5. Run the Gemini CLI
Open a terminal, navigate to your project
cd ./path/to/your/project
Finally, you can start your Gemini CLI by running the following commend and replace with your project Id.
export GOOGLE_CLOUD_PROJECT="XXX" gemini
When prompted to authenticate, select “Login with Google” and sign in with the same Google account used to create the Google Cloud Project in the previous steps.

Congratulations, you are now ready to use the Gemini CLI!
Tips & Tricks for Using Gemini CLI for your project
1. Switching models
By default, the Gemini CLI uses the Gemini 2.5 Pro. However, when response time is slow, it may automatically switch to the Gemini 2.5 Flash model to maintain faster response times.

If you wish to switch back to the Pro model, you can do so explicitly with the following command:
gemini --model gemini-2.5-pro
To avoid automatic switching, you can configure the CLI to use your own Gemini API key. Be aware that using the Gemini API with the Gemini 2.5 Pro model will incur costs.
2. Align your Team with Gemini.md
You can provide the Gemini agent with specific instructions, guidelines, and context about your codebase with GEMINI.md. This ensures its responses and actions are tailored to your project’s unique requirements.
How to Use GEMINI.md in the Gemini CLI
- Save the File: Save the content above as a file named
GEMINI.mdin the root directory of your Android Studio project. - Start Gemini CLI: Open your terminal, navigate (
cd) to your project’s root directory, and rungemini. - Give it a Task: The CLI will automatically detect and load the
GEMINI.mdfile. Now you can give it a prompt that leverages this context.
Job Offers
Here is a template of GEMINI.md for your android project:
## 1. Project Overview & Tech Stack
* **Project Name:**
* **Description:**
* **Primary Language:**
* **Architecture:**
* **Key Libraries & Frameworks:**
* **UI:**
* **Asynchronicity:**
* **Dependency Injection:**
* **Database:**
* **Networking:**
* **Navigation:**
* **Testing:**
## 2. Coding Style and Conventions
* **Null Safety:**
* **Immutability:**
* **Formatting:**
* **Naming:**
3. Here are several effective prompts you can adapt for maintaining your Android codebase using the Gemini CLI:
To Check for SDK Updates:
“Scan my
build.gradle.kts files and list all dependencies that have available updates. For each, specify the current version and the latest stable version. Are there any announced deprecation dates for the current versions I am using?”
To Prepare for Android SDK Migration:
“I need to migrate this project to target and compile with Android SDK version 36. Analyze the codebase and identify all necessary changes, including deprecated APIs, required permission updates, and behavior changes I need to implement.”
To Perform a Security Analysis:
“Conduct a security analysis of the entire project. Identify potential vulnerabilities such as insecure data storage, injection attack vectors, or insufficient permission handling. For each vulnerability found, provide a detailed explanation and code examples on how to mitigate it.”
To Review Recent Code Changes:
“Please review the code changes introduced in my last commit. Identify any potential bugs, style guide violations, or areas for performance improvement.”
(Note: The Gemini CLI does not currently support direct comparison between Git branches. For this use case, it’s most effective to have the changes you want to review present in your working directory or as the latest commit.)
Thanks for reading! I’m curious to see how the community uses the Gemini CLI. Share your experiences or suggestions for future articles in the comment section. And if you found this article valuable, please show your support with claps and follows!
This article was previously published on proandroiddev.com.


