Skip to main content

❓ 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?​

CommandUse CaseRequires PR ContextTypical CI
generate-prGitHub PR-based workflowsβœ… YesGitHub Actions (PR)
generate-commitCommit-based workflows (no PR)❌ NoJenkins, 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 files
  • rootFolder β†’ places tests under a global xtests/x directory

πŸ“¦ Why won’t the CLI install?​

See How to install CLI β†’


πŸ” What tokens do I need?​

See Token requirements β†’


πŸ”‘ Where do I get my API key?​

See How to get your API key β†’


πŸ’¬ Still stuck?​

Reach out: