{"id":50294384,"url":"https://github.com/snipem/ld-cli","last_synced_at":"2026-05-28T08:01:15.696Z","repository":{"id":351357143,"uuid":"1210624504","full_name":"snipem/ld-cli","owner":"snipem","description":"An LLM friendly command line tool for racing and simracing telemetry data ","archived":false,"fork":false,"pushed_at":"2026-04-14T16:35:15.000Z","size":4354,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T18:23:16.345Z","etag":null,"topics":["ai","llm","motec","simracing","telemetry"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snipem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-14T15:42:59.000Z","updated_at":"2026-04-14T16:35:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/snipem/ld-cli","commit_stats":null,"previous_names":["snipem/ld-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/snipem/ld-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipem%2Fld-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipem%2Fld-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipem%2Fld-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipem%2Fld-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snipem","download_url":"https://codeload.github.com/snipem/ld-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snipem%2Fld-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33599465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","llm","motec","simracing","telemetry"],"created_at":"2026-05-28T08:01:14.557Z","updated_at":"2026-05-28T08:01:15.672Z","avatar_url":"https://github.com/snipem.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ld-cli\n\nLLM-friendly cli tool for reading `.ld` race telemetry log files (a.k.a. MoTeC i2 format) — the de facto standard format for sim racing telemetry across iRacing, Assetto Corsa Competizione (ACC), LMU, and many other platforms. Zero external dependencies.\n\nThe binary format was documented by the community. This Go port is based on the implementation at [github.com/gotzl/ldparser](https://github.com/gotzl/ldparser).\n\n\u003e **Disclaimer**: This project is not affiliated with, endorsed by, or created by MoTeC i2. It is an independent, open-source implementation created for scientific and educational purposes only.\n\n**Using with Claude/LLMs?** See [`SKILL.md`](SKILL.md) for the LLM-friendly workflow guide.\n\n## What are `.ld` files?\n\n`.ld` (race log) files are binary telemetry records from racing simulators and data acquisition systems. They contain:\n- **Session metadata**: driver, vehicle, venue, timestamp\n- **Channel data**: 50–245+ channels of time-series samples (speed, throttle, brake, suspension, temperatures, tire data, etc.)\n- **Lap boundaries**: automatic detection via lap number or distance resets\n- **Sample rates**: 10–20 Hz per channel, some channels at 1–2 Hz for aggregates\n\n## Example AI Agent Usage\n\n```\n❯ use ldcli tool to analyze why do my rears lock up with the latest P1 session ld file   \n\n● Bash(ldcli --help 2\u003e\u00261 | head -60)\n  ⎿  ldcli — race telemetry CLI for .ld files\n\n     Start here:\n     … +20 lines (ctrl+o to expand)\n\n● Bash(ldcli events\n      \"LMP2_ELMS/Autodromo\n      Nazionale Monza/2026-04-13 - 21-32-22 - Autodromo Nazionale Monza - AF\n      Corse #…)\n  ⎿  {\n       \"files\": [\n         {\n     … +426 lines (ctrl+o to expand)\n\n● Bash(ldcli analyze braking\n      \"LMP2_ELMS/Autodromo\n      Nazionale Monza/2026-04-13 - 21-32-22 - Autodromo Nazionale Monza - A…)\n  ⎿  {\n       \"files\": [\n         {\n     … +426 lines (ctrl+o to expand)\n\n...\n\n● Now I have everything I need. Here's the analysis:\n\n  ---\n  Rear Lockup Analysis — P1 Session, Monza\n\n  Root Cause: Rear Brake Bias Too High\n\n  Brake Bias Rear = 47.6% is fixed/constant all session (never adjusted). This\n  means the rears are receiving 47.6% of total braking force while the fronts\n  only get 52.4%. Under heavy braking from Monza's high speeds (230–280 km/h),\n  longitudinal weight transfer dumps load onto the front axle — the rear becomes\n   significantly lighter. Asking the rear to provide 47.6% of braking on a\n  lightly-loaded axle causes the rears to exceed their available grip and lock.\n\n  Brake pressure confirms it — FL/FR peak at 37.5 bar, RL/RR at 34.1 bar (ratio\n  = 47.6% rear exactly).\n\n...\n\n```\n\nMore LLM prompts I used:\n\n* Where do I find lap time in my last race? Ignore close up battles with others\n* Why does my rear lock up when I stay in 3 in Parabolica instead of shifting down to 2nd gear?\n* Analyze anything about my driving, look at all channels, be creative give me SMART goals\n* Look at MEMORY.md, did I follow your recommandations from my last session?\n\n## Quick Start\n\n```bash\n\n# This gives a full blown guide for the LLM with an escalation strategy and recommandations on how to save tokens\nldcli guide\n\n# Use this for a human-readable lap overview. \nldcli laps session.ld\n\n# Helper script for finding sessions in a folder interactively (requires fzf). Alert! Blazzingly fast!\n./ldpick.sh ~/telemetry/\n\n# Full analysis workflow\nldcli guide                                           # JSON docs for LLM usage\nldcli events session.ld --lap 2 --type braking_zone\nldcli diff session.ld --ref 2 --cmp 3\nldcli report session.ld --lap 2 --out report.html\n```\n\n## Usage with AI Agents / LLMs\n\nJust tell your agent to analyze a ld file using ldcli. Point it to ld-cli guide to get yourself started.\n\n## Features\n\n- **Game-agnostic**: Works with any `.ld` file from any sim (iRacing, ACC, LMU, rFactor2, etc.)\n- **Upfront parsing**: Entire file loaded and decoded in one pass (45 MB in \u003c1 second)\n- **Multi-format support**: Reads `.ld` binary; writes/reads `.ldx` XML index files\n- **Lap detection**: Uses \"Lap Number\"/\"Lap Time\" channels or falls back to \"Lap Distance\" resets\n- **CLI tools**:\n  - `laps` — Human-readable lap overview: driver, vehicle, venue, lap times, best lap marker\n  - `info` — File header, lap boundaries, channel catalog (JSON)\n  - `inspect` — Data quality metrics, channel groups, interesting channels\n  - `summarize` — Per-channel statistics (min/max/mean/p5/p50/p95/std); per-sector trends; lap trends\n  - `events` — Gear shifts, braking zones, corners, full-throttle zones, wheel lockups\n  - `diff` — Lap-to-lap time delta with sector breakdown\n  - `data` — Time-series samples (LTTB downsampling by default)\n  - `report` — HTML (dark SVG + event overlays) or ASCII (unicode blocks) telemetry report\n  - `analyze braking/throttle/tyre` — Deep coaching analysis per lap\n  - `compare` — Side-by-side channel stats across sessions\n  - `guide` — JSON documentation + escalation strategy for LLM usage\n- **Example viewer**: Interactive web UI with per-lap traces, lap comparison, channel picker\n\n## Architecture\n\n- `ldparser.go` — Core parser. Binary format reverse-engineered; documented in `AGENTS.md`\n- `ldx.go` — XML read/write for `.ldx` index files\n- `cmd/ldcli/` — LLM-friendly command-line interface with JSON output\n- `cmd/ldviewer/` — HTTP server with interactive telemetry viewer (no external JS/CSS)\n\n## Test Coverage\n\n- **96.2%** coverage of library functions\n- Test files include synthetic data for all data types (float16/32/64, int16/32)\n- Lap detection test with distance-based lap resets\n- LDX round-trip read/write validation\n\n## Build \u0026 Install\n\n```bash\nmake build          # build all tools\nmake install        # install as global binaries\nmake test           # run test suite\nmake coverage       # generate HTML coverage report\nmake clean          # clean build artifacts\n```\n## References\n\n- `CLAUDE.md` — Architecture decisions and design rationale\n- `AGENTS.md` — Complete binary format documentation with byte-offset tables\n- `cmd/ldcli/` — LLM escalation strategy and token-efficient output formats\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipem%2Fld-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnipem%2Fld-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnipem%2Fld-cli/lists"}