An on-demand CLI agent that finds used Tesla Model X listings in your area, scores them by deal quality, and emails you a report.
-
Add your API keys to
.envOpen.envin this folder and paste your keys where indicated. -
First run (Cursor builds the code) Open this folder in Cursor and paste the contents of
CURSOR_PROMPT.mdinto Cursor's chat. Cursor will build the agent in phases — run each phase, confirm it works, then continue. -
Run the agent Once built, double-click
run.shin Finder (or run./run.shfrom terminal). First run installs dependencies in avenv/; future runs are fast.
- Pulls listings from Tesla's used-inventory API and Marketcheck (which aggregates Cars.com, AutoTrader, CarGurus, dealer sites)
- Dedupes by VIN
- Filters by year, mileage, price, title, accidents, owners (all toggleable per run)
- Scores each listing 0-100 based on price-vs-market, mileage-for-age, year, title cleanliness, options, and an LLM quality check
- Emails an HTML report sorted by deal quality, with a price-tier breakdown and price-drop alerts
- ZIP code (default: 90017)
- Search radius in miles (default: 100)
- Email address to send the report to
- Whether to use default filters or customize
- Whether to include LLM analysis (~$0.02/run; recommended)
- Anthropic API (Haiku): ~$0.01-0.03 per run
- Marketcheck: free tier covers normal use
- Resend: free tier covers up to 3,000 emails/month
- Realistic monthly cost: under $5
main.py— entry point and CLI flowconfig.py— default filters and scoring weightssources/— data fetchers (Tesla, Marketcheck)scoring.py— deal-quality scoringanalyzer.py— Claude per-listing analysisstorage.py— SQLite + price historyreport.py— HTML email reportrun.sh— double-clickable launcherdata/agent.db— created on first run
- Email not arriving — check spam; Resend's sandbox
onboarding@resend.devsometimes lands there. To send from your own domain, verify it in the Resend dashboard. - Marketcheck rate limit — the free tier has request caps; if you hit them, wait an hour or upgrade.
- No listings found — try widening the radius or relaxing filters.
- Tesla API returns nothing — Tesla's used inventory varies by region; try a different ZIP.