Section is a cross-platform source/path sync collaboration layer.
In practice, that means:
- a remote source is configured once
- that source can bind to a local directory
- humans and agents work against the same local paths
- sync truth is visible through the control plane
Section is not trying to be:
- a full POSIX-preserving mount layer in the current scope
- a cross-platform execution runtime
- a hidden auto-merge system
There are only four concepts that matter day to day:
source- a configured backend/root such as
fs,s3, orwebdav
- a configured backend/root such as
local root- the local directory bound to that source
local tree- where humans, editors, shells, and agents do normal file work
control plane- where sync truth, version truth, compare, and resolve live
Section exposes only four user-facing states:
readysyncingconflicterror
Detail fields such as dirty_local, dirty_remote, local_present, pinned, and stale exist, but they are diagnostics, not the main mental model.
| Goal | Command |
|---|---|
| Add a source | section source add <name> --provider ... --opt ... |
| Bind local root | section source bind <name> <local_root> |
| Remove local binding | section source unbind <name> |
| Run sync | section source sync <name> |
| Watch events | section --json watch <local_path_or_root> |
| Inspect sync state | section --json path inspect <local_path> |
| Compare local vs remote | section --json path compare <local_path> |
| Resolve conflict | `section --json path resolve <local_path> --strategy use-local |
section source add demo --provider fs --opt root=/srv/section-demo-source
section source bind demo ~/section-demoAfter binding, Section creates:
~/section-demo/.section/root.json
That file is a discovery marker. It lets CLI/API clients recognize that a local path belongs to a Section-bound root.
section source sync demoThis reconciles the source and the bound local tree.
Use normal tools:
- editors
- shell commands
- scripts
- agents
Example:
cd ~/section-demo
ls
cat docs/readme.txtInstead of polling every file, subscribe once:
section --json watch ~/section-demoExample event:
{"id":3,"source_name":"demo","path":"docs/readme.txt","kind":"conflict_detected","state":"conflict","created_at_ms":1775451230137}Inspect a path:
section --json path inspect ~/section-demo/docs/readme.txtUse compare when you need freshness truth:
section --json path compare ~/section-demo/docs/readme.txtSection uses stale-overwrite protection.
That means:
- if local changed
- and remote also changed after the last known remote base
- Section does not silently let one side win by timing
Instead:
- the path enters
conflict - sync pauses for that path
- the local file remains in place
- the current remote version is preserved
section --json path resolve ~/section-demo/docs/readme.txt --strategy use-localUse this when the local file should overwrite the current remote truth.
section --json path resolve ~/section-demo/docs/readme.txt --strategy use-remoteUse this when the current remote file should replace the local one.
Recommended agent flow:
- accept a local filesystem path as the entry point
- subscribe once with
watch - react to named paths from the event stream
- call
path inspectonly when state/detail is needed - call
path comparewhen freshness truth matters - call
path resolveonly for explicit human or policy decisions
Agents should not:
- infer sync truth from the file contents alone
- repeatedly poll
inspecton every file - guess stale/remote state from timestamps without the control plane
Use when you need:
- public state
- detail state
- base/current remote version references
Key fields:
statedetail.local_presentdetail.dirty_localdetail.dirty_remotedetail.stalebase_remote_versioncurrent_remote_version
Use when you need:
- local vs current remote truth
- stale decision support
Key fields:
local_versionbase_remote_versioncurrent_remote_versionlocal_matches_baselocal_matches_current_remotestale
Use when you need:
- event-driven notification
- one subscription instead of per-file polling
Key fields:
idsource_namepathkindstatecreated_at_ms
Current scope does not promise:
- identical host-native execution semantics across platforms
- strict preservation of every POSIX metadata field
- automatic merge for file conflicts
- hidden sync state encoded directly inside ordinary files