Skip to content

arioberek/editkit-ts

editkit-ts

CI npm version npm downloads License: MIT Bundle size

editkit — a robust LLM edit-format toolkit for TypeScript. Parse and apply SEARCH/REPLACE blocks, unified diffs, and whole-file edits with battle-tested fuzzy matching ported from aider.

npm i editkit
# or: pnpm add editkit / bun add editkit
import { applyEdits } from "editkit";

const results = await applyEdits(llmOutput, (path) => readFile(path, "utf8"));
for (const r of results) {
  if (r.ok) await writeFile(r.path, r.after);
}

Full library docs: packages/editkit/README.md.

Packages

Package Description Version
editkit The library. Parsers, applier, AI SDK adapter. npm
editkit-docs Documentation site (Fumadocs + Next.js). private

📖 Read the docs →

Examples

Example What it shows
agent-loop Aider's canonical test-fix loop. Deterministic mock LLM, runs offline.
ai-sdk-v5 Minimal streamEdits demo against OpenAI via the Vercel AI SDK.
mini-coding-agent Full coding-agent loop with multi-file streaming edits, mixed formats, and retry recovery.

New users — start with mini-coding-agent. It runs without an API key.

Repo layout

editkit-ts/
├── packages/
│   └── editkit/             # the published library
├── apps/
│   └── docs/                # Fumadocs documentation site
├── examples/
│   ├── agent-loop/
│   ├── ai-sdk-v5/
│   └── mini-coding-agent/
├── .changeset/              # release management (changesets)
├── .github/workflows/       # CI + release automation
├── turbo.json               # build orchestration
└── package.json             # bun workspaces root

Development

This repo uses Bun workspaces and Turborepo for build orchestration, and Changesets for releases.

bun install            # install workspace deps
bun run build          # turbo: build all packages (cached)
bun run test           # turbo: run all package tests (cached)
bun run typecheck      # turbo: typecheck all packages (cached)
bun run lint           # biome: lint the whole repo
bun run format         # biome: format the whole repo
bun run docs           # next dev for the docs site
bun run docs:build     # next build for the docs site

Run a task for a single workspace with --filter:

bunx turbo run test --filter=editkit
bunx turbo run build --filter=editkit-example-mini-coding-agent

Releases

Changes that should ship to npm need a changeset:

bun run changeset      # interactive — describe what changed

Commit the resulting .changeset/*.md file with your PR. When the PR merges to main, the release workflow opens (or updates) a "Version Packages" PR that bumps versions and generates the CHANGELOG. Merging that PR publishes to npm and creates a GitHub release.

Contributing

See CONTRIBUTING.md. All contributors are expected to follow the Code of Conduct.

Security issues: see SECURITY.md.

Changelog

See packages/editkit/CHANGELOG.md. Generated by Changesets — every release on npm has a matching entry plus a GitHub release.

Star history

Star history

License

MIT — see LICENSE. Portions of the SEARCH/REPLACE fuzzy-matching design are ports of aider's MIT-licensed code; see the package's LICENSE for the original copyright notice.

About

LLM edit-format toolkit for TypeScript: SEARCH/REPLACE blocks, unified diffs, whole-file edits with fuzzy matching ported from aider. AI SDK adapter included.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages