You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-14Lines changed: 53 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@
24
24
</div>
25
25
26
26
<palign="center">
27
-
JAIPilot is a zero-config test safety harness for Java Maven projects. It runs JaCoCo coverage checks and PIT mutation testing, then prints an actionable <code>PASS</code> or <code>FAIL</code> report for humans and coding agents.
27
+
JAIPilot is a Java CLI for backend-assisted JUnit generation and zero-config verification. It can call the JUnit LLM backend to generate or fix tests, then run JaCoCo and PIT checks to validate the result.
28
28
</p>
29
29
30
30
<hr />
@@ -37,6 +37,7 @@ It is designed to work alongside Claude Code, Cursor, Codex, and similar tools.
37
37
38
38
## Why JAIPilot
39
39
40
+
- Backend-assisted JUnit test generation and fix flows
40
41
- Zero-config JaCoCo and PIT verification for Java Maven projects
41
42
- A test safety harness for AI-assisted coding and refactoring
42
43
- Actionable output with exact coverage gaps and mutation failures
@@ -47,19 +48,16 @@ This follows the idea described in [AI is forcing us to write good code](https:/
@@ -96,12 +108,12 @@ For many teams, that means starting above 80% for the existing codebase and push
96
108
97
109
## Use With Coding Agents
98
110
99
-
JAIPilot works best as the verification loop around an agent. Ask Claude Code, Cursor, Codex, or another coding agent to keep running `jaipilot verify`, inspect failures, improve tests, and repeat until the project passes with coverage as high as possible.
111
+
JAIPilot works best as a tight generation-and-verification loop around an agent. Ask Claude Code, Cursor, Codex, or another coding agent to generate or fix tests with JAIPilot, then keep running `jaipilot verify` until the project passes with coverage as high as possible.
100
112
101
113
Example prompt:
102
114
103
115
```text
104
-
Keep running `jaipilot verify` and update tests until you reach 80% (or 100%).
116
+
Use `jaipilot generate` or `jaipilot fix` to update tests, then keep running `jaipilot verify` until you reach 80% (or 100%).
105
117
```
106
118
107
119
<details>
@@ -119,9 +131,35 @@ JAIPilot gives coding agents a concrete feedback loop. Instead of guessing wheth
119
131
- Exact surviving mutations from PIT
120
132
- Concrete next actions
121
133
134
+
## JUnit LLM Commands
135
+
136
+
Sign in once before using the backend-assisted flows:
137
+
138
+
```sh
139
+
jaipilot login
140
+
```
141
+
142
+
`jaipilot generate` reads the class under test, infers the output test path and backend metadata, uses any existing test file at that path as the baseline `initialTestClassCode`, submits the request to `invoke-junit-llm-cli`, polls `fetch-job`, follows any requested `requiredContextClassPaths`, writes the returned `finalTestFile`, then runs local Maven `test-compile` and a targeted `test` for the generated class. If either phase fails, JAIPilot sends sanitized Maven output back through the backend `fix` flow and keeps iterating until the target test passes or `--max-fix-attempts` is exhausted.
143
+
144
+
`jaipilot fix` does the same, but it starts from the current test class as `initialTestClassCode`, sends an empty CUT payload to the backend fix flow, and automatically captures the first failing local Maven output before calling the backend.
145
+
146
+
Authentication commands:
147
+
148
+
-`jaipilot login` starts the browser flow and stores credentials in `~/.config/jaipilot/credentials.json` with owner-only filesystem permissions when the OS supports them.
149
+
-`jaipilot status` shows the current signed-in user and refreshes the access token if needed.
150
+
-`jaipilot logout` clears the stored session.
151
+
152
+
Common options:
153
+
154
+
-`JAIPILOT_JWT_TOKEN` can be used instead of a stored login session.
155
+
-`--output` overrides the inferred test file path when needed.
156
+
-`--maven-executable`, `--maven-arg`, `--timeout-seconds`, and `--max-fix-attempts` control the local compile-and-test loop after generation.
157
+
122
158
## How It Works
123
159
124
-
JAIPilot prepares a temporary mirrored Maven workspace, injects the required JaCoCo and PIT plugins there, runs the verification workflow, parses the generated reports, and prints a simplified summary for humans and agents.
160
+
For `generate` and `fix`, JAIPilot reads the local source files, calls the Supabase edge function, polls the async job endpoint, optionally resubmits requested context classes, uploads sanitized local Maven failure output when a fix pass is needed, and writes the returned test file into your project.
161
+
162
+
For `verify`, JAIPilot prepares a temporary mirrored Maven workspace, injects the required JaCoCo and PIT plugins there, runs the verification workflow, parses the generated reports, and prints a simplified summary for humans and agents.
125
163
126
164
The target project does not need JaCoCo or PIT configured in its own `pom.xml`.
127
165
@@ -131,6 +169,7 @@ The target project does not need JaCoCo or PIT configured in its own `pom.xml`.
131
169
- A Maven project
132
170
- JUnit 4 or JUnit 5 tests
133
171
- Maven available via `./mvnw` or `mvn`
172
+
- A JAIPilot login session or a valid `JAIPILOT_JWT_TOKEN` for backend-assisted `generate` and `fix`
0 commit comments