Skip to main content

Crate agentvfs

Crate agentvfs 

Source
Expand description

agentvfs - Virtual filesystem CLI backed by embedded databases.

This library provides a virtual filesystem abstraction that stores files in an embedded database (SQLite by default). It supports multiple independent vaults, content-addressable storage with deduplication, and familiar filesystem operations.

§Example

use std::sync::Arc;
use agentvfs::storage::{BackendType, VaultBackend};
use agentvfs::fs::FileSystem;

// Open a storage backend
let backend = Arc::new(
    VaultBackend::open(std::path::Path::new("my.avfs"), BackendType::Sqlite).unwrap()
);

// Create filesystem
let fs = FileSystem::new(backend);

// Create directories and files
fs.create_dir("/docs").unwrap();
fs.write_file("/docs/hello.txt", b"Hello, World!").unwrap();

// Read file contents
let content = fs.read_file("/docs/hello.txt").unwrap();
assert_eq!(content, b"Hello, World!");

Re-exports§

pub use error::Result;
pub use error::VfsError;

Modules§

cache
In-memory cache layer using rkyv for zero-copy serialization.
commands
CLI command implementations.
error
Error types for avfs operations.
fs
Virtual filesystem operations.
runtime
Runtime services for proxy execution and workspace orchestration.
shell
Interactive shell module for vfs.
storage
Storage backend abstraction layer.
vault
Vault management module.