Gemini-powered terminal agent

How to use
Gemini CLI.

Completing bounded repository tasks from the terminal with explicit tool approvals, optional sandboxing, recoverable checkpoints, and scriptable output.

What it isopen-source Gemini-powered terminal agent for software development and automation Workflows2 UpdatedJuly 2026

Gemini CLI is a open-source Gemini-powered terminal agent for software development and automation. Completing bounded repository tasks from the terminal with explicit tool approvals, optional sandboxing, recoverable checkpoints, and scriptable output. This guide covers the whole path in one place: official access, a first session that produces something reviewable, the checks that make output trustworthy, and the permissions worth limiting before you connect real work.

Troiana principle

AI should make the work easier to inspect. If the workflow removes the source, the owner, or the review step, redesign the workflow.

01

Access & setup

Find, install, and sign in to Gemini CLI

Get into the official Gemini CLI experience with the right account and a setup you understand.

  1. 01

    Start at https://geminicli.com/ and confirm the domain before entering account or payment information.

  2. 02

    Availability: Gemini CLI runs in a terminal and can inspect repositories, edit files, execute tools, use extensions, and support interactive or scripted workflows.

  3. 03

    A supported Node.js environment or packaged install, Google authentication or an approved API key, a version-controlled project, and reviewed trust, sandbox, checkpoint, extension, and telemetry settings.

  4. 04

    Sign in with the account you intend to keep using, then review plan, data, notification, and permission settings.

  5. 05

    Run one low-risk test task before connecting sensitive files, repositories, or workspace data.

  • Use official download pages.
  • Review permissions during setup.
  • Keep installers and applications updated.
02

First session

Your first useful Gemini CLI session

Learn the interaction loop using a small task with a clear outcome.

  1. 01

    Install Gemini CLI from an official channel, authenticate without committing credentials, and begin in a clean repository branch.

  2. 02

    Review folder trust, extensions, MCP servers, settings, and telemetry before exposing private code or enabling tools.

  3. 03

    Enable checkpointing and a suitable sandbox, then provide a scoped goal, relevant files, constraints, and validation commands.

  4. 04

    Approve consequential actions individually, inspect the final diff and tool output, and run trusted tests before any commit or release.

  • State the outcome before the background.
  • Provide the real source material.
  • Review the result before expanding the task.
03

Quality control

Check the quality of Gemini CLI output

Establish that an autonomous run did the right thing, not merely that it finished.

  1. 01

    Define what the run should achieve and what it must never touch before granting it a single tool.

  2. 02

    Read the full execution trace: which tools were called, with what arguments, and in what order.

  3. 03

    Verify the side effects directly in the target system rather than trusting the agent's own report of success.

  4. 04

    Confirm failures surfaced as failures — a silent retry loop or a swallowed error is more dangerous than a crash.

  5. 05

    Re-run the same task and compare: an agent that behaves differently across identical runs is not yet production-ready.

  • Verify side effects in the system of record, not in the agent's summary.
  • Require human approval for any irreversible or outward-facing action.
  • Log every tool call so a run can be reconstructed afterwards.
04

Privacy & permissions

Use Gemini CLI safely

Bound what an autonomous system can reach before you let it run unattended.

  1. 01

    Enumerate every tool, credential, and system the agent can reach, and remove the ones it does not need.

  2. 02

    Require explicit human approval for irreversible actions: sending, publishing, paying, deleting, or deploying.

  3. 03

    Run against non-production data until behaviour is predictable across repeated runs.

  4. 04

    Set hard limits on spend, iterations, and runtime so a failure loop cannot run unbounded.

  5. 05

    Treat anything the agent reads from the web or a document as data, never as instructions it may follow.

  • Gemini CLI can invoke tools automatically, execute shell commands, modify files, use extensions and MCP servers, and access network services when permitted. Sandboxing and checkpointing are not universal guarantees and may require explicit setup; YOLO mode auto-approves actions. Keep high-risk work in a disposable environment, review trust and extension code, restrict credentials and network access, avoid unattended side effects, and verify restored checkpoints and final results.
  • Follow your organisation's approved-use policy.
  • Never treat fluent output as authorization to act.
05

Core workflows

Step-by-step ways to use Gemini CLI for the work it does best.

Each workflow is a separate guide with its own steps and review checkpoints.

06

Official references

Check the current product documentation.

Features, plan limits, availability, and data controls change. These official pages are the starting points used for this guide.

Explore the Troiana AI Hub →