Windows-first Go agent that scans iRacing .ibt files after sessions and uploads telemetry payloads to the Rails app iracing-client.
- Watches folders recursively for new
.ibtfiles. - Deduplicates already-ingested files with a local state index.
- Uploads JSON payloads to Rails with
X-API-KeyandIdempotency-Key. - Stores failed uploads in a disk spool and retries with exponential backoff.
- Includes CLI commands:
run,doctor. - Parses telemetry into session metadata, laps, and full samples.
cmd/iracing-agent: CLI entrypointinternal/watcher:.ibtdiscoveryinternal/parser: parser adapterinternal/client: Rails HTTP clientinternal/queue: retry spoolinternal/state: deduplication indexinternal/service: ingest orchestration
-
Copy config template:
cp config/agent.example.yaml config/agent.yaml
-
Edit
config/agent.yaml:agent.watch_pathsis optional. If omitted, the agent auto-detects the default telemetry folder from the OS.- Windows defaults to
Documents/iRacing/telemetry(and also checks OneDrive Documents path when available). - Set
rails.base_urlandrails.api_key.
-
Build:
go build ./...
-
Health checks:
go run ./cmd/iracing-agent doctor
-
Run watcher loop:
go run ./cmd/iracing-agent run
For local development without Rails, use:
go run ./cmd/iracing-agent run --logs-only
In log-only mode it reads from
./dev-telemetry, logs parsed previews, and saves full parsed JSON to./dev-output/parsed-json. You can override the dump folder withIRACING_AGENT_JSON_DUMP_DIR.
From Linux/macOS:
GOOS=windows GOARCH=amd64 go build -o dist/iracing-agent.exe ./cmd/iracing-agentOn Windows PowerShell:
$env:IRACING_AGENT_CONFIG = "C:\path\to\agent.yaml"
.\iracing-agent.exe doctor
.\iracing-agent.exe runRun as interactive system tray app on Windows:
.\iracing-agent.exe trayFor development mode in tray (uses ./dev-telemetry + JSON dump files):
.\iracing-agent.exe tray --logs-onlyTray menu includes:
- Start Agent
- Stop Agent
- Run Doctor
- Open Config Folder
- Open JSON Dump Folder
- Exit
- Build Windows binary (from Linux/macOS):
GOOS=windows GOARCH=amd64 go build -o dist/iracing-agent.exe ./cmd/iracing-agent-
Copy to Windows machine:
dist/iracing-agent.exescripts/install-windows-startup.ps1- optional: your prepared
config/agent.yaml
-
Run installer script in Windows PowerShell:
.\install-windows-startup.ps1 -SourceExe .\iracing-agent.exe -Mode normalFor development mode (--logs-only + dev-output/parsed-json dumps):
.\install-windows-startup.ps1 -SourceExe .\iracing-agent.exe -Mode log-onlyIf you already have a config file:
.\install-windows-startup.ps1 -SourceExe .\iracing-agent.exe -SourceConfig .\agent.yaml -Mode normalThe script installs into %LOCALAPPDATA%\iracing-agent and registers a Scheduled Task named iRacingAgent to run at user logon.
POST /api/v1/telemetry_uploads- Headers:
X-API-Key: <key>Idempotency-Key: <session external id>
- JSON body:
sessionlapssamples
Replace metadata-only parser with full .ibt decoding into laps + samples while keeping the same upload contract.