Local-first CLI for checking whether a JavaScript or TypeScript repository is actually ready to work in.
repo-preflight is a local-first CLI for quickly answering a practical question:
Is this JavaScript or TypeScript repo actually ready to work in?
It scans the target repository, reports the signals that matter most, and ends with a clear verdict:
ReadyReady with warningsNot ready
The tool is designed to stay calm on healthy repos, avoid noisy false alarms, and keep every result actionable.
- Fast local scan with no network dependency
- Clear
PASS,INFO,WARN, andFAILchecks - Final readiness verdict plus summary counts
- Smarter heuristics for scripts and env files
- Install-state detection for
node_modulesand Yarn Plug'n'Play - Optional workspace scanning for monorepos
- Human-readable text output and machine-friendly JSON output
npm install -g repo-preflightOr run it without installing globally:
npx repo-preflight .Scan the current repository:
repo-preflight .Scan another repository:
repo-preflight /path/to/repoScan a workspace root and include workspace packages:
repo-preflight . --workspacesEmit JSON:
repo-preflight . --jsonShow concise CI-friendly output:
repo-preflight . --ciUse a specific config file:
repo-preflight . --config ./repo-preflight.config.jsonWhen --config is provided, relative paths are resolved from the shell's current working directory.
repo-preflight currently checks:
package.jsonpresence and readability- Node version against
engines.node - package manager detection
- expected lockfile presence
- dependency install state via
node_modulesor Yarn Plug'n'Play markers - expected scripts such as
dev,build, andtest - common env-file presence when repo signals suggest they matter
PASS: the expected signal is present and looks goodINFO: useful context that should not make the repo feel unhealthyWARN: a meaningful issue that is likely worth fixingFAIL: a strong blocker or invalid setup
INFO checks do not affect the exit code.
- any
FAIL=>Not ready - no
FAILand at least oneWARN=>Ready with warnings - otherwise =>
Ready
Exit code behavior:
- exit code
1when any check isFAIL - exit code
0otherwise
Missing scripts are not warned blindly:
- missing
devis usually more important for app-like repos - missing
devis often only informational for library-like repos - missing
buildbecomes more important when build tooling is present - missing
testbecomes more important when test tooling is present
Env files are also handled conservatively:
- no warning by default just because
.envis absent - warnings appear when stronger signals exist, such as
.env.example, env tooling, or script references to.env
By default, repo-preflight scans only the target root. If the repo is a workspace root, you can opt in to workspace package scanning with --workspaces.
Workspace detection currently supports:
package.jsonworkspacespnpm-workspace.yaml
When scanning workspaces, repo-preflight keeps the results focused on intended package roots. It honors negated workspace patterns such as !packages/turbo, filters accidental nested matches from broad globs inside common non-workspace containers such as __tests__, fixtures, and playground directories, and still preserves explicitly declared workspace paths even when they include names like examples or tests.
Package manager, lockfile, and install-state checks can still inherit from the workspace root where appropriate.
repo-preflight looks for repo-preflight.config.json in the target directory unless you pass --config.
If you do pass --config, the path is resolved relative to the directory where you run the command, not relative to the scanned repo.
Example:
{
"checks": {
"scripts": true,
"envFiles": true
},
"expectations": {
"scripts": ["build", "test"],
"envFiles": [".env.example", ".env.local"]
},
"workspaces": {
"scan": true
},
"output": {
"format": "text"
}
}Also included in the repo: repo-preflight.config.example.json
Repo Preflight
Target: /path/to/repo
Root: my-app
Path: /path/to/repo
PASS Found package-lock.json for npm.
INFO Missing dev script.
WARN node_modules is missing.
Verdict: Ready with warnings
Summary: 1 pass, 1 info, 1 warn, 0 fail
You can also use the scanner programmatically:
import { runPreflight } from "repo-preflight";
const report = await runPreflight(process.cwd(), {
workspaces: true,
json: false,
});
console.log(report.verdict);Build:
npm run buildTest:
npm testType-check without emitting:
npm run typecheckRun the local verification bundle:
npm run check- Node.js
20+is required - the package ships compiled output from
dist/ - CI runs on Linux, macOS, and Windows for Node.js
20,22, and24 prepublishOnlyruns the test suite before publish- published releases are available on npm as
repo-preflight