Go to file
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
.vscode Initial commit of Gemini Code CLI 2025-04-17 13:19:55 -04:00
packages/cli fix: Suppress crash from unhandled 429 stream error via global handler 2025-04-17 13:20:11 -04:00
.gitignore Initial commit of Gemini Code CLI 2025-04-17 13:19:55 -04:00
README.md Add and update README files 2025-04-17 13:20:06 -04:00
package-lock.json Initial commit of Gemini Code CLI 2025-04-17 13:19:55 -04:00
package.json Initial commit of Gemini Code CLI 2025-04-17 13:19:55 -04:00
tsconfig.json Initial commit of Gemini Code CLI 2025-04-17 13:19:55 -04:00

README.md

Gemini Code

Disclaimer: This README.md was created by gemini-code and this project was developed rapidly and currently lacks comprehensive testing, CI/CD pipelines, and other quality-of-life features common in mature projects.

This repository contains the Gemini Code CLI tool.

Cloning and Contribution

This project uses Gerrit for version control. For details on the development workflow, including how to clone the repository and contribute changes, please refer to the Gerrit Dev Workflows.

Building

To build the entire project, including the CLI package, run the following command from the root directory:

npm install
npm run build

This command installs dependencies and then runs the build script defined in the root package.json, which in turn executes the build scripts in all workspaces (including packages/cli).

Running

To start the Gemini Code CLI, run the following command from the root directory:

npm start

This command executes the start script defined in the root package.json, which specifically targets and runs the start script within the gemini-code-cli workspace.

Debugging

To debug the CLI application using VS Code:

  1. Start the CLI in debug mode from the root directory:
    npm run debug --workspace=gemini-code-cli
    
    This command runs node --inspect-brk dist/gemini.js within the packages/cli directory, pausing execution until a debugger attaches.
  2. In VS Code, use the "Attach" launch configuration (found in .vscode/launch.json). This configuration is set up to attach to the Node.js process listening on port 9229, which is the default port used by --inspect-brk.

Alternatively, you can use the "Launch Program" configuration in VS Code if you prefer to launch the currently open file directly, but the "Attach" method is generally recommended for debugging the main CLI entry point.