How cloudflare/artifact-fs works
ArtifactFS is a Git-backed FUSE daemon that makes a repository tree available before downloading all file contents. The main workflow is CLI registration and daemon startup, repository preparation and snapshot publication, then filesystem access that hydrates requested blobs on demand; file changes are stored in an overlay. The README also documents async preparation, status/refresh operations, prioritized hydration, and any-Git-repository support. The graph reflects sampled wiring and documented capabilities; several internal preparation and FUSE details are represented at subsystem level because the excerpts are partial.
Main entry points: daemon.go Daemon service · ops.go FUSE filesystem · cli.go CLI commands · gitstore.go Git operations
Components 17
User interfaces
- CLI commands
internal/cli/cli.go - CLI entry
cmd/artifact-fs/main.go
Daemon and acquisition
- Daemon service
internal/daemon/daemon.go - Git operations
internal/gitstore/gitstore.go - HEAD watcher
internal/watcher/watcher.go - Credential redaction
internal/auth/redact.go - Structured logging
internal/logging/logging.go
Mounted filesystem
- FUSE filesystem
internal/fusefs/ops.go - Blob hydration
internal/hydrator/hydrator.go - Write overlay
internal/overlay/store.go - Repository model
internal/model/types.go
Persistent state
- Repo registry
internal/registry/registry.go - Base snapshots
internal/snapshot/store.go - SQLite metadata
internal/meta/sqlite.go
Other components
- CLI user
- Operating system
- Git repository
Connections 21
- CLI user → CLI entry: runs commands
- CLI entry → CLI commands: dispatches
- CLI commands → Daemon service: invokes service
- CLI commands → Credential redaction: redacts remotes
- Daemon service → Repo registry: loads configuration
- Daemon service → Git operations: prepares and fetches
- Git operations → Git repository: clones and fetches
- Daemon service → Base snapshots: publishes generations
- Daemon service → FUSE filesystem: mounts filesystem
- Operating system → FUSE filesystem: filesystem operations
- FUSE filesystem → Base snapshots: looks up base tree
- FUSE filesystem → Blob hydration: requests blob reads
- Blob hydration → Git operations: fetches blob content
- FUSE filesystem → Write overlay: stores file changes
- Daemon service → Write overlay: manages mounted overlay
- Daemon service → HEAD watcher: starts polling
- HEAD watcher → Daemon service: signals ref changes
- Repo registry → SQLite metadata: opens SQLite
- Base snapshots → SQLite metadata: opens SQLite
- Write overlay → SQLite metadata: opens SQLite
- Daemon service → Structured logging: records operations