β Frequently Asked Questions β Early Commit CLI
This page covers commit-specific behavior for early generate-commit.
For general questions (API keys, tokens, CLI install), see the Fundamentals FAQ β.
π What's the difference between generate-commit and generate-pr?β
| Command | Use Case | Requires PR Context | Typical CI |
|---|---|---|---|
generate-pr | GitHub PR-based workflows | β Yes | GitHub Actions (PR) |
generate-commit | Commit-based workflows (no PR) | β No | Jenkins, GitHub Actions (push) |
π§Ύ Can I use this CLI with Jenkins?β
Yes. generate-commit works well in Jenkins pipelines triggered by push or commit events.
Make sure to:
- Install the CLI via
npm install -g @earlyai/cli - Set required env vars:
API_KEY,TOKEN,COMMIT_HASH,REF_NAME
π§ͺ Do I need to collect coverage myself?β
No. The CLI calculates pre- and post-coverage automatically.
π§Ό Can I lint or format the output?β
Yes. Use these flags or env vars to run lint/format before commit:
--lint-command="npx --no eslint $early_filename --fix"
--prettier-command="npx --no prettier $early_filename --write"
These commands run after generation and before commit.
See Configuration β Formatting.
π Can I control where test files go?β
The CLI scans changed files in the commit.
To adjust how/where tests are written, use:
--test-structure--test-file-naming--test-suffix
For supported values, see Test File Settings.
π Can I control where test files go?β
Yes. Use --test-structure:
siblingFolderβ places tests next to source filesrootFolderβ places tests under a global xtests/x directory
π¦ Why wonβt the CLI install?β
π What tokens do I need?β
π Where do I get my API key?β
See How to get your API key β
π¬ Still stuck?β
Reach out:
- Email: support@startearly.ai
- Slack (if you're in our shared workspace)