-
-
Notifications
You must be signed in to change notification settings - Fork 129
feat: add Node.js CLI for CodeGPT with npm support and installation script #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds Node.js/npm distribution support for CodeGPT, enabling users to install the CLI tool through npm alongside existing installation methods. The implementation includes automated npm publishing through GitHub Actions and cross-platform binary installation.
- Automated npm package publishing integrated into the existing GoReleaser workflow
- Node.js installer that detects platform/architecture and copies the appropriate binary
- Documentation updates across all supported languages (English, Chinese Traditional, Chinese Simplified)
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/goreleaser.yml |
Adds npm publishing job with artifact handling and version extraction |
cli/nodejs/package.json |
Defines npm package metadata, supported platforms, and installation scripts |
cli/nodejs/install.js |
Platform detection and binary installation logic for cross-platform support |
cli/nodejs/.npmignore |
Excludes unnecessary files from npm package distribution |
README.md, README.zh-cn.md, README.zh-tw.md |
Adds npm badges and installation instructions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| "description": "A CLI tool that uses AI models to help write commit messages, code review, summary code, and more", | ||
| "main": "install.js", | ||
| "bin": { | ||
| "codegpt": "bin/codegpt" |
Copilot
AI
Oct 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The binary path points to 'bin/codegpt' but the install script copies the binary to 'bin/codegpt-bin'. This mismatch will cause the CLI command to fail when users try to run 'codegpt' after installation.
| "codegpt": "bin/codegpt" | |
| "codegpt": "bin/codegpt-bin" |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #251 +/- ##
==========================================
- Coverage 21.96% 6.79% -15.18%
==========================================
Files 8 33 +25
Lines 346 1870 +1524
==========================================
+ Hits 76 127 +51
- Misses 264 1734 +1470
- Partials 6 9 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This pull request introduces support for distributing CodeGPT as an npm package, enabling easy installation via Node.js and npm. It adds a new workflow for publishing to npm, updates documentation in all supported languages, and implements the necessary packaging scripts and configuration for cross-platform binary installation. The most important changes are grouped below:
GitHub Actions & Release Automation:
publish-npmjob to.github/workflows/goreleaser.ymlto automate npm publishing, including steps for downloading build artifacts, updatingpackage.json, copying documentation, and verifying publication. The workflow outputs the version from the tagged release for use in npm publishing. [1] [2]Node.js Package Implementation:
cli/nodejs/package.jsonto define the npm package, including metadata, binary mapping, supported platforms/architectures, and apostinstallscript to handle binary setup.cli/nodejs/install.js, a Node.js installer script that detects the user's platform and architecture, copies the appropriate binary, and sets executable permissions..npmignoreincli/nodejsto exclude unnecessary files from the npm package.Documentation Updates:
README.md,README.zh-cn.md, andREADME.zh-tw.mdto include npm badges and installation instructions for the new npm package, clarifying that the correct binary is automatically installed for the user's platform. [1] [2] [3] [4] [5] [6]