Commit Graph

31 Commits

Author SHA1 Message Date
Brandon Keiji e8c774cb6c fix: remove gemini-code bin configuration (#330) 2025-05-13 13:09:58 -07:00
Taylor Mullen 4cf345d0a3 Add bundling support.
- This can now be invoked with `npm run bundle`, it creates a `bundle/` folder that has:
  - gemini.js
  - sandbox-macos-minimal.sb
  - sandbox-macos-strict.sb
  - shell.json
  - shell.md

- This doesn't include any sort of automation for auto bundling pieces. It's just the root capability which we can weave into other locations.

Fixes https://b.corp.google.com/issues/411432723
2025-05-08 23:36:42 -07:00
Taylor Mullen 9d9f7739b7 Continue to work through 429/500s.
- The root of this issue was actually a genai SDK bug that was fixed here: https://critique.corp.google.com/cl/753255997
- Upgrade to latest genai SDK for latest bug fixes (including the above)
- Removed specific 429 handling for uncaught rejections.

Fixes https://b.corp.google.com/issues/413760164
2025-05-07 16:38:06 -07:00
olcan 06274153ba support for mcp tools 2025-05-05 17:10:45 -07:00
Allen Hutchison b38e28b012 Fix an issue where types/react was a different version from our main … (#231)
Co-authored-by: Brandon Keiji <brandonkeiji@google.com>
2025-04-30 16:33:43 -07:00
Brandon Keiji 15463d1a57 fix: point start.sh to relative path (#209) 2025-04-29 02:44:59 +00:00
Olcan d1fd9cdf67 enable servers in sandbox to listen on localhost (127.0.0.1) instead of 0.0.0.0, ensuring servers can be container/host-agnostic (#207)
* enable servers in sandbox to listen on localhost (127.0.0.1) instead of 0.0.0.0, ensuring servers can be container/host-agnostic

* Merge remote-tracking branch 'origin/main' into sandbox_localhost_works
2025-04-28 18:40:24 -07:00
Brandon Keiji 66b08209b2 feat: publish docker image alongside npm package (#197) 2025-04-28 13:25:19 -07:00
Taylor Mullen b22ce6dc49 Upgrade @google/genai to latest.
- Motivation of this upgrade is to enable us to get convenient access to the thinking budget config changes for 2.5 thinking models. This will be key to getting our model to take a bit more time for various requests.
2025-04-27 13:48:34 -07:00
Taylor Mullen 1dcb9b0b3d Cleanup outdated packages in server/cli.
- Found that pre-backend front end split we had a number of packages that we hadn't revisisted. Went through and cleaned them up (i.e. cli needing genai).
2025-04-27 13:41:21 -07:00
Brandon Keiji 92c218fa42 feat: prototype publish sandbox script with npm package (#182) 2025-04-25 17:30:50 -07:00
Brandon Keiji 50d5885d99 feat: add flag to customize package version during pre-release staging (#155) 2025-04-24 13:02:49 -07:00
Brandon Keiji 8318f20038 feat: add react dev tools (#143) 2025-04-23 18:16:15 -07:00
Seth Troisi 5c6f018b8d Support GEMINI_CODE_SANDBOX=0/false as no SANDBOXing 2025-04-23 16:33:19 -07:00
Brandon Keiji d0362adee1 feat: set dogfood artifact registry as the default publishing endpoint (#135) 2025-04-23 15:11:10 -07:00
Brandon Keiji 9ccdc66eba feat: add CLI version number to footer (#134) 2025-04-23 15:00:40 -07:00
Taylor Mullen c9a7714a84 Colorize code blocks.
- This changeset uses lowlight.js to parse the code in codeblocks to derive an AST, it then translates that into CSS themes that are widely known via highlight.js (things that GitHub use), finally I translate those css.color attributes into Ink colors and effectivel do <Text color={the color}>the text</Text>.
 - To do this I needed to build color mappings from css -> Ink
 - I introduced a new `Theme` type that will be used to represent many different color themes. It also enabled the color mappings to be seamless.
 - Added a theme manager that only has one theme for now (VS2015). The theme works very well with our colorization.
- Some other bits was removal of borders around our codeblocks since they now have richer rendering.
- Most complex bits of code in this PR is in the `CodeColorizer.tsx`

Fixes https://b.corp.google.com/issues/412433479
2025-04-22 18:57:27 -07:00
Brandon Keiji 4e37f77e2a feat: add alias to the cli bin directive (#126) 2025-04-23 01:04:34 +00:00
Brandon Keiji 448e308604 fix: point npmrc to dogfood artifact registry (#108) 2025-04-21 23:11:51 -07:00
Brandon Keiji 8f8e0d89d5 fix: use relative imports within the same package (#93) 2025-04-21 14:09:14 -07:00
Tyler 77cca7b92e add linter for checking license headers (and eslint --fix target to match, and fix missing license headers while we're here) (#62) 2025-04-20 17:16:25 -07:00
Brandon Keiji 700d59b8fb refactor: clean up build output (#53)
* refactor: clean up build output

* refactor: add index.ts to package roots
2025-04-20 12:33:39 -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 862d1ae839 Adding some simple tests. (#54) 2025-04-19 18:07:24 +01:00
Brandon Keiji dee6386ed1 fix: add clean command to individual packages (#36) 2025-04-18 14:57:20 -07:00
Brandon Keiji d3cd31ba9b infra: add multipackage support (#34) 2025-04-18 14:37:02 -07:00
Evan Senter eede263ea1 Warn if npm run start is out of date. (#20)
* Adding some wiring to allow the Ink app to warn if there are local development changes that haven't been captured in the recent build of the Gemini CLI.

* Adding a new useAppEffects.ts file that wores some useEffect handlers in.

* Updating package-lock.json to resolve `npm ci` issues.

* Updating package-lock.json and package.json to resolve `npm ci` issues.
2025-04-18 21:55:02 +01: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
Evan Senter 4ed061da38 Including a test harness for it, and making sure the cursor is always at the end. 2025-04-18 18:16:52 +01:00
Taylor Mullen 0ca7c28971 Configure linter + prettier.
- This is based on existing expectations for TS code in Google-esc repos.
- First part of the change (we have not run any linter or formatting commands). After this changeset goes in I'll do a mass changeset push.

Fixes https://b.corp.google.com/issues/411384603
2025-04-17 15:29:34 -07:00
Taylor Mullen add233c504 Initial commit of Gemini Code CLI
This commit introduces the initial codebase for the Gemini Code CLI, a command-line interface designed to facilitate interaction with the Gemini API for software engineering tasks.

The code was migrated from a previous git repository as a single squashed commit.

Core Features & Components:

*   **Gemini Integration:** Leverages the `@google/genai` SDK to interact with the Gemini models, supporting chat history, streaming responses, and function calling (tools).
*   **Terminal UI:** Built with Ink (React for CLIs) providing an interactive chat interface within the terminal, including input prompts, message display, loading indicators, and tool interaction elements.
*   **Tooling Framework:** Implements a robust tool system allowing Gemini to interact with the local environment. Includes tools for:
    *   File system listing (`ls`)
    *   File reading (`read-file`)
    *   Content searching (`grep`)
    *   File globbing (`glob`)
    *   File editing (`edit`)
    *   File writing (`write-file`)
    *   Executing bash commands (`terminal`)
*   **State Management:** Handles the streaming state of Gemini responses and manages the conversation history.
*   **Configuration:** Parses command-line arguments (`yargs`) and loads environment variables (`dotenv`) for setup.
*   **Project Structure:** Organized into `core`, `ui`, `tools`, `config`, and `utils` directories using TypeScript. Includes basic build (`tsc`) and start scripts.

This initial version establishes the foundation for a powerful CLI tool enabling developers to use Gemini for coding assistance directly in their terminal environment.

---
Created by yours truly: __Gemini Code__
2025-04-17 13:19:55 -04:00