Commit Graph

319 Commits

Author SHA1 Message Date
Pascal Birchler
c8cf954e6e
fix(auth): do not blindly default to API key auth (#3235)
Co-authored-by: matt korwel <matt.korwel@gmail.com>
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-07-08 22:10:36 +00:00
Ayesha Shafique
23e3c7d6ec
style: Format execution time as minutes, seconds (#2707) 2025-07-08 06:14:42 +00:00
Tommaso Sciortino
4e84989d8f
Fix double "esc" bug in Auth dialog (#3493) 2025-07-07 23:27:24 +00:00
Marat Boshernitsan
48c2aa296a
Enable Gemini CLI to reuse user's auth in Cloud Shell (#3070) 2025-07-07 22:02:13 +00:00
Abhi
aa10ccba71
feature(commands) - Refactor Slash Command + Vision For the Future (#3175) 2025-07-07 20:45:44 +00:00
Sambhav Khanna
97a472f2fb
fix(cli): Prevent Tab from auto-executing incomplete slash commands (#2919)
Co-authored-by: matt korwel <matt.korwel@gmail.com>
2025-07-07 19:43:27 +00:00
Devansh Sharma
39d4095a4c
feat: YOLO mode shorctut displayed inside /help (#3367) 2025-07-06 15:48:29 +00:00
Daniel Sibaja
2b8a565f89
Fix #2922: Prevent @ concatenation to valid paths in shellmode. (#2932) 2025-07-05 22:20:12 +00:00
Didier Durand
ab96676e36
fix typos in diverse files (#3284)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-07-05 15:23:39 +00:00
Sandy Tao
32db5ba0e1
Refactor text-buffer to use reducer (#2652) 2025-07-04 00:53:17 +00:00
Abhi
edd69cb7d4
help: add shift+tab tip (#2892) 2025-07-02 03:18:01 +00:00
Billy Biggs
3a995305c0
Fix characters being dropped in text-buffer (#2504)
Co-authored-by: Sandy Tao <sandytao520@icloud.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2025-07-01 23:07:41 +00:00
Seth Troisi
383306e17e
Improve slashCommand autoCompletion logic (#2776) 2025-07-01 22:51:43 +00:00
Jacob Richman
2bf8e8b2c7
Fix spurious logs about invalid MaxSizedBox children due to Ink6 + React19 migration (#2794) 2025-07-01 15:54:27 +00:00
Abhi
f91927569c
refactor(ui): revamp exit stats display (#2771) 2025-07-01 00:28:49 +00:00
Tommaso Sciortino
3587054d32
Rename AuthType LOGIN_WITH_GOOGLE_PERSONAL -> LOGIN_WITH_GOOGLE (#2769) 2025-07-01 00:11:54 +00:00
Tommaso Sciortino
dbd626054f
Remove unused method (#2721) 2025-06-30 22:53:05 +00:00
Abhi
770f862832
feat: Change /stats to include more detailed breakdowns (#2615) 2025-06-30 00:44:33 +00:00
Faizan Alam
1732e90d52
Highlight previous user input (#2507)
Co-authored-by: Allen Hutchison <adh@google.com>
2025-06-29 23:28:56 +00:00
Devansh
2096f971cd
fix:Update /help to show correct newline key combo for different OS #… (#2043)
Co-authored-by: Allen Hutchison <adh@google.com>
2025-06-29 23:16:14 +00:00
SADIK KUZU
2e20effb43
Fix typos (#1629)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
2025-06-28 01:29:59 +00:00
Sandy Tao
150df382f8
Upgrade to Ink 6 and React 19 (#2096)
Co-authored-by: jacob314 <jacob314@gmail.com>
2025-06-27 23:39:54 +00:00
Philipp Schmid
ac24fd27e4
Update Auth Label to include AI Studio (#2130)
Co-authored-by: Allen Hutchison <adh@google.com>
2025-06-27 21:33:26 +00:00
Billy Biggs
4fbffdf617
Handle stdin for prompts using readline for escape character parsing (#1972) 2025-06-27 17:57:32 +00:00
Preston Holmes
3aabb940f5
Add the current auth method and GCP Project config to the about message (#2112) 2025-06-27 15:46:27 +00:00
Noritaka Kobayashi
dbe217828d
chore: fix typos in comment-out (#1540)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-06-26 04:34:53 +00:00
anj-s
1078a546fe
Fix doc link in the auth dialog (#1688) 2025-06-26 01:59:13 +00:00
Tommaso Sciortino
79c647d486
Merge "Login with Google Workspace" auth option into "Login with Google" (#1574)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-06-25 22:38:18 +00:00
anj-s
4b5ca6bc77
Add tos and privacy links docs for clarity (#1571) 2025-06-25 19:32:25 +00:00
Marat Boshernitsan
9897a2b80a
Clarify why authentication failures might be happening and direct users to documentation (#1478)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
Co-authored-by: matt korwel <matt.korwel@gmail.com>
2025-06-25 16:11:54 +00:00
Brandon Keiji
f6c36f75e3
fix: prepublish changes to package names (#1420) 2025-06-25 12:41:11 +00:00
Daniel Tedesco
268d29f05c
docs: fix typos in documentation (#1411)
Co-authored-by: Dan Tedesco <dted@google.com>
2025-06-25 03:53:03 +00:00
Jacob Richman
8bd5645dd4
Truncate all strings before displaying in a tool messages to avoid stack overflows (#1395) 2025-06-24 22:31:55 +00:00
Jacob Richman
5ff00b0c5d
Remove uses of the spread operator that appear to have caused a maximum call stack size exceeded error (#1389) 2025-06-24 21:38:25 +00:00
Sandy Tao
a411c415a8
Do not render mcp responses as markdown (#1388) 2025-06-24 14:10:41 -07:00
Tommaso Sciortino
0abd2a644e
Improve Auth error messaging (#1358) 2025-06-24 01:37:41 +00:00
Jacob Richman
f741630572
Polish Theme Dialog (#1356) 2025-06-23 16:43:17 -07:00
Bryan Morgan
e423d20a8d
Updated docs and /stats command to support lack of token caching support for OAuth users (b/426943001) (#1307) 2025-06-23 21:55:24 +00:00
Jacob Richman
1faf53a3af
Remove fallback to render normall rather than using custom MaxSizedBox layout logic (#1340) 2025-06-23 21:41:45 +00:00
Scott Densmore
99d521569d
Scotdensmore/first run auth fix (#1322) 2025-06-22 22:52:25 -07:00
matt korwel
da128e725d
{bug} Vertex Auth Support (#1302)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
2025-06-23 00:30:58 +00:00
cperry-goog
b05b8673cd
update tips (#1315) 2025-06-22 16:02:48 -07:00
N. Taylor Mullen
3c656cfbc6
feat: Only show ctrl-s when idle (#1299) 2025-06-22 15:57:53 +00:00
N. Taylor Mullen
cb76b08e31
feat: Add /docs command and update UI (#1297) 2025-06-22 15:54:10 +00:00
Jacob Richman
63f6a497cb
Jacob314/overflow notification and one MaxSizedBox bug fix (#1288) 2025-06-22 00:54:10 +00:00
cperry-goog
e255eb6124
feat(cli): update Tips.tsx component (#1284) 2025-06-21 12:58:00 -07:00
Billy Biggs
99a6dc0267
Update memory and context summary UI for multiple context filenames (#1282) 2025-06-21 19:15:43 +00:00
matt korwel
3283f55e7e
Auth timeout (#1263) 2025-06-20 18:33:31 +00:00
matt korwel
7c8a1da8fe
Auth blocking (#1261) 2025-06-20 10:46:41 -07:00
Jacob Richman
05b1c8101f
Turn off debug logging of MaxSizedBox errors by default. (#1228) 2025-06-20 05:27:03 +00:00
Tommaso Sciortino
0c9b138f5e
Reword auth dialog options (#1246) 2025-06-20 02:41:19 +00:00
Tommaso Sciortino
2f1fc3f359
Initially hide some Auth options behind "More..." (#1245) 2025-06-19 19:28:56 -07:00
matt korwel
04518b52c0
Auth First Run (#1207)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-06-19 16:52:22 -07:00
Jacob Richman
b0bc7c3d99
Fix flicker issues by ensuring all actively changing content fits in the viewport (#1217) 2025-06-19 13:17:23 -07:00
Abhi
f3c1cbbabf
feat: shell history (#1169) 2025-06-17 22:17:16 -04:00
Billy Biggs
708ba8902a
Support escaping carriage returns with \ (#1127) 2025-06-17 10:03:05 -07:00
Jacob MacDonald
e59c872b3d
code review followup for compress command (#1097)
Followup to https://github.com/google-gemini/gemini-cli/pull/986
2025-06-17 15:44:54 +00:00
Eddie Santos
c3971754bf
Auto-update notifications (#1110) 2025-06-17 15:24:07 +00:00
Miguel Solorio
137baa0a07
Update /help page (#1119) 2025-06-16 20:13:33 -07:00
Jacob Richman
a7e45d47cd
Fix bug where single line inserts were deleting all text after the in… (#1114) 2025-06-16 15:21:22 -07:00
Jacob Richman
5d4f4f421c
feat: text-buffer: input sanitization and delete character handling. (#1031) 2025-06-16 06:25:11 +00:00
N. Taylor Mullen
742caa5dd8
feat(cli): Standardize keyboard shortcut hints (#1092) 2025-06-16 06:21:58 +00:00
Billy Biggs
b67806ae9a
Support completion of checkpoint names in /resume (#1063) 2025-06-15 11:40:39 -07:00
Asad Memon
123ad20e9b
feat: Show model thoughts while loading (#992) 2025-06-15 18:19:05 +00:00
Asad Memon
b3d89a1075
feat: Add token stats in footer (#909) 2025-06-15 11:15:53 -07:00
Leo
e544b940f1
bug: Fix code colorizer (#1046) 2025-06-14 21:27:53 +01:00
Jacob MacDonald
d5c6bb9740
Add /compress command to force a compression of the context (#986)
Related to https://b.corp.google.com/issues/423605555 - I figured this might be a simpler solution to start with, while still also being useful on its own even if we do implement that.
2025-06-14 04:21:40 +00:00
Allen Hutchison
31b28ade01
Improvements to web-fetch tool (#1030) 2025-06-13 17:44:14 -07:00
Daniel Lee
daceb9963f
feat(cli): support ctrl+d to exit (#878)
Similar to ctrl+c, ctrl+d can now be used to exit the program. To avoid accidental exit, ctrl+d must be pressed twice in relatively quick succession (same as ctrl+c).

Following common UX pattern, ctrl+d will be ignored when the input prompt is non-empty. This behavior is similar to how most shell (bash/zsh) behaves. To support this, I had to refactor so that text buffer is initialized outside of the InputPrompt component and instead do it on the main App component to allow input controller to have access to check the content of the text buffer.
2025-06-13 16:59:09 +00:00
Billy Biggs
2a1ad1f5d9
Update contextFileName to support an optional list of strings (#1001) 2025-06-13 09:19:08 -07:00
Miguel Solorio
f8a31f29aa
Replace logo with custom ASCII (#958) 2025-06-13 07:59:45 +00:00
Abhi
32da693b91
bug: only show tool tokens if > 0 (#985) 2025-06-12 19:31:17 +00:00
Leo
ad2e47dc20
remove enable editor flag (#984) 2025-06-12 17:28:20 +00:00
Leo
1ef68e0612
feat: External editor settings (#882) 2025-06-11 18:21:54 -07:00
Abhi
7a72d255d8
feat: Add exit UI w/ stats (#924) 2025-06-11 16:40:31 -04:00
Anas Sulaiman
9d992b32e4 add a unit test with multiple hunks for diff renderer 2025-06-11 09:47:11 -04:00
Olcan
3372fd8df8
rename sandbox-exec as MacOS Seatbelt in footer (#921) 2025-06-10 18:35:00 -07:00
Abhi
9c3f34890f
feat: Add UI for /stats slash command (#883) 2025-06-10 15:59:52 -04:00
Eddie Santos
6484dc9008
Add Windsurf in edit tool to modify changes, if installed (#853) 2025-06-09 16:01:06 -07:00
matt korwel
3b943c1582
Windows: Refactor Shell Scripts to Node.js for Cross-Platform Compatibility (#784) 2025-06-09 12:19:42 -07:00
Olcan
a3d11e8fef
replace reference to "README" with "docs" to avoid confusion for folks who do not have access to README (#866) 2025-06-08 19:19:33 -07:00
Olcan
d061419452
enforce minimum lines shown/hidden (#860) 2025-06-08 17:11:16 -07:00
Bryan Morgan
31c14ea78f
Bryanmorgan/add mcp description support (#855) 2025-06-08 18:45:36 -04:00
Leo
9efca40dae
feat: Add flow to allow modifying edits during edit tool call (#808) 2025-06-08 10:56:58 -07:00
N. Taylor Mullen
d0b78225a1
feat: update ctrl+t text (#845) 2025-06-08 07:16:08 +00:00
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
76ec9122c0
clean up version lookup code (#804) 2025-06-06 16:21:20 -07:00
Jacob Richman
2f54aa888a
feat(ui): add cursor to empty input prompt (#800) 2025-06-06 13:44:11 -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
N. Taylor Mullen
822803d9d6
Fix "npx https:...." header issue (#759) 2025-06-05 07:00:34 +00:00
Miguel Solorio
a2f03636a5
Update light themes (#726) 2025-06-04 10:41:03 -07:00
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
Jacob Richman
8b959c2060
strip escape characters when pasting. (#386) 2025-05-16 13:17:48 -07:00
Jacob Richman
c692a0c583
Support auto wrapping of in the multiline editor. (#383) 2025-05-16 11:58:37 -07:00
Taylor Mullen
968e09f0b5 fix: Ensure filename is available for diff rendering in write-file
This commit resolves a bug where the `write-file` operation could fail to render content due to a missing filename.

The fix involves:
- Ensuring `fileName` is consistently passed to `DiffRenderer.tsx` through `ToolConfirmationMessage.tsx`, `ToolMessage.tsx`, and `useGeminiStream.ts`.
- Modifying `edit.ts` and `write-file.ts` to include `fileName` in the `FileDiff` object.
- Expanding the `FileDiff` interface in `tools.ts` to include `fileName`.

Additionally, this commit enhances the diff rendering by:
- Adding syntax highlighting based on file extension in `DiffRenderer.tsx`.
- Adding more language mappings to `getLanguageFromExtension` in `DiffRenderer.tsx`.
- Added lots of tests for all the above.

Fixes https://b.corp.google.com/issues/418125982
2025-05-16 10:13:13 -07:00
Taylor Mullen
9c46acc793 Refactor: Improve UI rendering and address code review comments
This commit addresses several code review comments primarily focused on improving the rendering and stability of the CLI UI.

Key changes include:
- Passing `isPending` and `availableTerminalHeight` props to `MarkdownDisplay` to enable more intelligent rendering of content, especially for pending messages and code blocks.
- Adjusting height calculations in `ToolGroupMessage` and `ToolMessage` to more accurately reflect available space.
- Refining the logic in `App.tsx` for measuring and utilizing terminal height, including renaming `footerRef` to `mainControlsRef` for clarity.
- Ensuring consistent prop drilling for `isPending` and `availableTerminalHeight` through `HistoryItemDisplay`, `GeminiMessage`, and `GeminiMessageContent`.
- In `MarkdownDisplay`, when `isPending` is true and content exceeds `availableTerminalHeight`, the code block will now be truncated with a "... generating more ..." message. If there's insufficient space even for the
message, a simpler "... code is being written ..." will be shown.
2025-05-15 22:57:28 -07:00
Taylor Mullen
33743d347b Fix: Prevent UI tearing and improve display of long content
This commit introduces several changes to better manage terminal height and prevent UI tearing, especially when displaying long tool outputs or when the pending history item exceeds the available terminal height.

- Calculate and utilize available terminal height in `App.tsx`, `HistoryItemDisplay.tsx`, `ToolGroupMessage.tsx`, and `ToolMessage.tsx`.
- Refresh the static display area in `App.tsx` when a pending history item is too large, working around an Ink bug (see https://github.com/vadimdemedes/ink/pull/717).
- Truncate long tool output in `ToolMessage.tsx` and indicate the number of hidden lines.
- Refactor `App.tsx` to correctly measure and account for footer height.

Fixes https://b.corp.google.com/issues/414196943
2025-05-15 22:57:28 -07:00