โ 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 โ.
๐ What permissions do tokens need?โ
There are two tokens:
1. NPM_TOKEN โ for installing the CLIโ
Used with GitHub Packages.
See Install Token โ
2. 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
๐งช Which test frameworks are supported?โ
- โ Jest (required today)
- ๐ก Vitest (coming soon)
- โช Mocha (planned)
๐ What coverage threshold is used?โ
Currently fixed at 0%.
Only functions with zero coverage will be targeted.
โ๏ธ How do I handle memory issues?โ
If you hit a heap error:
export MAX_CONCURRENCY=2
Or:
export NODE_OPTIONS="--max-old-space-size=5120"
๐งฉ Can I override the coverage or test commands?โ
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 โ
๐งพ How does auto-commit work?โ
When AUTO_COMMIT=true:
- Tests are committed to the branch
- Only passing, valid tests are committed
To disable:
export AUTO_COMMIT=false
๐งน What if my repo enforces lint/format rules?โ
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.
๐งช Can I run this locally?โ
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.
๐งฐ What if no tests are generated?โ
Possible reasons:
- All changed code is already covered
- Nothing testable in this PR
- Coverage failed to collect
โ ๏ธ 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)