Skip to content

// guides

Run Gemini CLI on Your Phone (iPhone + Android)

You can run Google Gemini CLI on your phone today, iPhone or Android. The fastest path: install Cosyra for iOS or Cosyra for Android, sign in, and type gemini in the terminal. We pre-install Gemini CLI in an Ubuntu 24.04 container in the cloud, so there is no Node 20 install, no Termux native-build errors, no SSH tunnel to babysit. Heads up before you start: Gemini CLI's free personal-account tier ended 2026-06-18, so you now authenticate with a paid Google AI Studio or Vertex API key. 1 hour free on Cosyra signup, no credit card. On Android specifically, where Termux is a real on-device option, our Gemini CLI on Android guide goes deeper on the NDK build failures, the workarounds, and the phantom-process killer. On iPad it's a different story — there is no Termux, and the on-device shells can't run Node — so our Gemini CLI on iPad guide covers the two paths that actually work on the tablet. The iPhone hits the same iOS wall in a one-handed form factor, which our Gemini CLI on iPhone guide walks through with dictation and the commute-kickoff workflow.

This guide was written by the Cosyra team. We tested Gemini CLI on iPhone and Android via Cosyra, plus the Termux path and the Blink-plus-VPS path. Where we make claims about Gemini CLI itself, they are re-verified 2026-06-23 and cross-checked against the official repo and the Google announcement.

Update (re-verified 2026-06-23): the free Gemini CLI tier has ended. On 2026-05-20 Google announced the transition from Gemini CLI to Antigravity CLI, and the cutoff has now passed. As of 2026-06-18 Gemini CLI stopped serving requests for free individual users (Gemini Code Assist for individuals), Google AI Pro, and Ultra subscribers — the free OAuth login returns HTTP 410 Gone. Standard and Enterprise licenses through Google Cloud keep access, and the open-source binary still runs if you supply a paid AI Studio or Vertex API key (you lose the free endpoints, not the toolchain). Antigravity CLI (binary name agy, built in Go, closed-source) is the replacement and did not launch at feature parity. The setup below now uses a paid API key; Google never published a free-request quota for Antigravity CLI, so confirm its limits in Antigravity's docs if you migrate there instead.

What is Google Gemini CLI?

Gemini CLI is Google's official open-source terminal agent for the Gemini models. The README calls it "an open-source AI agent that brings the power of Gemini directly into your terminal." It ships under Apache 2.0, as the @google/gemini-cli npm package, and also installs via Homebrew, MacPorts, and Anaconda. It needs Node.js 20 or newer. Features include file operations, shell command execution, web search, and tool extensibility via MCP (Model Context Protocol) — the same protocol whose servers we keep alive in a cloud container so a backgrounded phone app cannot kill them, walked through in running MCP servers from your phone.

Until 2026-06-18, the thing that made Gemini CLI genuinely different from Claude Code or Codex CLI on a phone was the free-tier economics: a personal Google account, no API key, no credit card, and 60 requests per minute and 1,000 per day across the Gemini model family with Gemini 2.5 Flash as the default. Google positioned the allowance as "the industry's largest" for unpaid access when they launched. That free path is gone now — the sign-in returns HTTP 410 Gone. What remains is the same Apache-2.0 binary running on a paid AI Studio or Vertex key, where Gemini 2.5 Pro's 1-million-token context window is still the draw — larger than most competitors' defaults, and cheap on Flash for a quick large-context pass even though it is no longer free.

How can you run Gemini CLI on a phone?

You can run Gemini CLI on a phone three ways: a cloud Ubuntu container with Gemini pre-installed reached from a native mobile app (Cosyra), Termux on Android with install workarounds, or Blink Shell on iOS into a VPS you own. Gemini CLI needs a real Linux or macOS shell with Node 20+, so every approach puts the actual CLI process somewhere else and gives your phone a way to drive it. All three options are current as of 2026-06-23.

1. Cosyra: cloud Ubuntu container, Gemini CLI pre-installed

