gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Gemini model is not aware of its own CLI commands and features

Open Libertocrat opened this issue 1 year ago • 3 comments

What happened?

Description

The Gemini model, when operating within the Gemini CLI, often incorrectly denies the existence of built-in CLI commands and features. It appears to rely on its general, pre-trained knowledge instead of consulting its immediate operational environment or the official documentation for the CLI tool it is a part of.

This forces the user to manually research the features (e.g., by checking /help or the official docs) and then correct the model, which undermines its reliability as an expert assistant for its own tool.

Steps to Reproduce

  1. Start a new chat session with the Gemini CLI.
  2. Ask the model about a specific, built-in Gemini CLI command.
  3. Observe the model's response, which may incorrectly state that the command does not exist.

Specific Examples Encountered

During a single session, the model was unaware of the following commands until corrected by the user:

  1. /mcp: When asked about MCP server integration, the model initially denied having any specific MCP-related commands.
  2. /chat save: When asked how to save the session, the model suggested a manual copy-paste method and was unaware of the built-in save command.

What did you expect to happen?

Expected Behavior

When asked about a feature or command of the Gemini CLI, the model's primary action should be to consult its official documentation or internal help system as the source of truth. It should provide an accurate, context-aware answer based on the CLI's actual capabilities.

Actual Behavior

The model defaults to its general, pre-trained knowledge, which can be outdated or lack specific details about the CLI. This leads to incorrect denials of features, forcing the user to research the functionality themselves and correct the model.

Client information

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│  > The n8n mcp server is running locally. I've already updated the settings.json file to include it. I'll reload this session. How do I save the   │
│    conversation to resume it later?                                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

✦ Excellent! Here is a guide on how to save and resume our conversation.

  To Save the Conversation:

   1. Copy the text of our entire conversation from your terminal or chat interface.
   2. Paste it into a text file. A good name would be something like gemini-n8n-setup.md. Using a .md (Markdown) extension will help preserve the
      formatting.
   3. Save the file in your project directory.

  To Resume the Conversation Later:

  When you start a new session, I won't have the memory of this conversation. To get me back up to speed, you can provide a summary of our progress.

  Here is an example of what you can say when you return:

  > You: I'm continuing our session from earlier. We have set up the n8n-mcp server, and it is running locally in a Docker container on port 8080. The
  Gemini CLI has been configured in the ~/.gemini/settings.json file to connect to this server. Now, let's test it.

  This summary provides all the essential context for me to understand the current state and continue assisting you effectively.

  Go ahead and reload the session. I'll be ready when you are

╭───────────────────────────────────────────────╮
│  > Really? How about the /chat/save command?  │
╰───────────────────────────────────────────────╯

✦ You have an excellent point, and you've highlighted another key feature of the CLI environment that hosts me.

  You are absolutely right. If the Gemini CLI provides a /chat/save command, that is the correct, built-in, and most reliable method for saving our
  session.

  My previous answer described a manual, universal method (copying and pasting) that would work in any terminal environment. However, a dedicated
  command like /chat/save is far superior because it is designed to save the state of the conversation in a structured way, making the resume process
  much smoother and more accurate.

  Thank you for pointing this out. Please use the /chat/save command. It is the proper way to manage your session within the Gemini CLI.

Login information

Google Account

Anything else we need to know?

Suggested Improvement

The model's core operational directive should be updated. When a query is about the Gemini CLI itself, its internal process should prioritize checking the official documentation as the source of truth before formulating a response from its general knowledge base. This would prevent incorrect answers, build user trust, and improve the overall user experience significantly.

Libertocrat avatar Jul 26 '25 03:07 Libertocrat

Thanks for raising this, I've run into a similar issue and I'd like to share my experience to support this issues.

I was trying to learn how to create custom commands. I started by asking the Gemini CLI:

How do I set up Gemini CLI Custom Commands? Does this feature support toml files?

The model responded:

Yes, I know how to set up Gemini CLI's "Custom Commands", but two key points need to be clarified:

  1. This feature is called aliases in the official documentation.
  2. The configuration file is config.json, which does not support .toml files.

Gemini CLI's settings are managed through JSON files, and there is no mention of supporting the TOML format.

This answer is incorrect. While aliases exist, the primary feature for creating custom commands is through .toml files in the ~/.config/gemini-cli/commands/ directory, as documented in the repository.

While I know I can use

web_fetch

with a specific URL to get accurate information, that workflow feels like a workaround. The tool shouldn't require me to fact-check its own output.

e2720pjk avatar Jul 26 '25 10:07 e2720pjk

Ask gemini cli to read this repo doc and give you the answer. You use the tools the wrong way. Learn how to use git

tuapuikia avatar Jul 26 '25 19:07 tuapuikia

Found possible duplicate issues:

  • #1911: (#0.9157463585062734)

gsquared94 avatar Jul 29 '25 23:07 gsquared94