#!/bin/sh
# dl.new: your coding agent on open models (DeepSeek, Kimi), on one flat plan.
#
#   curl -fsSL https://dl.new | sh
#
# Runs the normal install script (https://directionallylocal.run) unchanged. It installs dl
# (and Node, if needed) in ~/.directionallylocal without admin rights, then starts dl in the
# folder you ran this from. Read it first: https://directionallylocal.run
# DL_INSTALL_VIA=home tells it this page, for its anonymous install count (DL_NO_TELEMETRY=1 turns that off).
set -eu

# Wrapped in a function so a truncated download never runs half a script.
main() {
  # Downloaded first, so a failed download says so instead of running nothing.
  # ?via=home: this download was counted here, so directionallylocal.run doesn't count it again.
  if ! script=$(curl -fsSL "https://dl.new/install.sh?via=home"); then
    printf '\n  dl.new: couldn'"'"'t download the install script.\n' >&2
    exit 1
  fi
  printf '%s\n' "$script" | DL_INSTALL_VIA=home sh
}

main
