π§ͺ CLI PR Agent β For Pull Requests Outside GitHub Actions
The Early CLI for Pull Requests provides AI-powered test generation for teams using Jenkins, CircleCI, Bitbucket Pipelines, and other CI/CD systems outside GitHub Actions.
It mirrors the GitHub Action behavior β analyzing PR diffs, generating unit tests, and committing them β but gives you full control over how and where it runs.
π When to Useβ
Use the CLI PR Agent when:
- Your CI system is not GitHub Actions (e.g., Jenkins, CircleCI)
- You want to run test generation for pull requests
- You need custom workflows or enhanced control over timing and environments
- You're integrating with Bitbucket, GitHub, or other supported SCMs
β When to Use Which Agent β
βοΈ How It Worksβ
- Triggered from your CI on PR open/update
- CLI detects PR-diffed files
- Runs coverage using your configured test command
- Identifies untested functions
- Generates AI-based Jest tests
- Commits results (if
AUTO_COMMIT=true) - Optionally posts a PR comment or updates the PR summary
β Uses the early generate-pr command
β Configure via CLI flags or environment variables
π Requirementsβ
To run the CLI PR agent:
- β Node.js v20+
- β Access to the CLI via GitHub Packages β NPM Authentication β
- β
A valid
API_KEYfrom Early - β
A valid
TOKEN(GitHub PAT or Bitbucket App Password) β Token Permissions β - β
Set the appropriate
SCM_PROVIDERβ SCM Support β - β Tune concurrency if needed β Concurrency β
- β Avoid memory crashes β Memory Tuning β
π§ͺ First Integration Stepβ
Start with installing the CLI and passing the required environment variables to your CI.
npm install -g @earlyai/cli
early generate-pr
π§ Available Commandsβ
| Command | Description |
|---|---|
early generate-pr | Generate tests for a pull request |
early generate-commit | Generate tests for a specific commit |
early generate-folder | Generate tests for an entire folder |