Commit Graph

184 Commits

Author SHA1 Message Date
Jacob Richman
716f7875a2 Support Images and PDFs (#447) 2025-05-20 13:02:41 -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
N. Taylor Mullen
7d818b46bc feat: Enable CI test reporting and artifact management (#367) 2025-05-15 22:59:53 -07:00
Taylor Mullen
41b82ce796 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
Brandon Keiji
358281f0fd fix: use react-jsx for typecheck (#280) 2025-05-07 12:36:04 -07:00
Brandon Keiji
49b5db29b3 feat: add build:sandbox and build:all npm scripts (#274) 2025-05-07 07:46:47 -07:00
Brandon Keiji
739654bb25 fix(sandbox): consolidate dev and prod sandbox (#273) 2025-05-07 07:23:13 -07:00
Brandon Keiji
d051c0fd0f feat: prototype publish sandbox script with npm package (#182) 2025-04-25 17:30:50 -07:00
Brandon Keiji
d394a9f39f feat: add flag to customize package version during pre-release staging (#155) 2025-04-24 13:02:49 -07:00
Brandon Keiji
c24dc0ec77 feat: add react dev tools (#143) 2025-04-23 18:16:15 -07:00
Brandon Keiji
4c951ea435 feat: set dogfood artifact registry as the default publishing endpoint (#135) 2025-04-23 15:11:10 -07:00
Brandon Keiji
79710375e3 fix: point npmrc to dogfood artifact registry (#108) 2025-04-21 23:11:51 -07:00
Olcan
2571e07175 enable debugging through sandbox (#88) 2025-04-21 12:39:58 -07:00
Brandon Keiji
e351baf10f feat: add custom eslint rule for cross-package imports (#77) 2025-04-21 08:02:11 -07:00
Olcan
39bdedab9c seamless sandboxing (just set GEMINI_CODE_SANDBOX=true in .env) (#76) 2025-04-21 07:50:18 -07:00
Taylor Mullen
bfb064024e Revert debug undo. 2025-04-20 22:28:39 -04:00
Taylor Mullen
ce0f2dd868 Update README to reflect current state of the world.
- We now have CI/CD
- We have linting support (so added a section)
- Fixed `npm run debug` to allow debugging again.
2025-04-20 22:25:20 -04:00
Tyler
d55168f51f 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
Olcan
ef909f6335 start and debug scripts (will enable seamless container use later), strict error handling in bash scripts (#63)
#61
2025-04-20 14:50:12 -07:00
Brandon Keiji
f480ef4bbc 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
044ccc6dd7 Enable npm run debug from root. 2025-04-19 17:59:17 -04:00
Evan Senter
0c9e1ef61b Adding some simple tests. (#54) 2025-04-19 18:07:24 +01:00
Allen Hutchison
3adc0dfbaf Command line flags got broke. Now to run with flags run: (#46)
npm run start -- -m model-id -d data/dir
2025-04-18 16:41:51 -07:00
Brandon Keiji
52683dafc3 infra: add multipackage support (#34) 2025-04-18 14:37:02 -07:00
Evan Senter
482aeaff10 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
Brandon Keiji
56d4a35d05 feat: initial configs for npm publishing (#30)
* feat: initial configs for npm publishing

* fix: workspace reference

* fix: include LICENSE in npm run build
2025-04-18 12:46:42 -07:00
Evan Senter
f6a4a5c44d Revert "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."
This reverts commit 1bfc62dcc2.
2025-04-18 18:36:33 +01:00
Evan Senter
dbf4c3a37c 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
Allen Hutchison
7878f54043 Add basic non blocking CI workflow. (#21) 2025-04-18 10:20:39 -07:00
Evan Senter
97db77997f Including a test harness for it, and making sure the cursor is always at the end. 2025-04-18 18:16:52 +01:00
Evan Senter
1bfc62dcc2 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. 2025-04-18 18:16:52 +01:00
Allen Hutchison
00d29aa162 Change the run command to properly pass the command line arguments to gemini.ts 2025-04-17 16:55:46 -07:00
Taylor Mullen
7928c1727f 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