Start free
Guide Teach your agent your knowledge

How to teach Gemini CLI your knowledge

Updated 2 min read

The short answer

Use GEMINI.md files to give Gemini CLI reusable instructions, project guidance, and preferences; it loads discovered context files with each prompt (Gemini CLI context files). KnowMan separately offers a local stdio MCP server, with documented configurations for Claude Desktop, Claude Code, and Cursor (KnowMan MCP guide).

On this page7 sections
  1. Put lasting instructions in GEMINI.md
  2. Keep project and personal notes in the right place
  3. Use hierarchical context for specific guidance
  4. Check which instructions Gemini CLI loaded
  5. KnowMan for saved articles and links
  6. Where KnowMan fits
  7. Questions people ask

Put lasting instructions in GEMINI.md

Gemini CLI uses GEMINI.md context files for project instructions, persona guidance, and coding style. Define instructions there once instead of repeating them in each prompt (Gemini CLI context files).

Use the global ~/.gemini/GEMINI.md for defaults across projects. Repository context files can hold shared project guidance (Gemini CLI context files, Gemini CLI memory).

Keep project and personal notes in the right place

Gemini CLI routes shared project instructions to repository GEMINI.md files, private project notes to a per-project private memory folder, and cross-project preferences to the global file (Gemini CLI memory).

Its memory guidance recommends concise durable instructions and avoiding duplicate facts across memory tiers (Gemini CLI memory).

Use hierarchical context for specific guidance

Gemini CLI searches configured workspace directories and parent directories for context files, concatenates the files it finds, and sends them with each prompt (Gemini CLI context files).

It can also scan for GEMINI.md when a tool accesses a file or directory, allowing component-specific instructions to load when relevant (Gemini CLI context files).

Check which instructions Gemini CLI loaded

Run /memory show to inspect the concatenated instructional context supplied to the model. The CLI footer also displays the number of loaded context files (Gemini CLI context files).

After changing context files, run /memory reload to make Gemini CLI rescan and reload them (Gemini CLI context files).

Where KnowMan fits

Use Gemini CLI context files for standing instructions. KnowMan keeps saved articles and links, reads and tags them, answers questions with citations, and keeps claims, decisions, and playbooks (KnowMan MCP guide, guide to giving your AI context).

KnowMan's MCP server runs locally over stdio and is documented for Claude Desktop, Claude Code, and Cursor.

Questions people ask

Where should I put instructions that apply to every Gemini CLI project?

Use the global ~/.gemini/GEMINI.md file for default instructions across projects. Repository GEMINI.md files hold shared project guidance (Gemini CLI context files, Gemini CLI memory).

How can I inspect Gemini CLI’s current instructions?

Run /memory show to display the concatenated context supplied to the model. The CLI footer also shows how many context files are loaded (Gemini CLI context files).

Can Gemini CLI search and read my saved KnowMan articles?

KnowMan provides local stdio MCP tools for searching saved items and reading one item. Its documented client configurations cover Claude Desktop, Claude Code, and Cursor, not Gemini CLI.

Can KnowMan save a link from Gemini CLI?

KnowMan's kb_save tool saves a URL to Inbox or Knowledge Base with an optional note. Gemini CLI use of that tool is not documented.

Give your AI a library to search

Try KnowMan Pro for 14 days with no credit card. Create your account

Start free

Every new account starts with 14 days of Pro. No credit card.