# How to teach Gemini CLI your knowledge

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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)). KnowMan separately offers a [local stdio MCP server](https://www.knowman.io/integrations/gemini-cli), with documented configurations for Claude Desktop, [Claude Code](https://www.knowman.io/guides/teach-claude-code-your-knowledge), and Cursor ([KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base)).

## 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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)).

Use the global `~/.gemini/GEMINI.md` for defaults across projects. Repository context files can hold shared project guidance ([Gemini CLI context files](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md), [Gemini CLI memory](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/tools/memory.md)).

## 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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/tools/memory.md)).

Its memory guidance recommends concise durable instructions and avoiding duplicate facts across memory tiers ([Gemini CLI memory](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/tools/memory.md)).

## 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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)).

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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)).

## 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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)).

After changing context files, run `/memory reload` to make Gemini CLI rescan and reload them ([Gemini CLI context files](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)).

## KnowMan for saved articles and links

KnowMan's local stdio MCP server has tools for searching [saved items](https://www.knowman.io/guides/how-to-save-articles), reading one item, [answering with citations](https://www.knowman.io/guides/knowledge-base-for-ai-agents), and saving a URL with an optional note.

KnowMan documents client configurations for Claude Desktop, Claude Code, and Cursor. A Gemini CLI configuration is not documented.

## Where KnowMan fits

Use Gemini CLI context files for standing instructions. KnowMan keeps [saved articles and links](https://www.knowman.io/guides/personal-knowledge-base), reads and tags them, [answers questions](https://www.knowman.io/guides/ai-knowledge-base) with citations, and keeps claims, decisions, and playbooks ([KnowMan MCP guide](https://www.knowman.io/guides/mcp-server-knowledge-base), [guide to giving your AI context](https://www.knowman.io/guides/give-your-ai-context)).

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

## Questions

### 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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md), [Gemini CLI memory](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/tools/memory.md)).

### 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](https://raw.githubusercontent.com/google-gemini/gemini-cli/main/docs/cli/gemini-md.md)).

### Can Gemini CLI search and read my saved KnowMan articles?

KnowMan provides local stdio [MCP tools](https://www.knowman.io/guides/what-is-an-mcp-server) 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.

## Related guides

- [How to Give Your AI Context from What You Read](https://www.knowman.io/guides/give-your-ai-context)

- [How Do You Connect AI to Your Notes?](https://www.knowman.io/guides/connect-any-ai-to-your-notes)

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

## More in this topic

- [How to teach Hermes Agent your knowledge](https://www.knowman.io/guides/teach-hermes-your-knowledge)
- [How to teach Goose your knowledge](https://www.knowman.io/guides/teach-goose-your-knowledge)
- [How to teach JetBrains AI Assistant your knowledge](https://www.knowman.io/guides/teach-jetbrains-your-knowledge)

## More for Gemini CLI

- [Connect KnowMan to Gemini CLI](https://www.knowman.io/integrations/gemini-cli)
- [How to give Gemini CLI better memory](https://www.knowman.io/guides/gemini-cli-memory)

## Give your AI a library to search

Try KnowMan Pro for 14 days with no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

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

Source: https://www.knowman.io/guides/teach-gemini-cli-your-knowledge
