loc is the supported command surface for Locality. Use it to connect sources,
register mounts, inspect local sync state, review remote write plans, push
approved edits, and operate the background daemon and virtual filesystem
providers.
Most developer and agent workflows should stay path-scoped:
--json on commands when integrating with scripts, agents, tests, or MCP
tools. Help output is always text, even when --json is present.
Command map
Conventions
Paths and scope
Commands that accept a path resolve it through the registered Locality mount table. Prefer the narrowest useful path: a singlepage.md, one page directory,
or a small subtree. Broad workspace-level diff and push commands are harder
to review.
When a path is optional, Locality uses the current working directory when it is
inside a mount. Outside a mount, commands such as loc status report registered
mounts in the active state directory.
--json
--json is global:
State directory
Production state defaults to~/.loc. For isolated development and tests, use
LOCALITY_STATE_DIR or daemon flags such as --state-dir <path>.
Projection modes
Projection support depends on the host platform:plain-files writes normal files during loc pull. The virtual projection
modes list online-only content through the platform provider and materialize file
bodies on open or explicit pull.
Connect sources
loc connect notion
Connect a Notion workspace and save a reusable connection.
Examples:
loc connect google-docs
Connect Google Docs through the Locality OAuth broker.
Example:
Inspect and remove connections
connections to list saved account connections. Use profiles to list
connector auth profiles and capabilities. Use connection show for one
connection’s metadata. These commands never print secrets.
disconnect deletes the credential and marks the connection revoked. It does
not remove mounts; affected mounts will report auth or revoked-connection
problems until you reconnect or remount.
Mount sources
loc mount notion
Register Notion content at a local path.
--workspace for all Notion content shared with the integration. Use
--root-page <page-id> when you want one page tree instead of the whole
accessible workspace.
Key arguments:
Examples:
loc mount google-docs
Register Google Docs content under a Drive workspace folder.
Examples:
Find and inspect content
loc search
Search Locality’s local SQLite search index.
match: line,
and JSON output can include stable optional match_context with the matched field
and best-effort snippet. Tools should tolerate absence and future field names.
Key arguments:
Examples:
loc info
Show source, mount, entity, child, and journal context for a path using local
state only.
info when you need to answer “what is this file connected to?” without
hydrating content or calling the remote connector. It is useful before deleting
or moving suspicious files in a mount.
Examples:
loc status
Show local sync state for one path, the current mount scope, or all mounts.
loc inspect
Explain local and remote sync state for one path.
status, inspect may call the remote connector. It is read-only: it does not
rewrite local files, update shadows, or mutate the remote source.
Example:
loc doctor
Run read-only diagnostics for daemon, state store, mounts, providers, projection
support, and auth.
Review and sync
loc pull
Pull remote content into the local projection.
loc diff
Preview the remote write plan for local changes.
push would attempt.
It does not mutate local files or remote content.
Examples:
loc push
Push local changes back to the remote source.
loc diff or when Live Mode has paused and asks
for a manual decision. The push pipeline runs the same validation and planning
as diff, then uses a journaled connector apply path.
Key arguments:
Examples:
loc diff again.
loc restore
Restore a local file from the last synced shadow.
--force allows restoring a file marked conflicted. Use it only when you have
chosen to discard local conflict content.
Examples:
loc log
List push journal entries.
loc undo
Undo a reconciled push using its journal id.
Create local drafts and exports
loc create page
Create a local page draft in a mounted Locality folder.
--parent is omitted, Locality uses the current
directory.
Key arguments:
Example:
loc templates
Manage local-first template packs.
Examples:
loc okf export
Export mounted content as an Open Knowledge Format bundle.
--out <dir> must point to an empty output directory.
Example:
Daemon and virtual filesystem providers
loc daemon
Start, stop, reload, restart, or inspect the background localityd process.
Key arguments:
Examples:
loc file-provider
Manage the platform virtual filesystem provider for a mount.
macos-file-provider, linux-fuse, and
windows-cloud-files projection modes. The target can be a mount id such as
notion-main or a path inside a mount.
Subcommands:
Examples:
Tool integration and development
loc mcp
Run the Locality MCP stdio server.
loc config
Reserved for future configuration commands.
not implemented yet.
Development entrypoints
From a source checkout:Exit codes
Common workflows
Connect, mount, pull, edit, push
Use a virtual projection
macos-file-provider on macOS and windows-cloud-files on Windows.