Bethkit is a Rust workspace for reading, writing, and inspecting Bethesda plugin and archive formats. The project is in active development, and its public APIs may still change before a stable release.
Skyrim Special Edition is the current schema-backed target. The lower-level format APIs also model other Bethesda games, but Bethkit release builds currently include only the Skyrim Special Edition schema.
bethkit-ioprovides bounded cursors, memory-mapped input, and compression support.bethkit-coreprovides schema-independent plugin parsing, writing, patching, string tables, load-order handling, and record caches.bethkit-schemaloads versioned schema packages and optional build-time catalogs.bethkit-semanticprovides schema-guided views, editing, validation, references, conflicts, and cleaning operations.bethkit-bsareads and writes supported BSA and BA2 archive variants.bethkit-ffiexposes the Rust functionality through a C ABI and the checked-inbethkit.hheader.
Bethkit does not store generated schema packages in Git. The release workflow downloads only skyrim_se.bkschema from xDump v0.1.0, verifies its pinned SHA-256 value, embeds it in the release FFI libraries, and includes the standalone package in each platform archive. Ordinary local workspace builds remain schema-free unless the Skyrim schema feature and a verified package path are supplied explicitly.
The definitions originate in the xEdit project. Modding-Forge/xDump pins the upstream xEdit source, builds the exporter, audits the conversion rules, validates the result, and publishes the package consumed by Bethkit.
See SCHEMA.md for provenance, measured coverage, validation results, and current limitations.
- Schema provenance and coverage
- Local build setup
- Generate the Rust API reference locally with
cargo doc --workspace --no-deps. - The C ABI is declared in
crates/bethkit-ffi/bethkit.h.
Python bindings are maintained separately in Modding-Forge/bethkit.py.
The projects below solve overlapping problems with different APIs and tradeoffs. This table is intended as orientation, not as a ranking.
| Project | Primary form | Schema approach | Practical focus |
|---|---|---|---|
| Bethkit | Rust crates and C ABI | Runtime schema packages; release builds currently embed Skyrim Special Edition only | Embeddable plugin, archive, and semantic operations |
| xEdit | Delphi desktop application and command-line modes | Upstream definitions covering Bethesda record formats and editor behavior | Interactive inspection, conflict analysis, cleaning, editing, and reference behavior |
| Mutagen | .NET libraries | Generated, statically typed record APIs | C# mod inspection and patcher development |
| sse-plugin-interface | Python package | Skyrim Special Edition-oriented Python model | Lightweight Python access for Skyrim plugin workflows |
Bethkit does not replace xEdit as a reference implementation or interactive modding tool. Its current schema-backed Skyrim support exists because xEdit's definitions can be exported and consumed by a smaller embeddable runtime.
Bethkit targets stable Rust and edition 2021.
cargo build --workspace
cargo lint
cargo test --workspace
Tests that require installed game data skip automatically when their local fixtures are unavailable. See local build setup for the optional live-test configuration.
Apache-2.0