Expand description
lean-ctx cloud link <workspace>/<vault>[@<server>]: link a git
repository to a vault.
Writes .lean-ctx-cloud.json at the repository root, next to
.lean-ctx-id. A hosted vault keeps link v1 ({"schema", "repo": {"ns", "name"}}), which every engine in the team reads; a self-hosted one needs
link v2 ({"schema": "leanctx.cloud.link/v2", "vault": "<address>"}, C0
2.0 link.schema.json). Both are read; v1 is a hosted address.
Resolution sends the vault on first sight; Cloud binds it when this
instance may contribute there. A repository without any identity marker
gets a random .lean-ctx-id so its identity survives moves; one with a
git origin never does (the origin is the identity of every checkout,
super::vault::project_identity).
Structs§
- Link
Outcome - What
linkdid. - Vault
Link - A link as read: the vault plus, for a self-hosted one, its server.
Constants§
- LINK_
FILE - The one name of the link file. Every released Instance (3.12.0 on) writes it under this name; the Atlas-era name was dropped without an alias (owner: Cloud starts fresh), so there is no second name to read.
- LINK_
SCHEMA - LINK_
SCHEMA_ V2
Functions§
- has_
link_ file - True when
rootholds a link file. - link
- Link the repository at
roottovault(<workspace>/<vault>[@<server>]). - main_
worktree_ root - The main checkout of the linked git worktree at
root, read from git’s own files without running git:<root>/.gitis a file naming the worktree’s git dir, whosegitdirpoints back at that file and whosecommondirnames the repository’s.gitdirectory of the main checkout.Nonefor a main checkout, a bare repository, or files that do not agree with each other. - read_
link - The link of the project at
root, if any. A linked git worktree without its own link file uses the one of its main checkout: the same repository (one git dir, one remote), so the same vault.