Your API integrations, invisibly mended.
Vendors change their APIs. Your code keeps calling them the old way. darnit finds the exact lines, rewrites them, runs your tests, and opens the pull request.
npm install -g darnit
Or skip the install: npx darnit check. Needs Node 22.12 or newer.
| Rev | Description | Status |
|---|---|---|
| A | max_ on OpenAI chat completions | Superseded |
| B | max_rewritten by darnit | Tests passed |
A real run, verbatim.
One repo, one OpenAI change. check finds it, fix mends it, your tests approve it.
No change: the same file also calls anthropic.messages.create({ max_tokens: 1024 }). darnit leaves it alone. That one is correct.
How it works
Find
darnit checklists every call site a vendor change affects, with the file, the line and the vendor's own announcement.Fix
darnit fixrewrites them with rules proven in CI, then shows you the diff. Add--prfor one pull request per change.Prove
It runs your build and your tests. If either breaks, your files go back and it tells you which one.
Why you can trust the pull request
- Every rewrite is a rule proven in CI before it ships. Same rule, same result, in every repo.
- Checks your SDK version before touching anything. Too old: it stops and names the upgrade.
- Runs your build and tests, and puts the files back if either breaks.
- Lists what it couldn't fix as
needs a human: file:lineinstead of pretending. - One pull request per change. Never force-pushes, never pushes to your default branch.
What it covers today
Fixes 1 OpenAI change, reports more, watches weekly. Small on purpose: a change gets a rewrite only when the rewrite is proven.
| Vendor | Status | What that means |
|---|---|---|
| OpenAI | Supported | Change records and rewrites |
| Anthropic, Stripe, Twilio | Recognized | darnit init finds them; no change records yet |
Reads JavaScript, TypeScript and Python. Runs on macOS and Linux. Want one covered? Open an issue.
Try it on your repo.
npx darnit check
Read-only. It lists what it finds and changes nothing. Install for good with npm install -g darnit.