Skip to main content

πŸ§ͺ 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​

  1. Triggered from your CI on PR open/update
  2. CLI detects PR-diffed files
  3. Runs coverage using your configured test command
  4. Identifies untested functions
  5. Generates AI-based Jest tests
  6. Commits results (if AUTO_COMMIT=true)
  7. 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:


πŸ§ͺ First Integration Step​

β†’ Integration Guide β†’

Start with installing the CLI and passing the required environment variables to your CI.

npm install -g @earlyai/cli
early generate-pr

🧠 Available Commands​

CommandDescription
early generate-prGenerate tests for a pull request
early generate-commitGenerate tests for a specific commit
early generate-folderGenerate tests for an entire folder

⏭️ What’s Next?​