---
title: "GEMINI.md (Gemini CLI): path และรูปแบบ · DotsAgent"
description: "ตำแหน่งของ GEMINI.md รูปแบบและ frontmatter วิธีผสานไฟล์ระดับ global กับไฟล์ในโฟลเดอร์ย่อย และเครื่องมือที่อ่านไฟล์นี้ ตรวจสอบเมื่อ 2026-10-01"
url: https://dotsagent.io/th/instructions/files/gemini-md
---

GEMINI.md

# GEMINI.md (Gemini CLI): ตำแหน่งไฟล์และวิธีที่เครื่องมืออ่าน

GEMINI.md คือไฟล์ context ที่ Gemini CLI ส่งไปพร้อมกับทุก prompt นอกจากนี้ยังอ่าน AGENTS.md หรือชื่อไฟล์อื่นที่กำหนดไว้ใน context.fileName ได้

## ตำแหน่งไฟล์

- ส่วนกลาง: ~/.gemini/GEMINI.md
- GEMINI.md ในไดเรกทอรี workspace และไดเรกทอรีแม่
- GEMINI.md ที่ค้นพบตามต้องการในไดเรกทอรีที่ tools เข้าถึง รวมถึงไดเรกทอรีบรรพบุรุษจนถึง trusted root

## รูปแบบ

Markdown โดยไม่มี frontmatter นำเข้าไฟล์อื่นด้วย @file.md ได้ทั้งแบบพาธสัมพัทธ์และพาธสัมบูรณ์ ผ่าน Memory Import Processor กำหนดชื่อไฟล์ได้ผ่าน context.fileName ซึ่งรับค่าเป็นสตริงหรือรายการ

`GEMINI.md`

```
# Project context

@./docs/architecture.md

## Commands

- Install: `uv sync`
- Test: `uv run pytest`
- Lint: `uv run ruff check .`

## Rules

- Target Python 3.13 with type hints on public functions.
- Keep database code in app/db/.
- Never run migrations against production.
```

## ลำดับความสำคัญและการผสาน

โหลดไฟล์ตามลำดับ: ไฟล์ส่วนกลาง ตามด้วยไดเรกทอรี workspace และไดเรกทอรีบรรพบุรุษ แล้วจึงเป็นไฟล์ที่ค้นพบตามต้องการ ไฟล์ทั้งหมดจะถูกรวมต่อกันและส่งไปพร้อมกับทุก prompt จึงไม่มีไฟล์ใดเขียนทับไฟล์อื่น

## เครื่องมือที่อ่านไฟล์นี้

| เครื่องมือ | การรองรับ |
| --- | --- |
| [Gemini CLI](https://geminicli.com/docs/cli/gemini-md/) | รองรับโดยตรง เปลี่ยนชื่อไฟล์หรือเพิ่ม AGENTS.md ผ่าน context.fileName ได้ ตรวจสอบไฟล์ด้วย /memory show และโหลดใหม่ด้วย /memory reload |
| [GitHub Copilot](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions) | อ่าน GEMINI.md ที่ root เป็นคำสั่งสำหรับ agent เพื่อใช้แทน AGENTS.md |

## เคล็ดลับ

- กำหนด context.fileName เป็น ["AGENTS.md", "GEMINI.md"] ใน .gemini/settings.json เพื่อใช้ไฟล์เดียวร่วมกับ agents ตัวอื่น
- ไฟล์ที่โหลดทุกไฟล์จะถูกส่งไปพร้อมกับทุก prompt จึงควรตัดเนื้อหาที่ model ไม่จำเป็นต้องใช้ทุกครั้งออก
- ใช้ /memory show เพื่อดูว่า Gemini CLI โหลดอะไรบ้าง และใช้ /memory reload หลังแก้ไขไฟล์

สร้าง AGENTS.md และไฟล์กฎที่ตรงกันสำหรับเครื่องมือ 5 รายการจากแบบฟอร์มเดียว [เปิดตัวสร้าง AGENTS.md →](https://dotsagent.io/th/instructions)

## ไฟล์คำสั่งอื่น ๆ

[AGENTS.md](https://dotsagent.io/th/instructions/files/agents-md)

[CLAUDE.md](https://dotsagent.io/th/instructions/files/claude-md)

[.cursor/rules/*.mdc](https://dotsagent.io/th/instructions/files/cursor-rules)

[.github/copilot-instructions.md](https://dotsagent.io/th/instructions/files/github-copilot-instructions)

[.devin/rules/*.md](https://dotsagent.io/th/instructions/files/windsurf-rules)

[.clinerules/](https://dotsagent.io/th/instructions/files/cline-rules)

[~/.openclaw/workspace/AGENTS.md](https://dotsagent.io/th/instructions/files/openclaw-workspace)

## แหล่งข้อมูล

1. [geminicli.com](https://geminicli.com/docs/cli/gemini-md/)/docs/cli/gemini-md/

แหล่งอ้างอิงอิสระสำหรับผู้สร้าง AI agent ไม่มีส่วนเกี่ยวข้องกับผู้ให้บริการที่กล่าวถึง

© 2026 DotsAgent · ตรวจสอบข้อมูลเมื่อ 1 ตุลาคม 2569
