SuperAPI AI Directory

batchai

A supplement to Copilot and Cursor - utilizes AI for batch processing of project codes

Open website

About this tool

batchai is a complementary tool to Copilot and Cursor that uses AI to batch-process an entire project's code. Its goal is: run a single command to scan and process the entire codebase, letting AI perform batch tasks, such as automatically finding and fixing common defects, or generating unit test code. It is similar to AI-driven SonarQube error checking. In essence, batchai complements tools like Copilot and Cursor by eliminating the need to copy and paste between chat windows, open files, or manually add files to the AI context, making the process more efficient.

Main capabilities:

  • Batch code checking: report issues to the console, save them as a check report, and afterward optionally fix the code directly.
  • Batch test code generation.
  • Custom prompts.
  • File ignoring: specify files to ignore, while also respecting .gitignore and an additional .batchai_ignore file.
  • Target specification: allows specifying target directories and files within a Git repository.
  • Implemented in Go: produces a single executable binary that runs on Mac OSX, Linux, and Windows.
  • Diff: displays colored diffs in the console.
  • LLM support: supports OpenAI-compatible LLMs, including Ollama.
  • I18N: supports internationalized comment/description generation.

Planned features: currently batchai only supports batch code checking and generating unit test code. Planned features include code explanation and comment generation, refactoring, etc., all handled in batch mode. Another goal is to build a cross-file code symbol index so that batchai can understand projects more broadly and help AI work more effectively.

Usage: download the latest executable binary from the releases page and add it to $PATH. On Linux and Mac OSX, chmod +x is required to make it executable. Clone the demo project (the example directory is /data/spring-petclinic), create a .env file in that directory and set OPENAI_API_KEY; for Ollama, refer to the example docker-compose.yml.

CLI examples: Report issues to the console (also saved to build/batchai): cd /data/spring-petclinic batchai check . src/main/java/org/springframework/samples/petclinic/vet/Vets.java

Directly fix the target file via the --fix option: cd /data/spring-petclinic batchai check --fix . src/main/java/org/springframework/samples/petclinic/vet/Vets.java

Run only on the main Java code: cd /data/spring-petclinic batchai check . src/main/java/

Run on the entire project: cd /data/spring-petclinic batchai check .

Generate unit test code for the entire project: cd /data/spring-petclinic batchai test .

Tested and supported models:

  • OpenAI series: openai/gpt-4o, openai/gpt-4o-mini; other OpenAI models should also work.
  • Alibaba Tongyi Qianwen Qwen series (also available via Ollama): qwen2.5-coder-7b-instruct, qwen2.5-coder:7b-instruct-fp16; other Qwen models should also work.

To add more LLMs, simply follow the configuration in res/static/batchai.yaml, as long as the LLM exposes an OpenAI-compatible API.

Optional configuration file: you can provide an optional configuration file ${HOME}/batchai/batchai.yaml; for a complete example, see res/static/batchai.yaml.

Environment file: batchai can also be configured via a .env environment file located in the target Git repository directory. For all available environment variables, see res/static/batchai.yaml; for default values, see res/static/batchai.env.

Ignoring specific files: batchai ignores directories and files that follow the .gitignore file, which is usually sufficient; if there are additional files or directories that cannot be ignored by Git but should not be processed by batchaiRules can be specified in the .batchai_ignore file, with the same syntax as .gitignore.

Custom prompts: refer to BATCHAI_CHECK_RULE_* and MY_CHECK_RULE_* in res/static/batchai.yaml.

Use cases: suitable for batch-executing code checks, fixing common issues, generating unit test code, and other tasks in Git repositories, especially for developers who want to reduce manual copy-pasting and improve batch-processing efficiency.

Limitations: LLM hallucinations are unavoidable. To prevent AI from mistakenly overwriting existing changes, batchai is designed to work only in clean Git repositories; if there are unstaged files, batchai will refuse to execute. This way, you can confirm the changes made by batchai via git diff, and if there are errors, you can revert them directly. In addition, because OpenAI costs are relatively high, the demo site uses the open-source model qwen2.5-coder:7b-instruct-fp16 running on its own Ollama instance. Its performance is not as good as gpt-4o-mini, and due to resource limitations, tasks will be executed in a queue. Other specific information such as fees, pricing, and platform details is not yet provided.