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
| Task | Commands | Use when |
|---|---|---|
| Connect accounts | connect, connections, profiles, connection show, disconnect | You need to authenticate Notion or Google Docs and inspect saved connection metadata. |
| Register local files | mount notion, mount google-docs, file-provider register, pull | You want a remote workspace to appear as local Markdown. |
| Navigate mounted content | search, info, status, inspect | You need to find content or understand what Locality knows about a path. |
| Review sync state | status, diff, pull, push, restore, log, undo | You are deciding whether to update local files or write local edits back to the source. |
| Run background services | daemon, file-provider, doctor | You are using Live Mode, macOS File Provider, Linux FUSE, or Windows Cloud Files. |
| Create local content | create page, templates, okf export | You want safe local drafts, local workflow packs, or a portable export. |
| Integrate tools | mcp, --json | You are building agent or automation surfaces over Locality. |
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:| Platform | Supported values |
|---|---|
| macOS | plain-files, macos-file-provider |
| Linux | plain-files, linux-fuse |
| Windows | plain-files, windows-cloud-files |
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.
| Argument | Meaning |
|---|---|
--name <id> | Connection id to save. Runtime default is notion-default when no active Notion connection exists; pass an explicit name for reproducible setup. |
--token-stdin | Read a Notion integration token from stdin. Useful for local development and CI. |
--no-browser | Print the OAuth URL instead of opening it. Useful for remote shells. |
--direct-oauth | Use direct OAuth credentials from the environment instead of the broker. Developer path only. |
--broker-url <url> | Override the OAuth broker base URL. |
--redirect-uri <uri> | Override the local callback URI. |
loc connect google-docs
Connect Google Docs through the Locality OAuth broker.
| Argument | Meaning |
|---|---|
--name <id> | Connection id to save. Runtime default is google-docs-default when no active Google Docs connection exists; pass an explicit name for reproducible setup. |
--no-browser | Print the OAuth URL instead of opening it. |
--broker-url <url> | Override the OAuth broker base URL. |
--redirect-uri <uri> | Override the local callback URI. |
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:
| Argument | Meaning |
|---|---|
<path> | Local directory to register as the mount. |
--workspace | Mount all accessible Notion workspace content shared with the integration. |
--root-page <page-id> | Mount one Notion page tree. Mutually exclusive with --workspace. |
--connection <id> | Use a specific saved connection. Required when Locality cannot choose safely. |
--mount-id <id> | Stable id for scripts, provider commands, logs, and status output. |
--projection <mode> | plain-files, macos-file-provider, linux-fuse, or windows-cloud-files, depending on platform. |
--read-only | Register the mount as read-only and block push operations. |
loc mount google-docs
Register Google Docs content under a Drive workspace folder.
| Argument | Meaning |
|---|---|
<path> | Local directory to register as the mount. |
--workspace-folder <name-or-id> | Google Drive folder name, folder id, or folder URL. |
--connection <id> | Saved Google Docs connection to use. |
--mount-id <id> | Stable mount id. Defaults to a Google Docs mount id when safe. |
--projection <mode> | Platform-specific projection mode. |
--read-only | Block push operations for this mount. |
Find and inspect content
loc search
Search local mount metadata without contacting remote sources.
| Argument | Meaning |
|---|---|
<query...> | Title, path fragment, remote id, or source URL. Multi-word queries are accepted. |
--connector <connector> | Limit results to one connector, such as notion or google-docs. |
--limit <n> | Maximum number of results. Defaults to 10. |
--all | Include stale, disconnected, or inactive mount access. |
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.
| State | Meaning | Usual next command |
|---|---|---|
all_synced | Local, remote, and synced shadow are aligned. | Keep working. |
stub | Locality knows the object, but the body is not hydrated. | loc pull <path> |
pending_local_changes | Local file changed and needs review. | loc diff <path> |
remote_update_available | Remote moved while the local file is clean. | loc pull <path> |
review_needed | Local and remote state both need attention. | loc inspect <path> |
conflicted | Conflict markers or conflicted state exist. | Resolve, then loc diff <path> |
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:
| Argument | Meaning |
|---|---|
<path> | File or directory scope to push. Prefer a narrow path. |
-y, --yes | Approve safe non-empty plans without prompting. Use for reviewed automation. |
--confirm | Approve plans that trip destructive-change guardrails. Use only after reviewing the plan. |
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:
| Argument | Meaning |
|---|---|
--title <title> | Title for the new page and the generated folder/file name. Required. |
--parent <dir> | Existing mounted directory where the page should be created. |
--private | For Notion, create as a workspace-private page on push when the token supports it. |
loc templates
Manage local-first template packs.
| Command | Use when |
|---|---|
loc templates list | You want bundled pack ids. |
loc templates validate <path> | You are developing or reviewing a pack. |
loc templates new <pack> <path> | You want a complete local workspace from a pack. |
loc templates apply <pack> <template> --to <dir> | You want one generated draft in an existing local or mounted folder. |
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.
| Command | Use when |
|---|---|
start | Start localityd under the platform process manager or a detached session. |
stop | Stop the managed daemon. |
status | Check manager state, IPC reachability, watched mounts, and queue counts. |
reload | Ask a running daemon to reconcile watches with the current mount table. |
restart | Stop then start the daemon after config or binary changes. |
| Argument | Meaning |
|---|---|
--session | Run as a detached session process. Useful for development and non-macOS hosts. |
--launchd | Use launchd. macOS only. |
--localityd-bin <path> | Launch a specific daemon binary. |
--state-dir <path> | Use an isolated Locality state directory. |
--tcp-addr <address-or-off> | Configure daemon TCP IPC, for example 127.0.0.1:8758, or pass off where TCP can be disabled. Required on Windows. |
--include-env <KEY> | Pass one environment variable into the managed daemon. Repeatable. |
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:
| Command | Use when |
|---|---|
register | Register, repair, or re-register the platform provider for a mount. |
start | Start the background provider runtime when the platform needs one. |
run | Run the Windows Cloud Files provider in the foreground for debugging. |
stop | Stop the provider runtime without necessarily unregistering the mount. |
status | Inspect provider registration, runtime state, daemon reachability, and logs. |
restart | Stop and start the provider runtime. |
open | Open the user-visible mount folder. |
unregister | Remove provider registration for the mount. On Linux, this removes the systemd user service. |
list | List provider domains or registrations known to the platform helper. |
reset | Reset provider registration state for recovery or development. |
| Platform | Provider behavior |
|---|---|
| macOS | Uses the signed Locality File Provider helper from the app bundle. LOCALITY_FILE_PROVIDERCTL can override the helper during development. |
| Linux | Uses locality-fuse and a user systemd service for the shared FUSE root. LOCALITY_FUSE_BIN can override the helper during development. |
| Windows | Uses Cloud Files sync-root registration and a locality-cloud-files.exe provider runtime. LOCALITY_CLOUD_FILES_BIN can override the helper during development. |
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
| Code | Meaning |
|---|---|
0 | Success, including some no-op commands. |
1 | Internal, I/O, store, connector, auth, credential, daemon, or rate-limit failure. |
2 | Usage error. |
3 | Validation or diagnostic error. |
4 | Confirmation, guardrail, or read-only policy required. |
5 | Unsupported or intentionally unimplemented connector boundary. |
Common workflows
Connect, mount, pull, edit, push
Use a virtual projection
macos-file-provider on macOS and windows-cloud-files on Windows.