Commit Graph

513 Commits

Author SHA1 Message Date
Bryan Morgan e95a6086fc
Bryanmorgan/add mcp description support (#825) 2025-06-07 18:30:56 -04:00
Tolik Malibroda dd08582f81
fix: Rename missing occurence of gemini-code (#824) 2025-06-08 00:12:53 +02:00
Jacob Richman ab44824e07
Auto insert @ when dragging and dropping files. (#812) 2025-06-07 14:48:56 -07:00
cperry-goog 18d6a11c04
refactor: rename gemini-code to gemini-cli (#822) 2025-06-07 14:27:22 -07:00
Tommaso Sciortino d6cf4d5b0b
Eliminate createServerConfig() (#821) 2025-06-07 13:49:00 -07:00
Tommaso Sciortino 10b52ac4e8
Fix missing arg warning in tests (#820) 2025-06-07 13:39:53 -07:00
Eddie Santos 27fdd1b6e6
Add embedder (#818) 2025-06-07 13:38:05 -07:00
Bryan Morgan 28ff62e7b1
Added /mcp command support and cleaned up broken tests (#817) 2025-06-07 15:06:18 -04:00
Tommaso Sciortino 6ea4479064
Push model-switching logging into loadCliConfig (#815) 2025-06-07 11:12:30 -07:00
Tommaso Sciortino 680f4cdd61
More version simplifiction. (#810) 2025-06-07 10:54:23 -07:00
Keith Ballinger 0c86874677
Add batch editing capabilities to Edit Tool (#648)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-06-06 22:54:37 -07:00
Tommaso Sciortino 76ec9122c0
clean up version lookup code (#804) 2025-06-06 16:21:20 -07:00
cperry-goog e94a10023d
adding very important phrases (#802) 2025-06-06 14:49:40 -07:00
Jacob Richman 2f54aa888a
feat(ui): add cursor to empty input prompt (#800) 2025-06-06 13:44:11 -07:00
Jacob Richman 89aca349cf
Exit with an error message if parsing settings.json fails. (#747) 2025-06-06 09:56:45 -07:00
jerop b4a6b16227 Test: Verify concatenated env var resolution in settings
Adds a test case to `settings.test.ts` to specifically verify
the correct resolution of multiple environment variables concatenated
within a single string value (e.g., ${HOST}:${PORT} ).
2025-06-06 11:47:37 -04:00
jerop 8c28250bb3 Refactor: Improve env var resolution in settings
Refactors the `resolveEnvVarsInObject` function in settings to
explicitly handle primitive types (null, undefined, boolean, number)
at the beginning of the function. This clarifies the logic for
subsequent string, array, and object processing.
2025-06-06 11:47:37 -04:00
jerop 4e9d365407 feat: Enable environment variable substitution in settings
This commit introduces the ability to use system environment variables
within the settings files (e.g., `settings.json`). Users can now
reference environment variables using the `${VAR_NAME}` syntax.

This enhancement improves security and flexibility, particularly
for configurations like MCP server settings, which often require
sensitive tokens.

Previously, to configure an MCP server, a token might be directly
embedded:
```json
"mcpServers": {
  "github": {
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "pat_abc123"
    }
    // ...
  }
}
```

With this change, the same configuration can securely reference an
environment variable:
```json
"mcpServers": {
  "github": {
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
    }
    // ...
  }
}
```

This allows users to avoid storing secrets directly in configuration files.
2025-06-06 11:47:37 -04:00
Jacob Richman 9ad615c2a4
Fix build break due to changes to theme. (#796) 2025-06-06 08:05:00 -07:00
Jacob Richman 4262f5b0de
feat(cli): respect the NO_COLOR env variable (#772) 2025-06-06 07:55:28 -07:00
DeWitt Clinton c80ff146d2
Reduce noisy logging for missing .geminiignore file. (#793) 2025-06-06 07:47:43 -07:00
matt korwel 2f51c22141
Title & Big text Updates (#781) 2025-06-05 18:14:02 -07:00
Miguel Solorio 8a0a2523ca
Allow themes to theme the UI (#769) 2025-06-05 14:35:47 -07:00
Brandon Keiji 2285bba66e
refactor: remove unnecessary useRefs (#780) 2025-06-05 21:33:24 +00:00
Olcan d3a1026ae3
skip npm build for custom sandbox (#779) 2025-06-05 14:15:43 -07:00
Jerop Kipruto 2ebf2fbc82
OpenTelemetry Integration & Telemetry Control Flag (#762) 2025-06-05 13:04:25 -07:00
Olcan d3e43437a0
use execSync (vs spawnSync) so launch fails if build_sandbox fails; tweaks in build_sandbox to fix some shellcheck warnings, and to simplify the logic slightly (#767) 2025-06-05 13:02:56 -07:00
Eddie Santos e02868bb1a
Bump default model to `gemini-2.5-pro-preview-06-05` (#765) 2025-06-05 11:52:36 -07:00
Eddie Santos 422c763a55
Add support for `.geminiignore` file (#757) 2025-06-05 10:15:27 -07:00
Tolik Malibroda 1d20cedf03
fix: Disable automatic image building if BUILD_SANDBOX is not provided (#764) 2025-06-05 18:47:39 +02:00
Tolik Malibroda 4d4cf0f2f9
feat: Add multi-stage docker build support for custom sandbox.Dockerfile (#746) 2025-06-05 17:46:54 +02:00
Jacob Richman aa386d135b
Jacob314/memory fixes (#754)
Address multiple possible memory leaks found bystatic analysis of the codebase. The primary source of the leaks was event listeners on child processes and global objects that were not being properly removed, potentially causing their closures to be retained in memory indefinitely particularly for processes that did not exit.

There are two commits. A larger one made by gemini CLI and a smaller one by me to make sure we always disconnect child processes as part of the cleanup methods. These changes may not actually fix any leaks but do look like reasonable defensive coding to avoid leaking event listeners or child processes.

The following files were fixed:
This is Gemini's somewhat overconfident description of what it did.

packages/core/src/tools/shell.ts: Fixed a leak where an abortSignal listener was not being reliably removed.
packages/cli/src/utils/readStdin.ts: Fixed a significant leak where listeners on process.stdin were never removed.
packages/cli/src/utils/sandbox.ts: Fixed leaks in the imageExists and pullImage helper functions where listeners on spawned child processes were not being removed.
packages/core/src/tools/grep.ts: Fixed three separate leaks in the isCommandAvailable check and the git grep and system grep strategies due to un-removed listeners on child processes.
packages/core/src/tools/tool-registry.ts: Corrected a leak in the execute method of the DiscoveredTool class where listeners on the spawned tool process were not being removed.
2025-06-05 06:40:33 -07:00
N. Taylor Mullen 822803d9d6
Fix "npx https:...." header issue (#759) 2025-06-05 07:00:34 +00:00
N. Taylor Mullen 77afd37c2e
fix(cli): Handle non-array tool response parts (#758) 2025-06-05 06:25:57 +00:00
Eddie Santos d99d132cdf
Add `/tools` slash command to view available tools (#752) 2025-06-04 14:01:38 -07:00
Tommaso Sciortino 4192cfb092
CLI_TITLE env var for setting the CLI title (#748) 2025-06-04 10:44:50 -07:00
Miguel Solorio a2f03636a5
Update light themes (#726) 2025-06-04 10:41:03 -07:00
N. Taylor Mullen 44aff769a3
Bring back 2.5-pro usage (#744)
https://chat.google.com/room/AAQApBm33UQ/8DQw4Ykp8f0/8DQw4Ykp8f0?cls=10
2025-06-04 09:29:14 -07:00
N. Taylor Mullen afc30e314f
feat(accessibility): Add option to disable loading phrases (#745) 2025-06-04 07:46:57 +00:00
N. Taylor Mullen d179b3aae4
refactor(core): Centralize tool response formatting (#743) 2025-06-04 07:24:25 +00:00
Tolik Malibroda 4b2af10b04
fix: Fix piped input mode in sandbox (#739) 2025-06-04 08:24:33 +02: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
Olcan 12059eb4ca
fix BUILD_SANDBOX env var for updating sandbox while running linked binary (#729) 2025-06-03 14:02:00 -07:00
Olcan 9df94103ac
remove noop code (#728) 2025-06-03 13:47:53 -07:00
Olcan 00a9f654a3
fixed strip-ansi dep by installing it in core package (also ran npm install in cli package that resulted in the minor changes here) (#727) 2025-06-03 13:37:59 -07:00
Brandon Keiji e96fd677ee
fix: do not try to pull development sandbox image from the internet (#725) 2025-06-03 19:32:17 +00:00
Brandon Keiji 546e033081
feat: notify user when chat context is compressed (#724) 2025-06-03 19:19:49 +00:00
N. Taylor Mullen 080af01715
Fix flash preview (#723) 2025-06-03 18:01:59 +00:00
N. Taylor Mullen c5099e9025
Workaround Gemini API break - Use flash 04-17 (#721) 2025-06-03 17:47:20 +00:00
Allen Hutchison 72f5ec3725
feat(cli): randomize and expand witty loading phrases (#704) 2025-06-03 10:12:47 -07:00
N. Taylor Mullen 8ab74ef1bb
Refactor: Use config.getGeminiClient() for GeminiClient instantiation (#715) 2025-06-03 05:30:52 +00:00
N. Taylor Mullen cf3e1a07c1
Remove redundant variable. (#713) 2025-06-02 21:18:01 -07:00
Brandon Keiji 74801e9004
refactor: maintain 1 GeminiChat per GeminiClient (#710) 2025-06-02 19:10:54 -07:00
Jacob Richman 447826ab40
fix(cli): restore first-launch theme prompt (#703) 2025-06-02 19:09:11 -07:00
Scott Densmore 2ab7e3da71
feat(cli): Allow custom title in CLI header (#706) 2025-06-02 17:09:55 -07:00
N. Taylor Mullen 6020c760b5
Feat: Enable YOLO mode for non-interactive execution (#702) 2025-06-02 22:35:03 +00:00
Olcan 1dcf0a4cbd
strip ansi from shell output (#699) 2025-06-02 14:50:12 -07:00
Jacob Richman 51949f3121
Fix bug pasting multiline strings (#632) 2025-06-02 14:31:35 -07:00
Allen Hutchison 7f20425c98
feat(cli): add pro model availability check and fallback to flash (#608) 2025-06-02 13:55:54 -07:00
N. Taylor Mullen 58597c29d3
refactor: Update MCP tool discovery to use @google/genai - Also fixes JSON schema issues. (#682) 2025-06-02 20:39:25 +00: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
Olcan c5869db080
enable async tool discovery by making the registry accessor async; remove call to discoverTools that caused duplicate discovery (#691) 2025-06-02 09:56:32 -07:00
N. Taylor Mullen 34b81abd9c
fix: Ensure all tool calls are complete before submitting responses (#689) 2025-06-02 08:50:28 +00:00
Olcan d009267801
more strict italics: delimiters cannot be preceded/followed by \w or [./\\]\S (#677) 2025-06-01 16:52:31 -07:00
N. Taylor Mullen 2828fc6d66
feat: Implement non-interactive mode for CLI (#675) 2025-06-01 23:11:37 +00:00
N. Taylor Mullen c51d6cc9d3
fix: Display MCP server count in context summary (#674) 2025-06-01 22:48:48 +00:00
N. Taylor Mullen f2a8d39f42
refactor: Centralize tool scheduling logic and simplify React hook (#670) 2025-06-01 14:16:24 -07:00
Scott Densmore c414512f19
Fix: Make file path case-insensitive in @-command (#659) 2025-05-31 16:19:14 -07:00
Allen Hutchison 53bf778497
feat: allow custom filename for context files (#654)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-05-31 12:49:28 -07:00
Miguel Solorio cbc1614b84
Update default & ANSI theme names (#637) 2025-05-31 11:10:52 -07:00
Taylor Mullen 1a84d8f674 Test: Add comprehensive tests for useToolScheduler hook
- Introduces a suite of tests for the  hook, covering various scenarios including:
  - Successful tool execution
  - Tool not found errors
  - Errors during
  - Errors during tool execution
  - Tool confirmation (approved and cancelled) - (currently skipped)
  - Live output updates - (currently skipped)
  - Cancellation of tool calls (before execution and during approval) - (currently skipped)
  - Execution of multiple tool calls
  - Preventing scheduling while other calls are running - (currently skipped)
- Includes tests for the  utility function to ensure correct mapping of tool call states to display objects.
- Mocks dependencies like , , and individual  instances.
- Uses fake timers to control asynchronous operations.

Note: Some tests involving complex asynchronous interactions (confirmations, live output, cancellations) are currently skipped due to challenges in reliably testing these scenarios with the current setup. These will be addressed in future work.
2025-05-31 02:55:36 -07:00
Scott Densmore bda7ec94df
Fix: Update git branch watcher to use .git/logs/HEAD (#643) 2025-05-30 21:08:56 -07:00
Daniel Young Lee 1468047081 feat: Implement delayed Ctrl+C exit prompt
This change introduces a small delay after the first Ctrl+C press, prompting the user to press Ctrl+C again to exit. This helps prevent accidental termination of the application.

- Added `exitOnCtrlC={false}` to the Ink render options in `gemini.tsx` to enable custom Ctrl+C handling.
- Implemented logic in `App.tsx` to:
    - Display "Press Ctrl+C again to exit." for 2 seconds after the first Ctrl+C.
    - Exit the application if Ctrl+C is pressed again during this period.
    - Revert to normal operation if the second Ctrl+C is not pressed within the timeout.
- Defined a constant `CTRL_C_PROMPT_DURATION_MS` for the timeout duration.
2025-05-30 20:51:07 -07:00
Scott Densmore 7012c86336
Fix/cli version unknown (#642) 2025-05-30 20:45:15 -07: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 1a5fd2ccb2
add flags for markdown rendering and live updating to Tool to avoid special-casing shell tool by name, and open door for other tools to specify their rendering/updating (#629) 2025-05-30 13:59:05 -07:00
Brandon Keiji 0869fd168f
fix(sandbox): pull sandbox image if it doesnt exist locally (#628) 2025-05-30 20:49:47 +00:00
Brandon Keiji cf82b6e127
fix(sandbox): prepare package.json before building sandbox image (#626) 2025-05-30 19:57:46 +00:00
Olcan a0ba65944f
disable markdown rendering of shell tool output (#625) 2025-05-30 12:43:59 -07:00
Brandon Keiji 31a7affb74
feat(sandbox): use package config to dictate sandbox image name (#624) 2025-05-30 19:28:46 +00: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
Olcan a3b557222a
tweaks to shell abort logic based on feedback (#618) 2025-05-30 01:35:03 -07:00
Olcan 8935a248f6
allow aborting of shell mode (!) commands, similar to shell tool commands. fix bug that prevented aborts after first abort. more robust killing logic (#616) 2025-05-30 00:46:43 -07:00
Olcan b0aeeb53b1
update shell output at an interval to reduce flicker (#614) 2025-05-30 00:02:30 -07:00
Jacob Richman dab7517622
Refactor read-file and support images. (#480) 2025-05-29 15:30:18 -07:00
Olcan 4b7248fc46
allow writing to user cache directory on macos (fixes use of lyria mcp server [to generate songs] under seatbelt) (#600) 2025-05-29 15:06:09 -07:00
Brandon Keiji dc94a03f39
feat: publish root Dockerfile to our image registry (#599) 2025-05-29 14:01:44 -07:00
Jacob Richman 6a1b94529b
Change Config to use named parameters. (#593) 2025-05-29 13:51:17 -07:00
Allen Hutchison 9ee5eadac0
fix(cli): Support multiple @file references in atCommandProcessor (#590) 2025-05-28 17:08:05 -07:00
Brandon Keiji fd6f6b02ea
feat: add git branch name to footer (#589) 2025-05-28 16:30:05 -07:00
Olcan 0d99398689
much improved support for background processes, avoiding termination (via SIGPIPE) or eventual blocking (e.g. due to filled OS buffers) (#586) 2025-05-28 14:45:46 -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 f2f2ecf9d8 feat: Allow cancellation of in-progress Gemini requests and pre-execution checks
- Implements cancellation for Gemini requests while they are actively being processed by the model.
- Extends cancellation support to the  logic within tools. This allows users to cancel operations during the phase where the system is determining if a tool execution requires user confirmation, which can include potentially long-running pre-flight checks or LLM-based corrections.
- Underlying LLM calls for edit corrections (within  and ) and next speaker checks can now also be cancelled.
- Previously, cancellation of the main request was not possible until text started streaming, and pre-execution checks were not cancellable.
- This change leverages the updated SDK's ability to accept an abort token and threads s throughout the request, tool execution, and pre-execution check lifecycle.

Fixes https://github.com/google-gemini/gemini-cli/issues/531
2025-05-27 23:46:37 -07:00
Olcan bfeaac8441
live output from shell tool (#573) 2025-05-27 15:40:18 -07:00
Olcan 0d5f7686d7
fix tool cancellation while executing (#575) 2025-05-27 15:22:30 -07:00
Brandon Keiji c1395a8808
fix: change entrypoint from 'gemini-code' to 'gemini' in published sandbox (#574) 2025-05-27 22:19:43 +00:00
Brandon Keiji d4ae1ede39
refactor: use React strict mode (#569) 2025-05-27 14:40:46 -07:00
Allen Hutchison 4e3c539f5e
feat: Publish test coverage summaries to PRs (#513) 2025-05-27 12:45:28 -07:00
sasha-gitg 3511e84dc3
fix: default to Gemini API if GEMINI_API_KEY is set and when GOOGLE_GENAI_USE_VERTEXAI is set to True (#566) 2025-05-27 10:00:07 -07:00
Taylor Mullen 480549e02e Refactor(chat): Introduce custom Chat class for future modifications
- Copied the `Chat` class from `@google/genai` into `packages/server/src/core/geminiChat.ts`.
- This change is in preparation for future modifications to the chat handling logic.
- Updated relevant files to use the new `GeminiChat` class.

Part of https://github.com/google-gemini/gemini-cli/issues/551
2025-05-26 14:20:28 -07:00
Taylor Mullen 8440b971f5 Fix(cli): Prevent premature input box reactivation during tool confirmation
- Introduced a 'validating' state for tool calls to prevent the input box from reappearing while waiting for a tool's `shouldConfirmExecute` method to complete.
- When a tool call is initiated, it's now immediately set to a 'validating' status. This ensures the UI remains in a busy/responding state.
- `useGeminiStream` now considers the 'validating' state as part of `StreamingState.Responding`.
- `useToolScheduler` has been updated to:
    - Set the initial status of new tool calls to 'validating'.
    - Asynchronously perform the `shouldConfirmExecute` check.
    - Transition to 'awaiting_approval' or 'scheduled' based on the check's outcome.
- This resolves an issue where a slow `shouldConfirmExecute` could lead to the input prompt becoming active again before the tool call lifecycle was fully determined. While 'validating' is currently treated similarly to 'executing' in the UI, this new state provides a foundation for more customized user experiences during this phase in the future.

Fixes https://github.com/google-gemini/gemini-cli/issues/527
2025-05-25 16:06:33 -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 2a2d041dcd Update packages/cli/src/ui/types.ts
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-05-23 16:14:37 -07:00
Miguel Solorio 6247cb8ddd Update packages/cli/src/ui/hooks/slashCommandProcessor.ts
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
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
Allen Hutchison a008d81780
Refactor(server): Centralize GEMINI.md discovery logic in server (#498) 2025-05-23 08:53:22 -07:00
Allen Hutchison f8c4276e69
Refactor(cli): Move memory add logic to server tool call (#493) 2025-05-23 08:47:19 -07:00
Olcan 70277591c4
update email to gemini-cli-dev (#510) 2025-05-23 08:35:16 -07:00
Olcan 564a213ebe
allow write to ~/.gitconfig in seatbelt profiles (#509) 2025-05-23 07:56:43 -07:00
Taylor Mullen 7c3591f641 Refactor: Update streaming state logic to hide loader during confirmation
- The streaming state logic in `useGeminiStream.ts` has been updated.
- Previously, the loading indicator was displayed even when the system was
waiting for user confirmation on a tool call.
- This change introduces a `WaitingForConfirmation` state to ensure the
loading indicator is hidden during these confirmation prompts, improving
the user experience.
2025-05-23 00:39:05 -07:00
Brandon Keiji 01971741e0
feat: add emphasis to tool confirmations (#502) 2025-05-23 05:28:31 +00:00
Allen Hutchison 581709df80
Refactor: Streamline memoryUtils and update slash commands (#478) 2025-05-22 10:57:06 -07:00
Allen Hutchison 0c192555bb
Fix: Prevent hang in large directories by using BFS for getFolderStru… (#470)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-05-22 10:47:21 -07:00
Jacob Richman 7eaf850489
Refactor: Improve console error/log display in CLI (#486) 2025-05-22 10:36:44 -07:00
Brandon Keiji fb1d13d600
fix: cancel parallel tool calls mid-execution (#489) 2025-05-22 03:02:45 -07:00
Brandon Keiji a8bfdf2d56
fix: synchronization between executed tools and turn loops (#488) 2025-05-22 02:51:07 -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
Allen Hutchison efee7c6cce
Feat: Add test coverage scripts and ignore reports (#477) 2025-05-21 17:03:22 -07:00
Allen Hutchison a0761f0c41
Fix: Resolve CLI version reporting in /bug command (#455) 2025-05-21 13:31:18 -07:00
Olcan 00ab1905e0
use pending history item for shell mode, update as output is received (#471) 2025-05-21 13:16:50 -07:00
Olcan 01dbc61d1c
space outputs in shell mode (#469) 2025-05-21 12:59:23 -07:00
DeWitt Clinton 01c28df8b2
Add globbing support to @-command file suggestions and resolution. (#462)
Implements recursive glob-based file search for both suggestions and execution of the `@` command.

- When typing `@filename`, suggestions will now include files matching `filename` in nested directories.
- Suggestions are sorted by path depth (shallowest first), then directories before files, then alphabetically.
- The maximum recursion depth for suggestions is set to 10.
- When executing an `@filename` command, if the file is not found directly, a recursive search (using the glob tool) is performed to locate the file.

This addresses the first request in issue #461 by allowing users to quickly reference deeply nested files without typing the full path. Also addresses b/416292478.
2025-05-21 12:22:18 -07:00
Brandon Keiji e1a64b41e8
feat: create tool scheduler hook (#468) 2025-05-21 10:35:40 -07:00
Olcan 2ad666a484
switch to spawn for shell mode (#467) 2025-05-21 09:31:13 -07:00
Olcan 8a70b98d1d
fix exit code for shell mode also (#466) 2025-05-21 09:00:54 -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
Seth Troisi cd13c5881b
Add Logger for command history (#435) 2025-05-21 00:36:22 -07:00
Taylor Mullen bda472f147 fix(cli): Prevent request cancellation after multiple Esc presses
- Ensures `abortControllerRef` is reset after a request is aborted or completed.
- Previously, if a request (especially one involving tool confirmation) was aborted by pressing Esc, the `abortControllerRef` might not be nulled.
- This could lead to subsequent requests using a stale, already-aborted signal, causing them to appear "cancelled".
- The fix unconditionally sets `abortControllerRef.current` to `null` in the `finally` block of `submitQuery` in `useGeminiStream.ts`.
- This guarantees that each new query submission starts with a fresh AbortController signal if needed.
- Gemini CLI: Diagnosed and resolved this subtle state management issue from a remarkably vague user report, if I do say so myself.

Fixes https://buganizer.corp.google.com/issues/418496499
2025-05-20 23:58:53 -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