tool-versions
A Rust library for parsing and manipulating .tool-versions files used by asdf and compatible version managers.
Usage
use ToolVersions;
// Parse from string
let content = "erlang 26.2.1\nruby 3.3.0";
let tv = parse?;
// Get a tool's version
assert_eq!;
// Load from a file, modify, and save back
let mut tv = load?;
tv.set;
tv.save?;
// Load or create if the file doesn't exist
let mut tv = load_or_default?;
tv.set;
tv.save?;
Features
- Parse
.tool-versionsfiles preserving comments and blank lines - Get, set, and remove tool versions
- Round-trip editing (preserves file structure)
- Optional serde support with the
serdefeature
Serde Support
Enable the serde feature for serialization support:
[]
= { = "1.0", = ["serde"] }
License
This library is double-licensed under the MIT License and the Apache License, Version 2.0.
Copyright
(c) 2025-2026 Michael S. Klishin and Contributors.