This is what we built. A native iOS and Android terminal that connects to a persistent Ubuntu 24.04 container in the cloud. Gemini CLI, Claude Code, Codex CLI, and OpenCode are already installed against a current Node 20+. You paste a paid GEMINI_API_KEY (the free Google sign-in ended 2026-06-18), type gemini, and go.

2. Termux on Android, with install workarounds

Install Termux from F-Droid, install Node 20+ with pkg install nodejs, then npm install -g @google/gemini-cli. On paper this should work. In practice, the google-gemini/gemini-cli repo has a string of open and closed Termux issues: 0.3.3 failed on Termux with Node v22.19.0, 0.11.0-nightly failed to build on Termux/arm64 with Node v24, and a separate clipboardy mis-detection bug was closed by Google as "not planned." The two working recipes today are (a) add --ignore-scripts so native modules like tree-sitter-bash are not built, or (b) pin an older version such as @google/gemini-cli@0.2.2. A community fork, DioNanos/gemini-cli-termux, exists specifically because the upstream path is brittle on Android.

3. SSH from Blink Shell into your own VPS (iOS only)

On iPhone or iPad, Blink Shell is the gold-standard SSH client. Spin up a VPS (Hetzner, Scaleway, DigitalOcean), npm install -g @google/gemini-cli on it, SSH in from Blink inside a tmux session, and run gemini. Authentication via GEMINI_API_KEY is the simplest path here because browser-flow sign-in is awkward over SSH.

How do you set up Gemini CLI on iPhone or Android?

You set up Gemini CLI on iPhone or Android in about three minutes with Cosyra: install the app, sign in, confirm gemini is on the PATH, paste a paid GEMINI_API_KEY (the free Google sign-in ended 2026-06-18), clone a repo, run gemini. No Node install, no npm, no Termux native-build errors.

Step 1: Install Cosyra and sign in

Download from the App Store or Google Play. Sign in with Apple, Google, or email. On first launch we provision a fresh Ubuntu 24.04 container.

cosyra, fresh container first-launch banner

Welcome to Cosyra.

Ubuntu 24.04.1 LTS (x86_64)

Pre-installed: claude, codex, gemini, opencode

 

$ node --version

v20.18.1

Step 2: Confirm Gemini CLI is there

No install step — Gemini CLI is baked into the image. Verify in one command.

cosyra, verifying gemini is installed

$ gemini --version

0.12.0

$ which gemini

/usr/local/bin/gemini

Step 3: Authenticate with a paid Gemini API key

The personal-Google-account free tier (60 rpm / 1,000 rpd) ended 2026-06-18, so the free browser sign-in no longer works — it returns HTTP 410 Gone. The working path now is a paid key: grab one from Google AI Studio or Vertex AI, export it, and run gemini. Gemini 2.5 Flash is the cheapest model and stays inexpensive for casual phone use; gemini-2.5-pro unlocks the 1-million-token context window at a higher per-token cost.

cosyra, authenticating gemini with a paid API key

$ echo 'export GEMINI_API_KEY="your-key-here"' >> ~/.bashrc

$ source ~/.bashrc

$ gemini

Welcome to Gemini CLI.

Authenticated via GEMINI_API_KEY. model: gemini-2.5-flash.

Step 4 (optional): Or move to Antigravity CLI

If you would rather stay on Google's free-of-subscription path, Antigravity CLI (agy) is the official replacement for the retired free tier. Google has not published a free-request quota for it, so confirm the limits in Google's transition note before you rely on it. For most phone workflows, a paid Flash key on the Apache-2.0 gemini binary is the lower-friction choice.

cosyra, installing antigravity cli (agy)

# install per Google's transition note (Go binary)

$ curl -fsSL https://antigravity.google/cli/install.sh | bash

$ agy --version

agy installed to ~/.local/bin (Google Sign-In on first run)

Step 5: Run your first Gemini prompt

cosyra, running gemini on a project

$ git clone https://github.com/your-org/your-project.git && cd your-project

$ gemini

gemini 0.44.1

workspace: /home/cosyra/your-project

model: gemini-2.5-flash (cheapest, via paid key)

 

> Summarize the repo structure and flag any

