Skip to content

Conversation

adamfweidman
Copy link
Collaborator

@adamfweidman adamfweidman commented Oct 6, 2025

TLDR

expose @google/gemini-cli-a2a-server as an executable npm package by wiring its bin entry to the compiled server entrypoint

Dive Deeper

  • add a shebang to the server script so the generated JS runs out of the box when invoked via npm
  • keep main pointing at the workspace build (dist/index.js) so TypeScript consumers still import the package normally
  • the package no longer needs private: true
  • change path.resolve to basename as this caused errors when run across symlinks
  • npm run build --workspace @google/gemini-cli-a2a-server produces an invokable dist/a2a-server.mjs. This is what npm users will run

I confirmed this worked with GCA in cl/815948932. Reproduce by:

  • in a2a-server/package.json change core package to "@google/gemini-cli-core": "0.9.0-nightly.20251002.0f465e88".
  • npm pack --workspace=@google/gemini-cli-a2a-server
  • Within the GCA repo run `yarn add <outputted_tgz>
  • yarn install
  • Run the debugger to start GCA

Reviewer Test Plan

  • npm run build --workspace @google/gemini-cli-a2a-server to rebuild the workspace output including the server entry
  • node packages/a2a-server/dist/a2a-server.mjs to confirm the server boots directly from the compiled artifact
  • optionally npx @google/gemini-cli-a2a-server after a local npm pack && npm install to verify the bin shim runs the server end-to-end

Testing Matrix

This PR makes progress on #9207

@adamfweidman adamfweidman requested a review from a team as a code owner October 6, 2025 14:25
Copy link
Contributor

Summary of Changes

Hello @adamfweidman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request transforms the @google/gemini-cli-a2a-server package into a standalone executable, making it publishable and directly usable as a command-line tool. This is achieved by configuring the package.json to expose a binary entry point and adding a shebang to the server's main script, while maintaining its existing module import functionality.

Highlights

  • Executable Server: The @google/gemini-cli-a2a-server package is now configured to be directly executable via npm, allowing it to be run as a command-line tool.
  • Package Configuration: The package.json has been updated to include a bin entry, mapping gemini-cli-a2a-server to the compiled server entrypoint, and the private flag has been removed to enable publishing.
  • Server Script Shebang: A shebang (#/usr/bin/env node) has been added to the server.ts file, ensuring the compiled JavaScript can be executed directly by Node.js.
  • Main Entry Point: The main entry in package.json now points to dist/index.js, preserving normal import behavior for TypeScript consumers.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully makes the @google/gemini-cli-a2a-server package executable by adding a bin entry to package.json and a shebang to the server entrypoint. While the changes are generally correct, I've identified a potential high-severity issue where a process-wide exception handler is registered unconditionally. This could lead to unintended side effects if the server module is imported by other applications. My review comment details this issue and suggests a fix to improve the package's robustness.

Copy link

github-actions bot commented Oct 6, 2025

Size Change: -2 B (0%)

Total Size: 17.8 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 17.7 MB -2 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 0 B
./bundle/sandbox-macos-permissive-open.sb 830 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B

compressed-size-action

@adamfweidman adamfweidman requested a review from a team as a code owner October 7, 2025 00:22
@adamfweidman adamfweidman changed the title feat: make a2a server executable chore: make a2a server executable Oct 7, 2025
@adamfweidman adamfweidman changed the title chore: make a2a server executable chore: add a2a server bin Oct 7, 2025
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adamfweidman adamfweidman enabled auto-merge October 9, 2025 23:39
@adamfweidman adamfweidman added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit c82c2c2 Oct 9, 2025
20 checks passed
@adamfweidman adamfweidman deleted the adamfw/a2a-bin branch October 9, 2025 23:48
giraffe-tree pushed a commit to giraffe-tree/gemini-cli that referenced this pull request Oct 10, 2025
SandyTao520 pushed a commit that referenced this pull request Oct 10, 2025
thacio added a commit to thacio/auditaria that referenced this pull request Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants