.agentlinkops/links.jsonl, then reads .agentlinkops/config.json at that root. An existing .linktrail/ directory is still read when no .agentlinkops/ exists beside it, with one hint per process; run migrate to rename it.
If it finds no default ledger, it uses the current directory. Run init and mix from the intended repository root; they pin that directory explicitly.
A custom ledger filename alone does not change upward root discovery.
File ownership
Paths inpaths resolve relative to .agentlinkops/ (or the legacy directory in use); absolute paths remain absolute. Omitted paths use these defaults.
sync.lock protects check/sync/receive/compact writes and diagnostic state saves by doctor. Ledger mutations and adopt-result use a lock named for the ledger file.
Receipt writes use a recoverable receipt-transaction.json journal. Preserve files and investigate an active writer before removing locks.
Feed recovery saves snapshot-FEED-TIMESTAMP-UUID.json beside the ledger. See sync recovery for the explicit invalid-cursor recovery flags and doctor for diagnostic writer behavior.
Environment and precedence
Compatibility aliases until the cutover
The product is AgentLinkOps; Linktrail was its working name. During the private pilot compatibility window each old identifier keeps working with a notice, and none is removed until the dated cutover release recorded under DP-0029-T05, after pilot customers are notified.linktrailruns the same CLI asagentlinkopsafter one line on stderr; stdout is unchanged, so--jsonreaders are unaffected.LINKTRAIL_TOKEN,LINKTRAIL_API_KEY,LINKTRAIL_API_URL,LINKTRAIL_WEBHOOK_SECRET,LINKTRAIL_GSC_TOKENandLINKTRAIL_GA4_TOKENare still read. When only the old name is set, the CLI uses it and warns once per process. When both names carry the same value, nothing is printed. When they differ, the command fails with exit 2 and names both variables; no value is ever printed.- An existing
.linktrail/directory is read when no.agentlinkops/exists beside it, with one hint per process.initrefuses to create.agentlinkops/next to it; run migrate instead. - receive verifies
AgentLinkOps-SignatureandAgentLinkOps-Timestampfirst and still accepts theLinktrail-*headers.
cloud.workspaceId or cloud.workspace_id, and project.id, cloud.projectId or cloud.project_id. Conflicting identities fail. connect keeps ledger identity metadata separate from credentials and removes the legacy saved ledger token.
Current source also supports a verified API key stored outside the repository; the connect reference records its release boundary. Environment keys remain supported.
Follow the CLI setup guide for the published package.
OAuth credential custody
The optional Linux connect —oauth flow uses an existing public OAuth client, discovered issuer metadata and browser consent through a loopback callback. It stores tokens in the private user-owned~/.agentlinkops/oauth/ directory.
Ledger configuration retains the non-secret cloud.auth.credentialRef and an exact issuer/client/resource/workspace/project binding. It never copies tokens into the repository.
OAuth-backed CLI calls use MCP, while API-key calls use HTTP. Remove conflicting API-key environment variables before selecting OAuth.
Reconnecting to another project or issuer requires a matching binding; do not edit a reference to widen access. macOS and Windows credential custody are refused. A connected read does not verify a write grant.
Follow CLI connection recovery for missing app approval, refresh and revocation.
Local writer coordination
Commands that acquire ledger or sync writer locks use the native advisory-lock dependency on macOS and Linux and fail closed when it is unavailable or the platform is unsupported. Follow the command’s documented recovery option after inspecting the recorded owner; file age alone does not establish stale ownership. Do not remove an active writer’s lock or restart its work merely because a marker exists. Reinstall missing platform dependencies before retrying a refused writer.Arguments, output and status
The main argument parser accepts--name value and --name=value. Repeated flags work only where documented.
A bare flag becomes true. There is no general promise that every command rejects every unknown flag; use the listed options.
There is no global --json switch: each command owns its output shape.
Most commands return 0 on success and 2 on errors. Ledger check, doctor, mix and profile citation checks also use 1 for their documented result conditions.
A single-page check returns 0 even when its result is absent or unknown. Read that result’s state.
Use local command reference, connect, call and receive for the applicable branch.
Check the selected environment and workspace access before calling hosted operations. See capability status.