Skip to main content
Gemini CLI is Google’s open-source command-line coding agent powered by the Gemini family of models. It can read files, run commands, edit code, and work through multi-step tasks in a terminal. By default, Gemini CLI looks for a specific context filename. You can configure it to read AGENTS.md by updating your project’s settings file.

Gemini CLI on GitHub

Gemini CLI — source and documentation.

Configuration

Create or update .gemini/settings.json in your repository root with the following:
{
  "context": {
    "fileName": "AGENTS.md"
  }
}
This tells Gemini CLI to load AGENTS.md as the context file for every session in this repository.
1

Create the .gemini directory

In your repository root:
mkdir -p .gemini
2

Create settings.json

Create .gemini/settings.json with the context configuration:
{
  "context": {
    "fileName": "AGENTS.md"
  }
}
3

Verify the configuration

Start a Gemini CLI session in the repository. The agent will read AGENTS.md before responding to your first prompt.
Commit .gemini/settings.json to your repository so every contributor’s Gemini CLI session uses the same context file automatically.

Example AGENTS.md for Gemini CLI users

AGENTS.md
# AGENTS.md

## Build and test
- Build all packages: `go build ./...`
- Run all tests: `go test ./...`
- Static analysis: `go vet ./...`
- Lint (requires golangci-lint): `golangci-lint run`

## Code style
- Standard Go formatting enforced by `gofmt`
- Follow Effective Go conventions
- Error handling: always check errors; wrap with `fmt.Errorf("...: %w", err)` for context
- Avoid global state; pass dependencies explicitly

## Project structure
- `cmd/` — main entry points, one subdirectory per binary
- `internal/` — packages not intended for external use
- `pkg/` — reusable packages
- `testdata/` — fixtures and golden files for tests

## Commits
- One logical change per commit
- Commit message format: short summary (50 chars), blank line, detail paragraph
- All tests must pass before committing

Build docs developers (and LLMs) love