diff options
| author | Taylor Mullen <[email protected]> | 2025-05-23 12:27:48 -0700 |
|---|---|---|
| committer | N. Taylor Mullen <[email protected]> | 2025-05-23 13:55:06 -0700 |
| commit | 8590efd229eb05fcbc0c3858c6640a770b61b95a (patch) | |
| tree | 0f36b4f454c0871f8e8b244cf42743fcd8900ec7 /packages/server/src | |
| parent | 8f266f96524f1b09fb2fdac2730a0821334c8273 (diff) | |
feat: Enable npx execution directly from GitHub URL
This commit modifies the packaging setup to allow the CLI to be
executed directly from its GitHub URL using `npx`, for example:
`npx https://github.com/google-gemini/gemini-cli` (once merged to main).
This is achieved without requiring the bundle to be checked into
the repository.
Key changes and motivations:
- Modify `scripts.prepare` to run `npm run bundle`:
Ensures the CLI bundle is generated automatically when `npx`
installs the package from a git URL. This replaces previous
approaches (e.g., using `prepack`) which were not consistently
triggered in the `npx` environment.
- Update `scripts.bundle` to use a direct path for `esbuild`
and externalize `sqlite3`:
Using `node_modules/.bin/esbuild` provides a more reliable way
to invoke the bundler. Externalizing `sqlite3` is crucial for
correctly handling its native addon, preventing runtime errors.
- Add `bin`, `files`, and root `sqlite3` dependency:
- The `bin` field defines the `gemini` command.
- The `files` array ensures the generated `bundle/` directory is
recognized by npm.
- `sqlite3` is added as a root dependency to ensure it's
installed by `npx` when `gemini-code` is fetched, allowing the
externalized module to be resolved.
These changes collectively ensure that the necessary build artifacts
are created on-the-fly during `npx` installation, providing a
seamless execution experience directly from the GitHub repository URL.
Diffstat (limited to 'packages/server/src')
0 files changed, 0 insertions, 0 deletions
