Skip to content

CLI reference

The linetrail CLI runs on developer machines and in CI. It only reads your repository: it never changes git config or notes. The one opt-in exception is linetrail git safe-push.

Command What it does
linetrail setup [--repo P] [--yes] [--dry-run] [--json] [--no-tab-tracking] Guided developer setup: checks git and the capture hooks, shows a plan and installs only after you confirm, then runs the doctor checks. Exit 0 done, 1 failed, 3 capture still missing or out of date
linetrail setup --usage-upload daily --api-url U / --remove-usage-upload Schedules (or removes) a daily usage upload for the current user. Off by default
linetrail doctor [--repo P] [--api-url U] [--json] Checks git and capture versions, hooks, notes availability, the installed binary, token presence (never printed), and the API’s health, readiness and contract
linetrail --version Release, build commit, ingestion contract and normalization policy
Command What it does
linetrail inspect --repo P --ref R [--json | --lines] Computes per-commit attribution locally. Uploads nothing. --lines adds files and attributed line ranges
linetrail sync --repo P --ref R --api-url U Inspects, then uploads with the token in LINETRAIL_INGEST_TOKEN. Batched (--batch-size, default 500), retried on transient failures (--max-attempts, default 4), idempotent
linetrail blame --repo P [--ref R] --path FILE [-L A,B] [--json] Offline, read-only line view of one committed file: origin, tool and model, unknown reason and the last commit that wrote each line
linetrail churn sync … Uploads code churn and survival for a repository
Command What it does
linetrail pr inspect --repo P --base B --head H [--json | --lines] Net-diff pull-request attribution for a local comparison
linetrail pr sync … Uploads pull-request attribution: from local branches (--base, --head), Bitbucket (--bitbucket-url --project --repo-slug --pr-id), GitHub (--github-url --github-repo --pr-number) or GitLab (--gitlab-url --gitlab-project --mr-iid). Includes the pull request’s own commits unless --no-commits
linetrail pr list (Bitbucket | GitHub | GitLab options) [--state S] Read-only pull-request discovery, printed as JSON. Exit 0 complete, 3 partial, 1 error
linetrail scm test | status --config C Tests a connection with read-only requests, or shows its redacted config and sync cursor
linetrail scm sync --config C --api-url U [--max-prs N] [--dry-run] Incremental pull-request sync of new and changed pull requests. Exit 0 done, 3 work left, 1 failed

Source-control tokens are read only from environment variables: LINETRAIL_GITHUB_TOKEN, LINETRAIL_GITLAB_TOKEN, LINETRAIL_BITBUCKET_TOKEN.

Command What it does
linetrail usage collect [--tool claude-code] [--since T] [--upload] [--links --link-repo DIR] [--actor-email E] Reads token-usage metadata from local session logs. A dry run unless --upload
linetrail git safe-push [--dry-run] REMOTE REFSPEC… A branch or tag push that doesn’t publish capture notes automatically. Refuses notes refspecs
linetrail evidence record | validate | check Local evidence adapter for Verified checks (advanced, opt-in)
linetrail derived build | inspect | verify --commit C Derived attribution for historical squashes (advanced)
Option Meaning
--notes-ref Notes ref to read (read-only)
--omit-author-identity Don’t send commit author name and email
--omit-pr-title Don’t send pull-request titles
--max-commits, --since Limit history depth (default 1,000 commits)
--exclude GLOB Exclude paths (repeatable)
--repo-key, --remote Repository identity (defaults to the normalized remote URL)
--no-cloud-agent-inference, --cloud-agent-disable, --cloud-agent-rule Control cloud-agent inference
  • On a terminal, output is for people: status glyphs (✓ ✗ ! ·), aligned blocks, colours for origins and progress spinners.
  • Piped, redirected or in CI logs, output is plain text and stays stable for scripts.
  • --json output is never decorated.
  • --color auto|always|never (default auto), NO_COLOR, CLICOLOR=0 and TERM=dumb control colour. --quiet only turns off spinners: results, warnings and caveats are always printed.