> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentlinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use the Linktrail CLI

> Run local checks from an authorized checkout, connect a ledger to its hosted project, and inspect the shared cloud command catalog.

Use Node.js 22 or later and an authorized Linktrail checkout with dependencies installed, or your supplied toolkit. These examples use the checkout's executable path. Replace `/path/to/linktrail` with its location; run commands from the repository that will own the ledger.

```bash theme={null}
node /path/to/linktrail/cli/linktrail.mjs --help
node /path/to/linktrail/cli/linktrail.mjs init
```

For a check before creating files, use [first result](/guides/first-result). The [ledger guide](/ledger) describes file ownership.

## Connect a hosted project

In the app, select your workspace and open Agent access to create an API credential. Give it the intended project and the sync scopes: `projects:read`, `watches:read`, `watches:write`, `events:read`, `exports:create`. Supply the credential through `LINKTRAIL_TOKEN` in your local environment.

```bash theme={null}
node /path/to/linktrail/cli/linktrail.mjs connect   --workspace YOUR_WORKSPACE_ID --project-id YOUR_PROJECT_ID   --origin https://app.agentlinkops.com
node /path/to/linktrail/cli/linktrail.mjs sync --dry-run
```

`connect` reads the workspace and project before saving connection metadata. It keeps the credential out of the saved configuration. `LINKTRAIL_API_KEY` is also accepted; conflicting credential values are refused. A ledger already connected elsewhere requires a separate ledger for the new identity, so its cursors and mappings stay coherent.

## Call a shared operation

<Note>
  Generic cloud commands require a matching hosted release. Check [availability](/capability-status) if the connected server has no command endpoint.
</Note>

```bash theme={null}
node /path/to/linktrail/cli/linktrail.mjs tools
node /path/to/linktrail/cli/linktrail.mjs call list_projects --args '{}'
```

Use `call NAME --file arguments.json` for a larger JSON object. The catalog lists input schemas and required scopes; local filesystem commands remain separate. [Sync and export](/guides/sync-and-export) explains which data crosses the connection. Run `doctor` when configuration or cloud access fails, then follow [troubleshooting](/guides/troubleshooting).
