devpreflight
v1.0.1
Published
Zero-config developer environment pre-flight CLI — checks your machine against a repo's requirements and auto-fixes what it can.
Maintainers
Readme
██████╗ ███████╗██╗ ██╗██████╗ ██████╗ ███████╗███████╗██╗ ██╗ ██████╗ ██╗ ██╗████████╗
██╔══██╗██╔════╝██║ ██║██╔══██╗██╔══██╗██╔════╝██╔════╝██║ ██║██╔════╝ ██║ ██║╚══██╔══╝
██║ ██║█████╗ ██║ ██║██████╔╝██████╔╝█████╗ █████╗ ██║ ██║██║ ███╗███████║ ██║
██║ ██║██╔══╝ ╚██╗ ██╔╝██╔═══╝ ██╔══██╗██╔══╝ ██╔══╝ ██║ ██║██║ ██║██╔══██║ ██║
██████╔╝███████╗ ╚████╔╝ ██║ ██║ ██║███████╗██║ ███████╗██║╚██████╔╝██║ ██║ ██║
╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝Your environment. Pre-flighted. In seconds.
Stop losing days to "it works on my machine."
devpreflightscans any repo, tells you exactly what's broken in your environment, and fixes it — all in one command.
✦ What it does
$ devpreflight check
devpreflight — pre-flight environment check
Runtime Versions
✗ Node.js required 18.17.0 found 16.20.0
→ Run: nvm use 18.17.0
✓ Python 3.11.4 (required 3.11)
Environment Variables
✗ DATABASE_URL Missing (required)
→ Add to your .env file or export in your shell.
✗ REDIS_URL Missing (required)
✓ NODE_ENV Present
Dependencies
✗ node_modules not installed
→ Run: npm install
Services
✗ postgres (port 5432) Not reachable at localhost:5432
→ Start the service or run: docker compose up -d
✓ redis (port 6379) Reachable at localhost:6379
3 critical · 0 warnings · 3 passed
Run devpreflight fix to auto-fix what's possible.✦ Install
npm install -g devpreflightRequires Node.js 18+
✦ Commands
| Command | Description |
|---|---|
| devpreflight check | Run all checks. Auto-detects project requirements. (default) |
| devpreflight fix | Interactively apply safe auto-fixes |
| devpreflight fix --yes | Apply all fixes without confirmation (scripts/CI) |
| devpreflight init | Write a .devpreflight.json manifest for your team |
| devpreflight ci | Check + exit code 1 on any critical failure |
| devpreflight check --json | Machine-readable JSON output |
✦ Zero Config
Drop it in any repo — no setup needed. It reads your existing files:
.nvmrc / .node-version → Node.js version requirement
.python-version / Pipfile → Python version requirement
go.mod → Go version requirement
.ruby-version / Gemfile → Ruby version requirement
.env.example / .env.sample → Required environment variables
docker-compose.yml / compose.yml → Services + ports to probe
package-lock.json / yarn.lock → Dependency freshness✦ Auto-Fix
devpreflight fix applies safe, reversible fixes — nothing destructive, ever.
devpreflight fix What can be fixed automatically:
✓ Switch Node.js version via nvm or fnm
✓ Copy .env.example → .env (never overwrites existing values)
✓ Merge new keys from .env.example into an existing .env
✓ Run npm install / yarn install / pnpm install
✓ Run pip install -r requirements.txt
✓ Run go mod download
What it will NEVER do:
✗ Overwrite a secret value already in your .env
✗ Install nvm or fnm for you
✗ Run any destructive command without your confirmation✦ Team Manifest
Lock your environment requirements in a file your whole team can use:
devpreflight init # generates .devpreflight.json from your current env{
"$schema": "https://raw.githubusercontent.com/devpreflight-cli/devpreflight/main/schema.json",
"runtimes": [
{ "name": "node", "requiredVersion": "18.17.0" },
{ "name": "python", "requiredVersion": "3.11" }
],
"tools": [
{ "name": "terraform", "installHint": "https://developer.hashicorp.com/terraform/install" },
{ "name": "aws", "installHint": "https://aws.amazon.com/cli/" }
],
"services": [
{ "name": "postgres", "host": "localhost", "port": 5432 },
{ "name": "redis", "host": "localhost", "port": 6379 }
],
"envVars": [
{ "name": "DATABASE_URL", "required": true, "description": "PostgreSQL connection string" },
{ "name": "SENTRY_DSN", "required": false, "description": "Optional error reporting" }
]
}Commit .devpreflight.json alongside your code. New team members run one command and know exactly what to fix.
✦ CI Integration
GitHub Actions
- name: Environment pre-flight check
run: npx devpreflight ciWith JSON output for structured logs:
- name: Environment pre-flight check
run: npx devpreflight ci --json | tee devpreflight-report.jsonGitLab CI
preflight:
stage: .pre
script:
- npx devpreflight ciPre-checkout hook
# .git/hooks/post-checkout
npx devpreflight check✦ Checkers
| Checker | What it checks |
|---|---|
| Node.js | Version against .nvmrc, .node-version, engines.node |
| Python | Version against .python-version, Pipfile, pyproject.toml |
| Go | Version against go.mod |
| Ruby | Version against .ruby-version, Gemfile |
| Docker | Daemon running, Compose version, v1 vs v2 |
| Env Vars | All keys in .env.example present in env or .env |
| Packages | node_modules installed + lockfile freshness; venv + pip check; go.sum |
| Ports | TCP reachability of services from docker-compose.yml or manifest |
| Tools | Any CLI tool listed in .devpreflight.json |
✦ Known Limitations
- Port checks use raw TCP — services behind VPN tunnels may show false negatives
- Node version switching requires
nvmorfnmto already be installed .envmerge adds keys with empty values; distribute secrets via Doppler, 1Password, or AWS Secrets Manager- On Windows,
nvmshell integration differs — the fixer runs withshell: trueto handle this
✦ License
MIT © zmrishh
