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

@ file suggestions don't shown when using /commands

Open miguelsolorio opened this issue 4 months ago • 7 comments

What happened?

When using custom commands like /plan none of the @ suggestions are appearing Image

Steps to Reproduce

  1. Type @ in the Gemini CLI prompt. A list of available files should appear for autocompletion.
  2. Select a file.
  3. After the file path, type /.
  4. Result: No command autocompletion suggestions appear.

OR

  1. Type / in the Gemini CLI prompt. A list of commands should appear for autocompletion.
  2. Select a command.
  3. After the command, type @.
  4. Result: No file path autocompletion suggestions appear.

What did you expect to happen?

For suggestions to appear using commands

Client information

╭─────────────────────────────────────────────────────────────╮
│                                                             │
│ About Gemini CLI                                            │
│                                                             │
│ CLI Version          0.1.22                                 │
│ Git Commit           5fe4e023                               │
│ Model                gemini-2.5-pro                         │
│ Sandbox              no sandbox                             │
│ OS                   darwin                                 │
│ Auth Method          gemini-api-key                         │
│                                                             │
╰─────────────────────────────────────────────────────────────╯

Login information

No response

Anything else we need to know?

No response

miguelsolorio avatar Aug 20 '25 21:08 miguelsolorio

This is intentional. Commands do not necessarily take file path inputs and it would be misleading to imply that they do. Commands that do take file path inputs can support autocomplete if they want to, tho.

If there is a specific command that takes a file path input and doesn't autocomplete, open a issue to request that.

scidomino avatar Aug 20 '25 21:08 scidomino

@scidomino we support custom commands like /plan, how else are users supposed to add file contexts in these situations? cc @jacob314

miguelsolorio avatar Aug 20 '25 21:08 miguelsolorio

Agree this is important. @abhipatel12 is working on it.

jacob314 avatar Aug 21 '25 08:08 jacob314

@jacob314 i have a ready and simple fix for this...

I implemented dual-mode completion for custom commands by modifying useCommandCompletion.tsx to check if a slash command is a custom command (using CommandKind.FILE). For built-in commands, we immediately return SLASH mode (preserving existing behavior). For custom commands, we allow the logic to continue and check for @ symbols, enabling both slash command completion AND file path completion in the same input.

But it will work only if #6776 is accepted because I have wrapping at 20 chars.

Image

The wrapping occurs because SuggestionsDisplay uses userInput.startsWith('/') to decide rendering style. When the input starts with /, it applies a 20-character width limit designed for command names.

  • Simple @path suggestions: Input is just @filename, doesn't start with /, so no width constraint is applied
  • Our custom command case: Input is /custom @filename, starts with /, so the 20-character limit is incorrectly applied even though we're now showing file suggestions

Kind regards Davor

Update: Hardcoded width fixed #5797

dracic avatar Aug 22 '25 14:08 dracic

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 03 '25 22:12 gemini-cli[bot]

Hi @miguelsolorio @jacob314 !

Can you reopen this? I belive it is quite important.

garar avatar Dec 06 '25 19:12 garar

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 14 '25 00:12 gemini-cli[bot]

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Dec 21 '25 00:12 gemini-cli[bot]