โ Frequently Asked Questions โ Early CLI
This page covers CLI-specific questions when running early generate-pr.
For shared topics like API keys, token scopes, and permissions, see the Fundamentals FAQ โ.
๐ Which languages are supported?โ
- โ JavaScript
- โ TypeScript
- โ Python (pytest)
The CLI auto-detects the project language from file extensions and project markers (e.g., package.json for JS/TS, pyproject.toml or requirements.txt for Python).
๐ What permissions do tokens need?โ
TOKEN โ for Git access and committing filesโ
Used to access commit or PR metadata, push commits, and post comments.
๐ How do I get my API key?โ
See API Key โ
๐งฑ Which CI/CD systems are supported?โ
Any system with Node.js 20+:
- Jenkins
- CircleCI
- GitLab
- Bitbucket
- Self-hosted agents
Python projects additionally require
pip install py-agentin the CI environment.
๐งช Which test frameworks are supported?โ
- JavaScript / TypeScript
- Python
- โ Jest (required today)
- ๐ก Vitest (coming soon)
- โช Mocha (planned)
- โ pytest (auto-detected)
The test framework is automatically set to pytest for Python projects. No configuration is needed.
๐ What coverage threshold is used?โ
Currently fixed at 0%. Only functions with zero coverage will be targeted.
โ๏ธ How do I handle memory issues?โ
- JavaScript / TypeScript
- Python
If you hit a heap error:
export MAX_CONCURRENCY=2
Or:
export NODE_OPTIONS="--max-old-space-size=5120"
Python test generation does not require NODE_OPTIONS memory tuning. If you experience performance issues, reduce concurrency:
export MAX_CONCURRENCY=1
๐งฉ Can I override the coverage or test commands?โ
- JavaScript / TypeScript
- Python
Yes. Use these environment variables:
| Variable | Purpose |
|---|---|
COVERAGE_COMMAND | Run coverage before/after |
TEST_COMMAND | Run test validation |
Flags like --coverageDirectory and --json must stay intact.
See Configuration โ
Custom --test-command and --coverage-command are not yet supported for Python projects. The agent analyzes source code directly to identify testable functions.
๐งพ How does auto-commit work?โ
- JavaScript / TypeScript
- Python
When AUTO_COMMIT=true:
- Tests are committed to the branch
- Only passing, valid tests are committed
To disable:
export AUTO_COMMIT=false
When AUTO_COMMIT=true:
- Generated
.early.test files are committed and pushed to the branch - The commit message includes
[skip ci]by default (configurable viaAUTO_COMMIT_SKIP_CI)
To disable:
export AUTO_COMMIT=false
๐งน What if my repo enforces lint/format rules?โ
- JavaScript / TypeScript
- Python
Use:
export LINT_COMMAND="npx --no eslint $early_filename --fix"
export PRETTIER_COMMAND="npx --no prettier $early_filename --write"
These run before test validation and commit. You can customize the command, just leave the placeholders, as-is.
Lint and formatting hooks are not yet supported for Python projects. Generated test files follow standard pytest conventions.
๐ Where are test files placed?โ
- JavaScript / TypeScript
- Python
You control this via --test-structure:
siblingFolderโ next to sourcerootFolderโ inside roottests/folder
Test files are placed in .early.test/ sibling folders next to the source file:
src/
utils/
helpers.py
helpers.early.test/
test_my_function_early.py
test_another_function_early.py
Each testable function gets its own test file.
๐งช Can I run this locally?โ
- JavaScript / TypeScript
- Python
Yes. Example:
export API_KEY=...
export TOKEN=...
export HEAD_REF=my-branch
export AUTO_COMMIT=false
early generate-pr
Make sure your machine is configured to access your SCM.
Yes. Install the CLI and py-agent, then run:
npm install -g @earlyai/cli
pip install py-agent
export API_KEY=...
export TOKEN=...
export HEAD_REF=my-branch
export AUTO_COMMIT=false
export TEST_FRAMEWORK=pytest
early generate-pr
๐งฐ What if no tests are generated?โ
Possible reasons:
- All changed code is already covered
- Nothing testable in this PR
- Coverage failed to collect (JS/TS) or no testable functions found (Python)
โ ๏ธ Why did commit fail?โ
Most likely: the branch changed mid-run and your push was rejected.
Fix:
- Re-run the CLI
๐งฉ How does this differ from the GitHub Action?โ
| Option | Usage |
|---|---|
| GitHub Action | PR workflows in GitHub |
| Early CLI | Any CI/CD system |
Both produce identical output.
๐ฌ Still need help?โ
- ๐ฌ Email: support@startearly.ai
- Slack (for invited teams)