๐งช Repo CLI Agent โ For Repository-Wide Coverage
The Early CLI for Repository lets you generate unit tests for individual files or entire folders in your codebase โ making it the fastest way to raise coverage across legacy code, specific modules, or large areas of your app.
Supported languages: JavaScript, TypeScript, and Python. The CLI auto-detects the project language from the target directory.
๐ When to Useโ
Use the Repo CLI Agent when:
- You want a one-time coverage boost across a folder
- You're onboarding a legacy service or utility layer
- You want to run weekly or monthly coverage maintenance
- You're using GitHub, Bitbucket, or another supported SCM
- You want to integrate with Jenkins, CircleCI, or GitHub Actions
โ๏ธ How It Worksโ
- JavaScript / TypeScript
- Python
- You specify a target file or folder using
--target-directory ./src/utilsor--target-directory ./src/utils/math.ts - The CLI scans the target recursively if it's a folder, or focuses on the single file if specified
- Runs your configured coverage command
- Identifies low or zero-covered functions
- Generates tests using AI (Jest, Mocha, etc.)
- Optionally commits results (
AUTO_COMMIT=true)
- You specify a target file or folder using
--target-directory ./src/utilsor--target-directory ./src/utils/helpers.py - The CLI auto-detects the Python project and delegates to the py-agent
- Scans the target recursively for
.pyfiles (or focuses on the single file) - Extracts testable functions and class methods from each file
- Generates pytest tests using AI
Note: Auto-commit is not yet supported for Python projects. Generated test files are written to disk but not committed automatically.
Command:
early generate-for-projectConfigure via CLI flags or environment variables
๐ Requirementsโ
- JavaScript / TypeScript
- Python
- โ Node.js v20+
- โ CLI installed from NPM Packages โ NPM Installation โ
- โ
A valid
API_KEY - โ
A valid
TOKENwith commit permissions โ Token Setup โ - โ
Set the
SCM_PROVIDERto match your platform โ SCM Support โ - โ Memory-safe defaults โ Memory Tuning โ
- โ Optionally limit parallelism โ Concurrency Guide โ
- โ Node.js v20+ (for the CLI itself)
- โ
CLI installed from NPM:
npm install -g @earlyai/cli - โ
py-agent installed:
pip install py-agent - โ
A valid
API_KEY - โ
A valid
TOKEN
๐งช First Integration Stepโ
See full setup here โ Integration Guide
- JavaScript / TypeScript
- Python
early generate-for-project \
--target-directory ./src/api \
--token $TOKEN \
--api-key $API_KEY \
--ref-name main
early generate-for-project \
--api-key $API_KEY \
--token $TOKEN \
--target-directory ./src/utils \
--ref-name main
--target-directorycan be a single.pyfile or a folder. When given a folder, the CLI scans recursively for Python source files.
๐ฆ Supported CI/CD Platformsโ
- โ GitHub Actions
- โ Jenkins
- โ CircleCI
- โ GitLab CI
- โ Self-hosted CI tools
All platforms must support Node.js 20 and repo access. Python projects additionally require
pip install py-agentin the CI environment.