English

Product LaunchesGeminiGemini CLI

Guide Published on Achieving Agentic Coding with Gemini CLI

This article is a translation. Read the Japanese original

Gemini CLI is an open-source AI assistant that enables direct operation of Gemini models from the terminal. It performs tasks such as coding, debugging, and system automation through natural language prompts.

This tool is capable of "agentic" behavior. Based on user requests, it reasons and autonomously selects tools—such as executing shell commands or editing files—to carry out multi-step plans.

Installation can be performed via npm. In addition to global installation, it is possible to run the tool without installation using npx [Hacker News].

There are two methods for authentication: logging in with a Google account (free tier) or configuring an API key issued via Google AI Studio. When using an API key, data protection applies to paid plans, ensuring that prompts are not used for training [Hacker News].

In terms of operation, the tool supports interactive sessions, single executions via the -p flag, and pipe processing from standard input. It also supports shell execution through slash commands and bang commands (!) [Hacker News].

By default, it operates in safe mode. User approval is always required for operations that modify the system, such as writing files or executing commands [Hacker News].

As a tip for efficient use, the creation of a GEMINI.md file describing project-specific context is recommended. This allows background knowledge to be provided to the AI without repeating instructions in every prompt [Hacker News].


Source: Gemini CLI tips and tricks for agentic coding(HN 403pt・145コメント) (HN Search (backfill), 2025-11-27)