files with more than 500 lines.

Gemini reads the repo, summarizes it, and lists long files. You see the result on your phone screen. The 1M-token context window means it can ingest a lot of code in one pass, useful when you are triaging a repo you have not touched in months.

Try it free. 1 hour on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more. Bring a paid Gemini API key (the free tier ended 2026-06-18). App Store / Google Play / Pricing details

What can you actually do with Gemini on your phone?

The unlock on a phone is specifically Gemini 2.5 Pro's 1-million-token context window: you can paste or reference a large amount of code in one prompt and still get a coherent answer. Since the free personal tier ended 2026-06-18, you run this on a paid AI Studio/Vertex key — Flash for cheap everyday passes, Pro when you need the full context window. Three real sessions we run from a phone.

Triage a large repo on the train

You inherited a service with 40 files you have never read. Open Cosyra, cd in, run gemini, type "summarize what this service does, its public API, and the three riskiest files." The 1M-token window means Gemini can look at most of the codebase in one pass on a moderate service. You get an overview before your stop.

Generate tests for a module from the couch

Saturday morning. Pick a file that needs tests. "Read src/billing/invoice.ts and write a Vitest suite covering the three pricing tiers and the proration edge cases." Gemini proposes the test file, you review, approve, run.

Explain a third-party library when you are stuck

Pager does not need to be going off. Sometimes you just want to understand what a hairy library does before you commit to using it. Paste its README into gemini with "explain the mental model I should have before I use this." Gemini's 1M context is enough to take the whole README plus a couple of example files in a single Flash request.

What are the real limits of running Gemini CLI on a phone?

The real limits are no offline mode, paid-key billing now that the free personal tier has ended, Gemini 2.5 Pro is not always the best model for every task, and Google's terms can change on short notice. Knowing where Gemini stops helps you match it to the right job instead of fighting it.

How does Cosyra compare to Termux and Blink+VPS for Gemini CLI?

Cosyra wins for zero-setup, dual-platform use, and skipping the Termux native-build drama; Termux wins if you are an Android power user who accepts the pinning tax; Blink plus a VPS wins on iOS if you want a box you own. None is strictly best; each maps to a trade-off. Comparison as of 2026-05-21.

Feature Cosyra Termux + workarounds Blink + VPS
Gemini CLI pre-installed Yes No (brittle on recent versions) You install on VPS
Platforms iOS + Android Android only iOS only
Gemini auth (after 2026-06-18 sunset) Paid AI Studio/Vertex key (free tier ended) Paid AI Studio/Vertex key (free tier ended) Paid AI Studio/Vertex key (free tier ended)
Requires always-on machine No No (local only) Yes (your VPS)
Native-build breakage risk No Yes (tree-sitter, clipboardy) No
Setup time (cold) ~3 min 30 min + troubleshooting 30 to 60 min
Price (not counting tokens) $29.99/mo after trial Free $19.99/yr + VPS (~$5–40/mo)

For the broader picture across all four AI agents on mobile, see our pillar guide on AI coding agents on mobile. For the same walkthrough with Anthropic's tool, see Claude Code on phone; for OpenAI's, see Codex CLI on phone; for the open-source alternative that lets you swap models without rewriting your config, see OpenCode on phone. If you want the Gemini CLI fork built around Alibaba's open-weight model, see Qwen Code on phone or the head-to-head Cosyra vs Qwen Code comparison. For Google's other mobile dev surface — the hosted Firebase Studio workspace rather than the CLI — see how the same workspace holds up on a phone-sized Safari window in Firebase Studio on phone and on an iPad in Firebase Studio on iPad. Gemini CLI is the interactive Google agent you drive live in the shell; for its async sibling that runs in a cloud VM and hands you a pull request instead of a session, see Jules on your phone — or, if you drive that agent from a tablet, Jules on iPad, or weigh the two approaches head-to-head in Cosyra vs Jules. For the AWS equivalent — a terminal agent that logs in with an AWS Builder ID instead of a provider key you paste — see Amazon Q CLI on your phone.

Frequently asked questions

