Commit Graph

30 Commits

Author SHA1 Message Date
Jaana Dogan
328846c6e3 Remove extra args from config (#27)
We don't have a use case for them yet.
2025-04-18 11:26:39 -07:00
Jaana Dogan
3afaa8033b 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
Jaana Dogan
e1fac40256 Rename invalidParams to validateToolParams (#12)
Methods should be verbs. Fixes #4.
2025-04-18 11:06:30 -07:00
Taylor Mullen
7cd3b95317 Fix linting errors in a number of core and tool files (partial)
- As part of this work I also started building out errors.ts which will be a cumulation of error helpers to better handle the challenging `catch (error: unknown)` requirement.
- More changes are to come, this is truly a partial change in order to not disrupt as many people as possible.

Part of https://b.corp.google.com/issues/411384603
2025-04-18 14:02:09 -04:00
Jaana Dogan
93fd6a9160 Style improvements to ls tool (#14) 2025-04-18 10:57:20 -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
bb95c8c45a Revert "Adding support for up / down arrows in the command history."
This reverts commit 3829ac6353.
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
Tyler
f330a87e50 add LICENSE (#25) 2025-04-18 10:30:07 -07:00
Allen Hutchison
f72aa8c840 Cicd (#24)
* Add basic non blocking CI workflow.

* Make lint and typecheck continue on error until we have fixed those warnings.
2025-04-18 10:26:27 -07:00
Brandon Keiji
999d0568fa Refactor: Update API key missing message with link (#23) 2025-04-18 10:25:32 -07: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
3829ac6353 Adding support for up / down arrows in the command history. 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
Taylor Mullen
e0339993ae Initial auto-fixing of linting errors.
- This is the result of runing `npm lint -- -fix`
2025-04-18 12:41:02 -04:00
Evan Senter
cb30351403 Adding a new parameter for model, and updating the default to 2.5 Flash. (#18) 2025-04-18 17:06:16 +01:00
Allen Hutchison
b56d9c8639 Merge pull request #9 from google-gemini/target-directory
Change the run command to properly pass the command line arguments to…
2025-04-17 16:57:22 -07: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
cfc697a96d Run npm run format
- Also updated README.md accordingly.

Part of https://b.corp.google.com/issues/411384603
2025-04-17 15:29:34 -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
Jaana Dogan
d3ee91ff92 Merge pull request #3 from google-gemini/readme
Remove internal docs and mention of Gerrit from README
2025-04-17 14:39:13 -07:00
Jaana Dogan
a280727248 Remove internal docs and mention of Gerrit from README 2025-04-17 14:38:44 -07:00
Taylor Mullen
d970882428 Fix build break (tool -> tools).
- Without this we'd get a TS1261 about the name "tool" only differeing from "Tool" (the class) by case.
2025-04-17 17:25:01 -04:00
Taylor Mullen
ece8630c33 Revert camelCasing for schemas 2025-04-17 14:15:20 -07:00
Jaana Dogan
81ba61df7f Improve readability issues
This is only the first change of many changes.

* Remove redundant autogenerated comments
* Use the recommended file name style
* Use camelCase for variable names
* Don't introduce submodules for relevant types
* Don't introduce constants like modules, these are implementation details
* Remove empty files
2025-04-17 14:15:20 -07:00
Brandon Keiji
898a83031c docs: Add setup instructions for API key to README (#1) 2025-04-17 11:59:12 -07:00
Allen Hutchison
f10aaf7e7e fix: Suppress crash from unhandled 429 stream error via global handler
Introduces a process.on('unhandledRejection') handler in src/gemini.ts
as a workaround for an issue where 429 ClientErrors originating from
the @google/genai library's sendMessageStream during iteration can
cause an unhandled rejection, even when caught within local try/catch
blocks in the application code (e.g., in processGeminiStream).
The handler specifically identifies this known 429 ClientError based on
its type and message content. If matched, it logs a warning indicating
the known issue is being suppressed and prevents process.exit(1).
Any other genuinely unhandled promise rejections will still be logged
as critical errors and will terminate the application, maintaining
default behavior for unexpected issues. This workaround mitigates a
suspected library-internal problem related to error propagation during
asynchronous stream iteration.
2025-04-17 13:20:11 -04:00
Taylor Mullen
123c3050dc Add and update README files
- Adds a detailed README.md to the `packages/cli` directory covering build, run, and debug instructions specific to the CLI package.
- Updates the root README.md with comprehensive project information, including cloning instructions (Gerrit), monorepo build/run/debug steps, and references to relevant resources.

Created by yours truly: __Gemini Code__
2025-04-17 13:20:06 -04: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