Commit Graph

55 Commits

Author SHA1 Message Date
goldyonatan 905b0fee5c Fix #4220: allow up/down arrow to toggle history when only one sugges… (#4377) 2025-07-17 22:30:39 +00:00
Matias 20b6a0d8b1 feat(cli): clear input buffer on CTRL+C when not executing commands (#1729)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-07-16 03:35:58 +00:00
Billy Biggs 5f1a9c77ae Add back support for escaping newline with a \ character (#4064) 2025-07-14 03:34:20 +00:00
Jayson Dasher 7be8781a16 feat: Add clipboard image paste support for macOS (#1580)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-07-12 04:06:49 +00:00
Abhi 3227b5286f feature(commands) - Refactor Slash Command + Vision For the Future (#3175) 2025-07-07 20:45:44 +00:00
Sambhav Khanna a5396e00de 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
Didier Durand b8ac12b382 fix typos in diverse files (#3284)
Co-authored-by: Scott Densmore <scottdensmore@mac.com>
2025-07-05 15:23:39 +00:00
Seth Troisi 2e50b7b903 Improve slashCommand autoCompletion logic (#2776) 2025-07-01 22:51:43 +00:00
Billy Biggs 42dfd1ee61 Handle stdin for prompts using readline for escape character parsing (#1972) 2025-06-27 17:57:32 +00:00
Brandon Keiji 5ad4a0a826 fix: prepublish changes to package names (#1420) 2025-06-25 12:41:11 +00:00
Jacob Richman c4e7c9f675 Fix flicker issues by ensuring all actively changing content fits in the viewport (#1217) 2025-06-19 13:17:23 -07:00
Abhi 02c3d71491 feat: shell history (#1169) 2025-06-17 22:17:16 -04:00
Billy Biggs ea84b23a34 Support escaping carriage returns with \ (#1127) 2025-06-17 10:03:05 -07:00
Billy Biggs 69d436d754 Support completion of checkpoint names in /resume (#1063) 2025-06-15 11:40:39 -07:00
Daniel Lee 68dc1e8678 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
Jacob Richman ebf20d4c4c Auto insert @ when dragging and dropping files. (#812) 2025-06-07 14:48:56 -07:00
cperry-goog a49f734c13 refactor: rename gemini-code to gemini-cli (#822) 2025-06-07 14:27:22 -07:00
Jacob Richman 618dfa2c9f feat(ui): add cursor to empty input prompt (#800) 2025-06-06 13:44:11 -07:00
Miguel Solorio 3cdbeb879b Allow themes to theme the UI (#769) 2025-06-05 14:35:47 -07:00
Marat Boshernitsan 13a1610a0e 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 906f716d3e 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
Tommaso Sciortino 64bd136f42 Rename server->core (#638) 2025-05-30 18:25:47 -07:00
Allen Hutchison a7bf6e4e81 fix(cli): Clear input buffer before onSubmit in InputPrompt (#633) 2025-05-30 15:16:06 -07:00
Jacob Richman 0a9505e9a2 Fix bug updating the cursor after navigating history. (#507) 2025-05-23 09:40:01 -07:00
Olcan e34eb5b729 restore placeholder change likely dropped in a merge (#464) 2025-05-21 07:55:20 -07:00
Taylor Mullen ff005b546b 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 e38e62fec6 Merge InputPrompt and multiline-editor and move autocomplete logic directly into InputPrompt (#453) 2025-05-20 16:50:32 -07:00
DeWitt Clinton 8e123f7a7c 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 3273cbcb6c ui tweaks (#442) 2025-05-19 16:58:57 -07:00
Taylor Mullen 562fd12851 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
DeWitt Clinton 63d8f22658 Add readline-like keybindings to the input prompts. (#354)
New keybindings in the main input prompt (when auto-suggestions are not active):

  - `Ctrl+L`: Clears the entire screen.
  - `Ctrl+A`: Moves the cursor to the beginning of the current input line.
  - `Ctrl+E`: Moves the cursor to the end of the current input line.
  - `Ctrl+P`: Navigates to the previous command in the input history.
  - `Ctrl+N`: Navigates to the next command in the input history.

In the multiline text editor (e.g., when editing a previous message):
   - `Ctrl+K`: Deletes text from the current cursor position to the end of the line ("kill line right").
2025-05-14 17:33:37 -07:00
Miguel Solorio 92b4e1c342 Improvements to suggestions & slash commands (#344)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
2025-05-14 16:01:29 -07:00
Jacob Richman 81b37e229d First step refactoring InputPrompt (#335) 2025-05-13 16:23:14 -07:00
Miguel Solorio 5bd418e662 Use Enter on slash commands to execute (#334) 2025-05-13 16:08:12 -07:00
Jacob Richman 78ec631acb Multiline editor (#302)
Co-authored-by: Taylor Mullen <ntaylormullen@google.com>
2025-05-13 11:24:04 -07:00
Allen Hutchison 54d2c30602 Refactor: Enhance @-command, Autocomplete, and Input Stability (#279) 2025-05-07 12:30:32 -07:00
Jacob Richman 3f9c759932 Cleanup low value comments. (#248) 2025-05-02 14:39:39 -07:00
Seth Troisi d3255de6f9 Add autocomplete for slash commands 2025-05-02 20:58:53 +00:00
Jacob Richman 4808237923 Support escaping spaces in file paths. (#241) 2025-05-01 18:02:04 -07:00
Allen Hutchison 32daa97428 Add @ command suggestions in the UI. (#219) 2025-04-30 08:31:32 -07:00
Taylor Mullen f9a9a20201 Follow up fixes from flickering PR.
- The push for these changes didn't make it through.... Just doing a quick fix here which should have been in: https://github.com/google-gemini/gemini-code/pull/181
2025-04-26 19:32:56 -07:00
Taylor Mullen 9ad530c18b feat: Fix flickering in iTerm + scrolling + performance issues.
- Refactors history display using Ink's <Static> component to prevent flickering and improve performance by rendering completed items statically.
- Introduces ConsolePatcher component to capture and display console.log, console.warn, and console.error output within the Ink UI, addressing native handling issues.
- Introduce a new content splitting mechanism to work better for static items. Basically when content gets too long we will now split content into multiple blocks for Gemini messages to ensure that we can statically cache larger pieces of history.

Fixes:
- https://b.corp.google.com/issues/411450097
- https://b.corp.google.com/issues/412716309
2025-04-26 16:08:05 -07:00
Taylor Mullen dbe94ad43c Give Gemini Code a face lift.
- This utilizes `ink-gradient` to render GEMINI CODE in amazing colors.
- Added a shared color configuration for UX (should this be in config?). It's very possible that we shouldn't be talking about the specific colors and instead be mentioning "foreground"/"background"/inlineCode etc. type colors.
- Updated existing color usages to utilize `Colors.*`

Fixes https://b.corp.google.com/issues/411385593
2025-04-19 17:10:06 -04:00
Evan Senter 236949431b Starting to modularize into separate cli / server packages. (#55)
* Starting to move a lot of code into packages/server

* More of the massive refactor, builds and runs, some issues though.

* Fixing outstanding issue with double messages.

* Fixing a minor UI issue.

* Fixing the build post-merge.

* Running formatting.

* Addressing comments.
2025-04-19 19:45:42 +01:00
Evan Senter aaa0541da5 Adding in a history buffer (#38)
Up and down arrows traverse the command history.
2025-04-19 14:31:59 +01:00
Tyler c26606d4a3 Add apache2 SPDX headers to all source files (#48) 2025-04-18 17:44:24 -07:00
Taylor Mullen 045bd60945 Fix remaining tslint errors (YAY).
- Also updated ci.yml to ensure that linting failures will break the build.

Fully fixes https://b.corp.google.com/issues/411384603
2025-04-18 19:14:36 -04:00
Taylor Mullen a054fdde31 Run npm run format
- This has the entirety of the changes.

Part of https://b.corp.google.com/issues/411720532
2025-04-18 18:10:57 -04:00
Jaana Dogan bf1feb59a0 Introduce a config module to manage configuration (#22)
* Introduce a config module to manage configuration

* Remove public modifier
2025-04-18 11:12:18 -07:00
Evan Senter 8711ba37db Revert "Including a test harness for it, and making sure the cursor is always at the end."
This reverts commit 97db77997f.
2025-04-18 18:36:33 +01:00