#!/bin/sh # JustClaw-It installer: connects your coding agents to the JustClaw-It component registry. # # curl -fsSL https://justclaw.it.com/install | sh # curl -fsSL https://justclaw.it.com/install | sh -s -- --clients claude-code,cursor # # All this does is run `npx @justclaw-it/cli init` (source: https://github.com/justclaw-it/justclaw-it-mcp). # Your API key is written only to your agents' own config files on this machine. set -eu # JUSTCLAW_IT_CLI_PACKAGE overrides the package (e.g. a local tarball for testing). PKG="${JUSTCLAW_IT_CLI_PACKAGE:-@justclaw-it/cli@latest}" MIN_NODE_MAJOR=18 say() { printf '%s\n' "$*"; } die() { printf 'justclaw-it: %s\n' "$*" >&2; exit 1; } command -v node >/dev/null 2>&1 || die "Node.js ${MIN_NODE_MAJOR}+ is required. Install it from https://nodejs.org (or: brew install node / your package manager), then re-run." command -v npx >/dev/null 2>&1 || die "npx not found. It ships with npm; reinstall Node.js from https://nodejs.org." NODE_MAJOR=$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0) [ "$NODE_MAJOR" -ge "$MIN_NODE_MAJOR" ] 2>/dev/null || die "Node.js ${MIN_NODE_MAJOR}+ is required (found $(node -v 2>/dev/null || echo none))." say "JustClaw-It: running npx ${PKG} init" # When piped from curl, stdin is the script itself; reattach the terminal so init can prompt for the key. if [ ! -t 0 ] && (exec /dev/null; then exec npx -y --package="$PKG" justclaw-it init "$@"