firstlight
firstlightv0.3.0MIT
Run lint, typecheck, and tests in parallel for a coding agent, and return at the first failure.
Install
npm install firstlightfirstlight is a parallel check runner for coding agents. An agent runs lint, typecheck, and tests through it.
It starts every check at the same time and returns as soon as the first one fails, so the agent can start on the fix.
The other checks keep running in the background, and the agent reads their results later.
A check is any shell command, so the project does not need Node or a package.json. Only firstlight itself needs Node.
firstlight never writes into the repository it checks.
Features
Section titled “Features”- Arguments like
run-p.firstlight run lint typecheck testrunspackage.jsonscripts,"lint:*"matches scripts by pattern, and an argument with a space, such as"bundle exec rspec", is a shell command. - Diagnostics in one shape. For
tsc,vitest,node --test, andarchstrict, a failed check printsfile:line:col rule messagelines before a 10-line log tail. A command joined by&&, liketsc --noEmit && vitest run, gets the parser of each tool in order. - Reused passes. A check that passed on the same working tree with the same command does not run again. The key comes from the git tree hash, the command, and the keys of its
afterchecks, and--no-cacheruns every check. - Only new failures.
firstlight results --new --waitexits 1 only for a failure that the previous run did not have, so a project with known failures can still gate a change. - Run what failed.
firstlight run --failedruns only the checks that did not pass in the latest run. Once every check is done and one failed, it is the next command thatresultsandfollowprint. - Time left. A running check shows about how long it has left, based on earlier passes.
firstlight followprints each status change as it happens, and--jsonprints JSON Lines.
How an agent uses it
Section titled “How an agent uses it”- Start the checks with
firstlight run lint typecheck test. It returns at the first failed or timed-out check, with that check’s diagnostics, the status of every other check, and the next command. - Fix the failure while the other checks continue.
- Read the rest with
firstlight results --wait, or watch each check finish withfirstlight follow. - Run only what did not pass with
firstlight run --failed, the next command printed once every check is done and one failed. A new run cancels anything left from step 1.
When firstlight itself fails, it prints one JSON object on stderr with a do field that names the next command.
Getting started
Section titled “Getting started”firstlight needs Node.js 24 or newer. On an older Node, every command stops before it does anything and prints an error with exit code 1.
npm i -D firstlightnpx firstlight --helpnpx firstlight runWithout firstlight.json, firstlight run runs whichever of the package.json scripts lint, typecheck, test, and archstrict exist, and names other check-like scripts, such as check:architecture, on a not run: line.
To choose the checks, let firstlight init propose a firstlight.json, read it, then write it with --write:
npx firstlight init typecheck test check:architecturenpx firstlight init typecheck test check:architecture --writeA firstlight.json can name its own checks, with after for order and timeoutSec for a time limit.
Works with
Section titled “Works with”- When vitest uses the depug reporter, firstlight attaches depug’s evidence path and rerun command to each failed test’s diagnostic.
- firstlight reads the text of archstrict
checkas diagnostics, and runs anarchstrictscript by default when thepackage.jsonhas one.