IPLD-CAR & CLI
A Rust implementation of the CAR v1 formats (well only Dag-pb at the moment), designed for reading and writing content-addressable archives without external IPFS infrastructure.
This workspace contains two crates:
ipld-car— library for reading and writing CAR files, with an optional filesystem interface backed by thevfstrait.carcli— command-line tool for inspecting and extracting CAR files.
Library — ipld-car
Filesystem interface
CarFs<T> wraps a ContentAddressableArchive and implements vfs::FileSystem, giving you a familiar, path-based API over the archive contents.
use ;
use FileSystem;
use File;
let fs = from;
// Read a directory
for entry in fs.read_dir?
// Stream a file to stdout
let mut reader = fs.open_file?;
copy?;
You can also build an archive:
use ;
use FileSystem;
use ;
let fs = from;
fs.create_dir?;
let mut file = fs.create_file?;
write!?;
// NOTE: the block is committed to the CAR on `drop`.
drop;
// Extract the CAR from the FS wrapper and write to disk.
let mut car = fs.into_inner.unwrap;
car.write?;
Features
| Feature | Default | Description |
|---|---|---|
std |
✓ | Standard library support, CBOR header, vfs |
vfs |
✓ | CarFs<T> and vfs::FileSystem impl (enabled by std) |
cli |
Exposes Config as clap::Args |
|
jumbo-chunks |
Enables chunk sizes from 1 MiB up to 512 MiB | |
test_helpers |
Exposes test utilities for downstream crates |
CLI — carcli
Installation
Commands
info — archive summary
File: archive.car
Blocks: 4
Roots: 1
Non-roots: 3
Total DAG-PB: 208B
Total Data: 43B
[0] bafybeietjm63oynimmv5yyqay33nui4y4wx6u3peezwetxgiwvfmelutzu
ls — list directory contents
The -T flag renders the full directory tree; -B shows exact byte counts instead of SI prefixes:
Permissions Size User Group Date Modified Name
drwxr-xr-x - alice staff 2026-03-12T18:45:02Z └── subdir/
.r--r--r-- 31B alice staff 2026-03-12T18:45:02Z ├── ascii.txt
.r--r--r-- 12B alice staff 2026-03-12T18:45:02Z └── hello.txt
cat — print a file
hello world
Streams directly to stdout, so it composes naturally with other Unix tools:
|
create — pack a directory or file into a CAR file
Recursively adds a local directory or file, preserving the directory structure:
write — pack individual files into a CAR file
Adds specific files at explicit destination paths using DEST=SRC mappings:
License
MIT