# Connections & sharing

Use a hosted ledger directly, join an existing effort or retain an optional local replica.

Canonical page: /docs/sharing

## Choose how you want to work

Create a ledger directly at a hosted service, contribute to one you have been granted access to, or move an existing local ledger to hosting. These paths use the same ledger operations.

Direct hosted work requires an authenticated connection and ledger permissions. It does not require enrollment, a local copy or synchronization.

- [Move an existing local ledger](/docs/ledger-quickstart)

## Configure a service connection

CLI, SDK and MCP share named connections and selection. Use an endpoint supplied by the service operator. Managed and customer-operated services use the same pattern.

The commands below sign in, select the target workspace and associate the verified principal. Ledger grants also support collaborators outside the workspace. Configuration and identity association upload nothing and grant no ledger rights.

```shell
op-sys connections create --name work --endpoint https://records.example.com
op-sys connections select --name work
op-sys auth login
op-sys selection update --workspace <workspace-id>
```

Note: Use your service endpoint and workspace ID. Machine consumers sign in with their own scoped credential reference.

- [Connection precedence, editing and credentials](/docs/raw/manuals/client-connections.md)

## Create directly at the service

If your account is authorized to create ledgers in that workspace, create one and select its returned ID. No local-to-remote transfer is involved.

```shell
op-sys --connection work ledgers create --name example
op-sys selection update --connection work --ledger <returned-ledger-id>
op-sys ledgers inspect
```


## Use someone else’s ledger

Preview the ledger invitation, then join in the browser or use Copy join command. The interactive CLI guides account approval and selects the hosted ledger after acceptance. If you join in the browser, use the confirmation page’s agent or terminal instructions to work with your existing access.

An administrator can also grant access directly to your verified issuer and subject. Inspect the contribution rules if your grant allows it. Reading history or files requires the corresponding permissions.

```shell
op-sys invitations inspect --invitation "$INVITATION_URL"
op-sys invitations accept --invitation "$INVITATION_URL"
op-sys ledgers inspect
```

- [Grant and revoke access](/docs/access)
- [Complete independent participation example](/docs/raw/manuals/ledger-quickstart.md)

## Call HTTP directly

An application may supply the service URL, its own credential and the workspace ID through the HTTP API. No Veylar client installation or configuration file is needed. The authority enforces the same domain contract.

- [HTTP requests, outcomes and schemas](/docs/api-conventions)

## Keep a local copy when useful

Clone only if you want an authorized replica. Clone preserves ledger identity. URL cloning selects the local copy; the explicit connection-and-ID form leaves your current selection unchanged. Explicit synchronization retrieves accepted history, referenced files and removals, and delivers eligible prepared contributions.

Retained reads report their observed coverage. Select the hosted connection for current authority reads. Permission changes apply to subsequent service requests; already downloaded copies cannot be recalled.

```shell
op-sys ledgers clone --connection work --ledger-id <ledger-id>
op-sys --connection local records list --ledger-id <ledger-id>
op-sys --connection local ledgers sync --ledger-id <ledger-id>
```

- [Replica semantics and recovery](/docs/raw/manuals/ledger-replicas.md)

## Related guides

- [Local to shared](/docs/raw/ledger-quickstart.md)
- [People, agents & access](/docs/raw/access.md)
- [API conventions](/docs/raw/api-conventions.md)
