| Crates.io | jumprs |
| lib.rs | jumprs |
| version | 0.1.0 |
| created_at | 2026-01-05 05:32:16.793274+00 |
| updated_at | 2026-01-05 05:32:16.793274+00 |
| description | Unified API for reading directory jumper databases (zoxide, z, autojump, fasd) |
| homepage | |
| repository | https://github.com/thrashr888/jumprs |
| max_upload_size | |
| id | 2023174 |
| size | 40,557 |
Unified Rust API for reading and writing directory jumper databases.
| Tool | Database Location | Format |
|---|---|---|
| zoxide | ~/.local/share/zoxide/db.zo |
path|rank|timestamp |
| z | ~/.z |
path|rank|timestamp |
| autojump | ~/.local/share/autojump/autojump.txt |
rank\tpath |
| fasd | ~/.fasd |
path|rank|timestamp |
[dependencies]
jumprs = "0.1"
use jumprs::Database;
// Auto-detect the first available database
let db = Database::detect().expect("no jump database found");
// Search for directories matching a query
let results = db.search("proj");
for entry in results.iter().take(5) {
println!("{}: {:.0}", entry.path.display(), entry.frecency());
}
// Get the best match
if let Some(best) = db.best_match("proj") {
println!("Best match: {}", best.path.display());
}
use jumprs::{Database, Backend};
use std::path::PathBuf;
// Load or create a database
let mut db = Database::with_backend(Backend::Z).unwrap();
// Record a directory visit (updates rank and timestamp)
db.add_visit(PathBuf::from("/home/user/projects"));
// Save changes to disk
db.save().expect("failed to save database");
use jumprs::{Database, Backend};
// Use a specific backend
let db = Database::with_backend(Backend::Z).expect("z database not found");
// Get top directories by frecency
for entry in db.top_dirs(10) {
println!("{}", entry.path.display());
}
// Check which backend was detected
println!("Using backend: {:?}", db.backend());
| Method | Description |
|---|---|
detect() |
Auto-detect and load the first available database |
with_backend(backend) |
Load a specific backend's database |
new(backend) |
Create an empty database |
search(query) |
Search for directories matching query terms |
best_match(query) |
Get the highest-frecency match |
top_dirs(n) |
Get top N directories by frecency |
add_visit(path) |
Record a visit to a directory |
remove(path) |
Remove a directory from the database |
clean() |
Remove directories that no longer exist |
save() |
Save changes to disk |
When using Backend::Auto, jumprs checks for databases in this order:
The first available database is used.
Copyright 2026 Paul Thrasher
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.