Files
spacedrive/docs/core/library.mdx
T
Jamie Pine 2d380fd264 Move docs to Fumadocs and rewrite the core docs
Replaces the Mintlify setup (mint.json, docs.json, snippets) with a
standalone Fumadocs app in docs/: Next.js app router, meta.json nav per
section, its own bun install. Run with `just dev-docs`.

Content pass alongside the migration: core architecture, data model,
CLI, and networking pages rewritten around the daemon/source-store/
library split, new product-direction.mdx defining the product boundary,
new drive-catalog plan, and the physical-drives plan updated to
reference it. Whitepaper page retired.
2026-09-15 00:59:30 -07:00

79 lines
2.6 KiB
Plaintext

---
title: Library
description: The control plane that connects sources, devices, and policy
sidebarTitle: Library
---
A library is a durable control plane for a person's sources. It connects
devices, organization, permissions, jobs, and sync without absorbing every
filesystem record into one shared database.
## What the library owns
- source registrations and attachment hints;
- paired device membership and grants;
- locations, tags, saved views, and policy;
- durable job state and operation history;
- assertion sync watermarks;
- cross-source catalog projections.
Large source generations remain in their source stores. Original file bytes
remain at their origins or in copies created by explicit policy.
## On-disk state
A library has a stable UUID and a directory under the daemon data root. Its
databases and configuration are private runtime state. Use the daemon API for
live access rather than opening SQLite files from another process.
Source stores can live with the library, next to portable storage, or at another
configured path. Their registry entries make that placement explicit.
## Open and close
The daemon owns library lifecycle. Opening a library:
1. validates its configuration and schema;
2. opens the library databases;
3. attaches registered source stores;
4. reconciles interrupted jobs;
5. starts permitted watchers and network services;
6. publishes current availability.
Closing drains active work according to each job contract and releases database
handles. A forced process exit is recovered from durable state on the next open.
## Several libraries
Use separate libraries for a true administrative or security boundary. Use
sources, locations, tags, and views for ordinary organization inside one
library.
The CLI can create and select libraries:
~~~bash
sd-cli library create Personal
sd-cli library list
sd-cli library switch --library-id <LIBRARY_ID>
sd-cli library info
~~~
## Portability and backup
Back up the library state and every source store that contains assertions or
the last observation of an origin. A source freeze creates a dated,
self-contained store copy, but it does not copy original file bytes.
Before moving a library between machines, stop mutations, copy state, verify
the copy, then reopen it through the daemon. Do not copy a live WAL database and
assume it is consistent.
## Sync
Library sync shares small state and assertions between paired devices. Source
generations remain authority-owned and are served or replicated separately.
This keeps sync cost proportional to chosen subscriptions instead of total
library size.
See [Library Sync](/core/library-sync) and [Data Model](/core/data-model).