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. |
||
---|---|---|
.. | ||
src | ||
README.md | ||
package.json | ||
tsconfig.json |
README.md
Gemini Code CLI
This package contains the core command-line interface for Gemini Code.
Building
To build only the CLI package, navigate to this directory (packages/cli
) and run:
npm run build
This command executes the TypeScript compiler (tsc
) as defined in this package's package.json
. Ensure dependencies have been installed from the root directory (npm install
) first.
Running
To start the Gemini Code CLI directly from this directory:
npm start
This command executes node dist/gemini.js
as defined in this package's package.json
.
Debugging
To debug the CLI application using VS Code:
- Start the CLI in debug mode from this directory (
packages/cli
):
This command runsnpm run debug
node --inspect-brk dist/gemini.js
, pausing execution until a debugger attaches. - In VS Code (opened at the root of the monorepo), 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
.