Commit Graph

124 Commits

Author SHA1 Message Date
N. Taylor Mullen
afc30e314f feat(accessibility): Add option to disable loading phrases (#745) 2025-06-04 07:46:57 +00:00
Marat Boshernitsan
7de790fbf2 Fix several bugs in prompt history (#734)
Co-authored-by: Marat Boshernitsan <maratb@google.com>
2025-06-03 23:01:26 -07:00
Keith Ballinger
c313762ba0 Ignore folders files (#651)
# Add .gitignore-Aware File Filtering to gemini-cli

This pull request introduces .gitignore-based file filtering to the gemini-cli, ensuring that git-ignored files are automatically excluded from file-related operations and suggestions throughout the CLI. The update enhances usability, reduces noise from build artifacts and dependencies, and provides new configuration options for fine-tuning file discovery.

Key Improvements
.gitignore File Filtering

All @ (at) commands, file completions, and core discovery tools now honor .gitignore patterns by default.
Git-ignored files (such as node_modules/, dist/, .env, and .git) are excluded from results unless explicitly overridden.
The behavior can be customized via a new fileFiltering section in settings.json, including options for:
Turning .gitignore respect on/off.
Adding custom ignore patterns.
Allowing or excluding build artifacts.
Configuration & Documentation Updates

settings.json schema extended with fileFiltering options.
Documentation updated to explain new filtering controls and usage patterns.
Testing

New and updated integration/unit tests for file filtering logic, configuration merging, and edge cases.
Test coverage ensures .gitignore filtering works as intended across different workflows.
Internal Refactoring

Core file discovery logic refactored for maintainability and extensibility.
Underlying tools (ls, glob, read-many-files) now support git-aware filtering out of the box.


Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-06-04 04:40:46 +00:00
Scott Densmore
2ab7e3da71 feat(cli): Allow custom title in CLI header (#706) 2025-06-02 17:09:55 -07:00
Jacob Richman
51949f3121 Fix bug pasting multiline strings (#632) 2025-06-02 14:31:35 -07:00
Tolik Malibroda
0795e55f0e feat: Add --yolo mode that automatically accepts all tools executions (#695)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-06-02 22:05:45 +02:00
N. Taylor Mullen
42bedbc3d3 feat: Refactor CLI header for customizable logo text (#658) 2025-06-02 11:45:09 -07:00
Miguel Solorio
33052018a2 Color enhancements (#680) 2025-06-02 11:20:58 -07:00
N. Taylor Mullen
c51d6cc9d3 fix: Display MCP server count in context summary (#674) 2025-06-01 22:48:48 +00:00
Tommaso Sciortino
21fba832d1 Rename server->core (#638) 2025-05-30 18:25:47 -07:00
Olcan
2e57989aec confirm mcp tool executions from untrusted servers (per "trust" setting) (#631) 2025-05-30 15:32:21 -07:00
Jacob Richman
01768d7759 feat: add --show_memory_usage flag to display memory usage in status bar (#606) 2025-05-30 15:18:01 -07:00
Allen Hutchison
3291ffbe09 fix(cli): Clear input buffer before onSubmit in InputPrompt (#633) 2025-05-30 15:16:06 -07:00
Olcan
a0ba65944f disable markdown rendering of shell tool output (#625) 2025-05-30 12:43:59 -07:00
Brandon Keiji
816cc08a8f fix(sandbox): set default env var to 'gemini-cli-sandbox' (#620) 2025-05-30 18:02:27 +00:00
Olcan
7c4a5464f6 truncate (hide) tool output at the top, add some spacing, also fix shell output interval change accidentally undone in a previous commit (#619) 2025-05-30 01:58:09 -07:00
Brandon Keiji
fd6f6b02ea feat: add git branch name to footer (#589) 2025-05-28 16:30:05 -07:00
Jacob Richman
00805cb2cd Cleanup: Remove low value StreamingContextType interface. (#585) 2025-05-28 12:46:08 -07:00
Jacob Richman
05a49702d8 Refactor: Add GeminiRespondingSpinner to make use of streamingState idiomatic (#583) 2025-05-28 11:17:19 -07:00
DeWitt Clinton
98dcf43214 Add a keybinding for ctrl+w to delete the previous word. (#582)
Adds the following new keybindings to the cli text input buffer:

- `Ctrl+W` : Delete previous word
2025-05-28 09:59:25 -07:00
DeWitt Clinton
27a773d5b2 Display git commit info in the /about section. (#567)
This change detects the most recent git commit short hash and writes it to the `GIT_COMMIT_INFO` constant in `packages/cli/src/generated/git-commit.sh`, optionally appending the string "(local modifications)" if additional local changes after that commit are detected.

If set, this string is displayed in the `/about` dialog as well as passed into the `/bug` template.

Example:

```
> /about

╭───────────────────────────────────────────────────────────────────────────╮
│                                                                           │
│ About Gemini CLI                                                          │
│                                                                           │
│ CLI Version               development                                     │
│ Git Commit                43370ab (local modifications)                   │
│ Model                     gemini-2.5-pro-preview-05-06                    │
│ Sandbox                   sandbox-exec (minimal)                          │
│ OS                        darwin v23.11.0                                 │
│                                                                           │
╰───────────────────────────────────────────────────────────────────────────╯
```

Additionally, this change updates `.gitignore` to ignore the generated files, `scripts/clean.sh` to remove them, and adds a `npm run generate` stage for this and any other generators we need to write.
2025-05-28 00:04:26 -07:00
Taylor Mullen
7408c78dbb Change tool call spinner to be different.
- This differentiates the tool calling spinner from one that matches the normal loading indiator to somethign a little more seamless.
2025-05-25 16:05:22 -07:00
DeWitt Clinton
068b505d5e Reduce excessive diff separators in CLI. (#535)
Increases the threshold for rendering diff separators in the CLI's diff display. Previously, a separator was shown for gaps of more than one context line, leading to excessive separators in diffs with many small changes close together (Issue #534).

By increasing `MAX_CONTEXT_LINES_WITHOUT_GAP` to 5, we allow for more context lines before a separator is added, significantly reducing visual clutter in such diffs.

Added a test case to `DiffRenderer.test.tsx` to verify that separators are not rendered for small gaps within the new threshold.
2025-05-25 10:26:51 -07:00
Taylor Mullen
e297b56390 feat: Add GEMINI.md tip to UI
- Display a tip to create a GEMINI.md file if one doesn't exist.
- Pass config to Tips component so it can inspect the initial GEMINI.md
count.
2025-05-24 12:40:06 -07:00
Jacob Richman
b4c16d1f56 Code review comment fixes and some refactors. (#525)
No intentional different behavior aside for tweaks suggested from the code review of #506 Refactor: Extract console message logic to custom hook

This commit refactors the console message handling from App.tsx into a new custom hook useConsoleMessages.

This change improves the testability of the console message logic and declutters the main App component.

Created useConsoleMessages.ts to encapsulate console message state and update logic.
Updated App.tsx to utilize the new useConsoleMessages hook.
Added unit tests for useConsoleMessages.ts to ensure its functionality.
I deleted and started over on LoadingIndicator.test.tsx as I spent way too much time trying to fix it before just regenerating the tests as the code was easier to write tests for from scratch and the existing tests were not that good (I added them in the previous pull request).
2025-05-24 00:44:17 -07:00
Jacob Richman
1c3d9d7623 Make console message support more robust to logging in the middle of rendering. (#521) 2025-05-23 22:51:47 -07:00
DeWitt Clinton
7a3a9066f9 Add additional readline-like keybindings. (#524)
Adds the following conventional readline-like keybindings:

  - `Ctrl+H`: Delete the previous character.
  - `Ctrl+D`: Delete the next character.

Additionally, remaps the Debug Console command from Ctrl+D to Ctrl+O, which had been first introduced in PR #486.
2025-05-23 22:13:57 -07:00
Miguel Solorio
30080b9f4e 🧹 Format 2025-05-23 16:14:37 -07:00
Miguel Solorio
1af19c57de Remove CLI info from footer 2025-05-23 16:14:37 -07:00
Miguel Solorio
221370acc5 Add /about command 2025-05-23 16:14:37 -07:00
Jacob Richman
91ee02898a feat: Modify loading indicator to support a paused state (#506) 2025-05-23 10:25:17 -07:00
Jacob Richman
a96ff934ea Fix bug updating the cursor after navigating history. (#507) 2025-05-23 09:40:01 -07:00
Brandon Keiji
01971741e0 feat: add emphasis to tool confirmations (#502) 2025-05-23 05:28:31 +00:00
Jacob Richman
7eaf850489 Refactor: Improve console error/log display in CLI (#486) 2025-05-22 10:36:44 -07:00
Brandon Keiji
4e3ba687a6 fix: forward entire tool call confirmation object through useToolScheduler (#481) 2025-05-22 06:00:36 +00:00
Brandon Keiji
02eec5c8ca feat: useToolScheduler hook to manage parallel tool calls (#448) 2025-05-21 22:57:53 -07:00
Olcan
e30dc716b4 restore placeholder change likely dropped in a merge (#464) 2025-05-21 07:55:20 -07:00
Olcan
2080af029b remove outdated $ echo example from help (#463) 2025-05-21 07:52:49 -07:00
Taylor Mullen
7fd7c1a539 fix(cli): Handle VSCode Shift+Enter in text buffer
- The text buffer now correctly interprets `\\\r` (produced by Shift+Enter in the VSCode terminal) as a newline character.
- Added a corresponding test case to `text-buffer.test.ts`.

Fixes https://buganizer.corp.google.com/issues/418505364
2025-05-20 23:44:53 -07:00
Taylor Mullen
ba7f1e1e3c feat: Improve diff rendering with gap indicators
- Adds a visual indicator for skipped lines in the diff view.
- Updates tests to verify gap indicator rendering.
- Adjusts line number padding for better alignment.

Fixes https://b.corp.google.com/issues/414453107
2025-05-20 23:32:06 -07:00
Taylor Mullen
872f308536 feat: Allow Esc to exit shell mode
- Update InputPrompt.tsx to handle Esc key for exiting shell mode.
- Modify ShellModeIndicator.tsx to reflect the new keybinding.
Fixes https://buganizer.corp.google.com/issues/419087952
2025-05-20 22:47:11 -07:00
Jacob Richman
02ab0c234c Merge InputPrompt and multiline-editor and move autocomplete logic directly into InputPrompt (#453) 2025-05-20 16:50:32 -07:00
DeWitt Clinton
ee702c3139 Implement additional readline-like keybindings, including alt-left arrow and alt-right arrow. (#443)
This change adds keybinding support for:

  - `Ctrl+B`: Moves the cursor backward one character.
  - `Ctrl+F`: Moves the cursor forward one character.
  - `Alt+Left Arrow`: Moves the cursor backward one word.
  - `Alt+Right Arrow`: Moves the cursor forward one word.

Closes b/411469305.
2025-05-20 10:12:07 -07:00
Olcan
9c72a3ae12 ui tweaks (#442) 2025-05-19 16:58:57 -07:00
Olcan
750649eb64 indicate system prompt override on bottom right; require GEMINI_SYSTEM_MD to make it more explicit; allow custom paths for read/write (#427) 2025-05-19 11:03:04 -07:00
Taylor Mullen
db93ea736b feat(cli): Add ShellModeIndicator component
This commit introduces a new ShellModeIndicator component to visually signify when shell mode is active.

- Displays "shell mode enabled (! to toggle)" in the UI.
- The AutoAcceptIndicator is now hidden when shell mode is active to prevent UI clutter.
2025-05-18 22:18:49 -07:00
Taylor Mullen
e4d978da7c feat(cli): Introduce toggleable shell mode with enhanced UI
- Implements a toggleable shell mode, removing the need to prefix every command with `!`.
- Users can now enter and exit shell mode by typing `!` as the first character in an empty input prompt.
- The input prompt visually indicates active shell mode with a distinct color and `! ` prefix.
- Shell command history items (`user_shell`) are now visually differentiated from regular user messages.
- This provides a cleaner and more streamlined user experience for frequent shell interactions.

Fixes https://b.corp.google.com/issues/418509745
2025-05-18 01:25:50 -07:00
Taylor Mullen
aca27709df feat: Add auto-accept indicator and toggle
- This commit introduces a visual indicator in the CLI to show when auto-accept for tool confirmations is enabled. Users can now also toggle this setting on/off using Shift + Tab.
- This addresses user feedback for better visibility and control over the auto-accept feature, improving the overall user experience.
- This behavior is similar to Claude Code, providing a familiar experience for users transitioning from that environment.
- Added tests for the new auto indicator hook.

Fixes https://b.corp.google.com/issues/413740468
2025-05-17 22:27:22 -07:00
DeWitt Clinton
13a6a9a690 Introduce a small easter egg. Woof. (#412)
Also changes auto-completion and /help to skip over slash commands that don't contain a description to avoid spoiling the surprise.
2025-05-17 21:57:27 -07:00
Taylor Mullen
e486d84d6a feat: Patch console.debug and display only in debug mode
- Patches `console.debug` in `ConsolePatcher.tsx` to capture debug messages.
- Updates `ConsoleOutput` to only display debug messages when `debugMode` is enabled.
- Passes `debugMode` prop from `App.tsx` to `ConsoleOutput`.

Fixes https://github.com/google-gemini/gemini-cli/issues/397
2025-05-16 22:29:12 -07:00