Skip to main content

โ“ Frequently Asked Questions โ€” Repo CLI

This page covers common questions about using the early generate-for-project command to generate tests across an entire folder or file.


๐ŸŒ Which languages are supported?โ€‹

The Repo CLI supports:

  • JavaScript and TypeScript โ€” Jest, Mocha, and other frameworks
  • Python โ€” pytest (auto-detected)

The CLI automatically detects the project language from file extensions and project markers (e.g., package.json for JS/TS, pyproject.toml or requirements.txt for Python).


๐Ÿ How does the CLI know if my project is Python?โ€‹

The CLI auto-detects the language by inspecting the --target-directory:

  • If the target is a .py file, it's treated as Python
  • If the target folder contains Python project markers (pyproject.toml, setup.py, setup.cfg, requirements.txt), it's treated as Python
  • If the folder contains .py files, it's treated as Python

No --language flag is needed.


๐Ÿ”‘ Where do I get my API key?โ€‹

Contact support@startearly.ai to obtain your API key. Store it securely in your CI system (e.g., EARLY_API_KEY in GitHub Actions or Jenkins).

See: Central FAQ โ†’


๐Ÿ” What tokens are required?โ€‹

You need:

  • TOKEN for Git access (reading files, committing, commenting)

Details and permissions: Token Guide โ†’ FAQ reference: Central FAQ SCM โ†’ and Central FAQ SCM โ†’


๐Ÿงช Do I need to configure coverage myself?โ€‹

No. The CLI runs your test framework (e.g., Jest) to collect coverage. You can customize the command via --coverage-command and --test-command.

See: Optional inputs โ†’

More: Central FAQ Test Frameworks โ†’


๐Ÿ“ฆ Can I use this in Jenkins or other CI/CD?โ€‹

Yes โ€” the CLI supports GitHub Actions, Jenkins, CircleCI, GitLab, and more.

See CI examples Integration Guide - GitHub example โ†’ and Jenkins example โ†’


๐Ÿ“ Where are test files placed?โ€‹

You control this via --test-structure:

  • siblingFolder โ†’ next to source
  • rootFolder โ†’ inside root tests/ folder

๐Ÿงช Can I run this manually?โ€‹

Yes โ€” you can run it locally or via npx:

npx @earlyai/cli generate-folder \
--folder ./src \
--ref-name main \
--token $TOKEN \
--api-key $API_KEY

Your machine needs to be configured to work with git and your SCM.


๐Ÿงน What about Prettier or ESLint?โ€‹

Note: This applies to JavaScript/TypeScript projects only. Python does not yet support lint/format hooks.

Define:

LINT_COMMAND="npx --no eslint $early_filename --fix"
PRETTIER_COMMAND="npx --no prettier $early_filename --write"

Reference: Central FAQ - Lint Formatting โ†’


๐Ÿงต How is this different from generate-pr or generate-commit?โ€‹

CommandUse CaseRequires PR ContextTypical Use
generate-prPer-pull-request generationโœ… YesGitHub PRs
generate-commitFor single commitsโŒ NoGitHub push, Jenkins
generate-for-projectRepo folder-based generationโŒ NoCoverage campaigns

Compare: When to Use Which Agent โ†’


๐Ÿ†˜ Still need help?โ€‹