#!/usr/bin/env sh
# Kist CLI installer (beta).
# The CLI is not published on npm yet, so this installs it from the public
# repository and links it globally as `kist`.
set -eu

repo="${KIST_REPO:-https://github.com/vigneshat-Git/Kist}"

command -v npm >/dev/null 2>&1 || { echo 'Install Node.js 18+ from https://nodejs.org/ first.' >&2; exit 1; }
command -v git >/dev/null 2>&1 || { echo 'Install Git from https://git-scm.com/ first.' >&2; exit 1; }

target="$(mktemp -d)"
git clone --depth 1 "$repo" "$target"
cd "$target/cli"
npm install
npm link

echo 'Kist CLI installed from source (beta).'
echo 'Run: kist login'
echo 'Default API base: https://kist-mc3c.onrender.com/api/v1'