Can you run Google Gemini CLI on a phone?

Yes, indirectly. Gemini CLI wants a real Linux or macOS shell with Node 20 or newer. The three working paths are a cloud Ubuntu container you reach from a native mobile app (Cosyra), Termux on Android with install workarounds, or Blink Shell on iOS into a VPS. The Gemini CLI README on GitHub lists macOS and Linux explicitly; there is no iOS or Android build.

Does Gemini CLI still have a free tier? (Not anymore.)

Not for individuals. Until 2026-06-18, signing into Gemini CLI with a personal Google account unlocked 60 model requests per minute and 1,000 requests per day across the Gemini model family, with Gemini 2.5 Flash as the default, at no charge. The 1,000/day cap was family-wide, not 1,000 Gemini 2.5 Pro requests: a maintainer confirmed in discussion #4122 that Pro drew from a much smaller quota. That free path ended 2026-06-18 — the sign-in now returns HTTP 410 Gone. You now run the open-source binary with a paid Google AI Studio or Vertex AI key (usage-based billing), or move to Antigravity CLI.

Is Gemini CLI being replaced by Antigravity CLI?

Yes, and the cutoff has passed. On 2026-05-20 Google announced it is transitioning Gemini CLI to Antigravity CLI (built in Go, binary name agy), which keeps Agent Skills, Hooks, Subagents, and Extensions but did not launch at feature parity. As of 2026-06-18 Gemini CLI stopped serving requests for free individual users, Google AI Pro, and Ultra subscribers; Gemini Code Assist Standard and Enterprise licenses through Google Cloud are unaffected, and the open-source binary still runs with a paid AI Studio/Vertex key. If you relied on the personal-account free tier, move to Antigravity CLI or a paid Gemini API key. We walk through what that move looks like from a phone in Google Antigravity on a phone.

Does Gemini CLI install cleanly on Termux on Android?

Not reliably on recent versions. The repo has multiple user-filed issues reporting install and build failures on Termux/arm64, and a separate clipboardy-mis-detection bug was closed by Google as "not planned." Working paths today are --ignore-scripts, pinning to an older version, or using a Termux-focused community fork. For reliable Gemini CLI on Android phones, a cloud x86_64 container is the least brittle option.

What Node.js version does Gemini CLI need?

Node.js 20.0.0 or newer, according to the installation docs. On Termux you get it with pkg install nodejs; on macOS or Linux, nvm install 20 or your package manager of choice. In Cosyra, Node 20+ is already on the image, so you do not see this step at all.

Is there a Termux-friendly Gemini CLI fork?

Yes. DioNanos/gemini-cli-termux on GitHub is an independent fork "optimized for Termux with Android integration." It exists because the upstream Gemini CLI has repeated Termux install issues, some of which Google has declined to fix. If you are committed to the Termux path, it is worth a look; if you want the fastest setup without maintaining a fork, a cloud container is simpler.

Is there an official Google Gemini CLI mobile app?

No. As of 2026-05-21, Google publishes Gemini CLI as a Node.js package for macOS, Linux, and Windows desktops. There is no App Store or Play Store build and no feature inside the Gemini mobile app that drives the CLI remotely. Community setups bridge the gap by running the CLI on a Linux box you control and pointing a phone at it; Cosyra does the hosting for you.

tl;dr

Gemini CLI runs on Linux or macOS with Node 20+, not on phones directly. Three bridges: a cloud Ubuntu container with Gemini pre-installed (Cosyra), Termux on Android with workarounds, or Blink Shell on iOS into a VPS. We recommend the cloud container for most people because the Termux path is currently brittle. Heads up: Google retired Gemini CLI's free personal tier on 2026-06-18 and moved to Antigravity CLI, so you now run it with a paid AI Studio/Vertex key (cheap on Flash for interactive phone use) or switch to Antigravity CLI.

App Store / Google Play. Sign up for 1 hour free, no credit card. Extend with a 10-hour, 7-day trial when you want more.

Run Gemini CLI from your phone in three minutes. Install Cosyra, paste a paid Gemini API key, type gemini.

See pricing