Skip to main content

⚙️ Configuration Options — early generate-commit

The early generate-commit command supports customization via CLI flags or environment variables. This page covers the required and optional settings for commit-based workflows.


🔑 Required Inputs

VariableCommand Line FlagDescriptionRequiredDefault
API_KEY-k, --api-keyEarly AI API key. See API Key Setup✅ Yes
TOKEN-t, --tokenSource control token. See Token Requirements✅ Yes
REF_NAME--ref-nameThe branch name of the commit.✅ Yes
COMMIT_HASH--commit-hashThe SHA of the commit to analyze.✅ Yes
NODE_OPTIONS(env only)Node memory setting. See Memory Tuning⚠️ Optional--max-old-space-size=5120

⚙️ Optional Inputs

VariableFlagDescriptionDefault
TEST_STRUCTURE-s, --test-structureFolder structure: siblingFolder or rootFolder.siblingFolder
TEST_FRAMEWORK-f, --test-frameworkTest framework: jest, mocha, etc.jest
TEST_FILE_SUFFIX--test-suffixTest file suffix (e.g. test, spec).test
TEST_FILE_NAMING--test-file-namingNaming style: camelCase, snake_case, kebab-case.camelCase
CHANGED_METHODS_ONLY--changed-methods-onlyGenerate tests for changed code only. See Changed methods onlytrue
MAX_TESTABLES--max-testablesMAX number of methods to generate tests for. See MAX testables5
SKIP_COVERAGE_AFTER--skip-coverage-afterSkip calculating coverage after test generation. See Skip coverage afterfalse
MAX_CONCURRENCY-c, --max-concurrencyParallel workers (1–4). See Concurrency Guide1
AUTO_COMMIT--auto-commitCommit generated files: true or false.true
TEST_COMMAND--test-commandCustom test run command.See Agent Jest Commands →
COVERAGE_COMMAND--coverage-commandCustom coverage collection command.See Agent Jest Commands →
CONTINUE-ON_TEST_ERRORS--continue-on-test-errorscontinue the operation if current tests fail.See Agent Jest Commands - tests fail →
LINT_COMMAND--lint-commandLinting command. See Lint & Formatnpx --no eslint $early_filename --fix
PRETTIER_COMMAND--prettier-commandPrettier formatting command. See Lint & Formatnpx --no prettier $early_filename --write
GIT_USER_EMAIL--git-user-emailGit email for commits.217573370+Early-Agent[bot]@users.noreply.github.com
GIT_USER_NAME--git-user-nameGit name for commits.
SCM_PROVIDER--scm-providergithub, bitbucket, etc. See SCM Supportgithub

💡 Example: Full CLI Invocation

early generate-commit \  
--commit-hash abcd1234 \
--ref-name main \
--test-framework mocha \
--test-structure __tests__ \
--test-suffix spec \
--test-file-naming kebab-case \
--max-concurrency 1 \
--auto-commit false \
--test-command "npm run test" \
--coverage-command "npm run coverage" \
--lint-command "npm run lint" \
--prettier-command "npm run format" \
--git-org earlyai \
--git-repo pull-request-test-generation \
--git-user-email ci@earlyai.com \
--git-user-name "Early Bot" \
--scm-provider github

🔐 Token Requirements

  • ✅ Use a classic PAT with repo scope (recommended)
  • 🟡 Fine-Grained PATs require Contents, Pull Requests, and Metadata (Read/Write)

✅ Best Practices

  • Set environment variables in CI to reduce CLI verbosity
  • Use NODE_OPTIONS="--max-old-space-size=5120" if concurrency is 3+
  • Include lint and format commands for clean commits
  • Configure SCM provider explicitly if not using GitHub

📚 Next Steps