简体中文 | English
EditPro is a fast, cross-platform text editing SDK and CLI for coding agents and vibecoding tools. The editing core is pure Go, byte-exact, dependency-free, and available everywhere Go can compile it.
- Replace one or every non-overlapping occurrence of exact text.
- Validate the expected match count before changing a file.
- Insert at file start, file end, before a line, or after a line.
- Preserve LF/CRLF line endings, with a raw byte insertion mode when required.
- Commit through a same-directory temporary file while preserving permissions.
- Reject symbolic-link destinations to avoid surprising link replacement.
- Use Go's architecture-optimized byte routines, including AVX2/SSE on amd64 and NEON on arm64 when available.
- Ship native CLI packages for npm, PyPI, and release archives.
With Go:
go install github.com/startvibecoding/editpro/cmd/editpro@latestWith npm:
npm install --global @startvibecoding/editproWith pip or pipx:
pipx install editpro
# or: pip install editproReplace all matches while verifying that the source occurs exactly twice:
editpro edit -file main.go -old oldName -new newName -expect 2Insert before line 10, preserving the file's detected line ending:
editpro insert -file main.go -at before -line 10 -text '// generated'Read from stdin and write to stdout:
editpro edit -file - -old oldName -new newName < main.go > updated.goUse -old-file, -new-file, or -text-file for multiline or arbitrary content. Use -dry-run to print a result without changing a file and -json for machine-readable operation metadata.
See the CLI reference.
package main
import "github.com/startvibecoding/editpro"
func update(source []byte) ([]byte, error) {
result, err := editpro.Replace(
source,
[]byte("oldName"),
[]byte("newName"),
editpro.ReplaceOptions{ExpectedMatches: 1, RequireMatch: true},
)
if err != nil {
return nil, err
}
return result.Data, nil
}The in-memory API has no filesystem side effects. EditFile and InsertFile provide safe file commits. See the SDK reference.
Release archives and npm packages cover Linux amd64/arm64/loong64/ppc64le/s390x/riscv64, macOS amd64/arm64, Windows amd64/arm64, FreeBSD amd64/arm64, OpenBSD amd64/arm64, and NetBSD amd64.
PyPI wheels cover Linux amd64/arm64/ppc64le/s390x, macOS amd64/arm64, and Windows amd64/arm64. Platforms without widely portable wheel tags remain available through npm, Go installation, or release archives.
make check
make race
make bench
make build-all VERSION=0.1.0
make dist VERSION=0.1.0Local package verification:
make npm-pack VERSION=0.1.0
make pypi-check VERSION=0.1.0Publishing is documented separately and requires registry credentials. See Release and packaging.