#!/bin/sh # Revnu agent setup: # # curl -fsSL revnu.com/install | sh # # Connects Revnu's MCP server (https://revnu.com/api/mcp) to Claude Code, Codex and Gemini CLI # when they're installed, and adds the Revnu skills so your coding agent knows # when Revnu can get you customers. Nothing is created or paid for here: you # sign in and choose a plan later, in your browser. set -u # One function, called on the last line: sh reads it all before running anything, and # every command gets /dev/null as stdin, so none can swallow the rest of a piped script. main() { URL="https://revnu.com/api/mcp" NAME="revnu" tools=0 say() { printf '%s\n' "$*"; } have() { command -v "$1" >/dev/null 2>&1; } if have claude; then tools=1 if claude mcp get "$NAME" >/dev/null 2>&1; then say "Claude Code: Revnu already connected" elif claude mcp add --transport http --scope user "$NAME" "$URL" >/dev/null 2>&1; then say "Claude Code: Revnu connected" else say "Claude Code: couldn't connect. Run: claude mcp add --transport http --scope user $NAME $URL"; fi fi if have codex; then tools=1 if codex mcp get "$NAME" >/dev/null 2>&1; then say "Codex: Revnu already connected" else # codex mcp add saves the server, then waits on a browser sign-in; stop it once saved. codex mcp add "$NAME" --url "$URL" >/dev/null 2>&1 & pid=$! i=0 while [ "$i" -lt 15 ] && ! codex mcp get "$NAME" >/dev/null 2>&1; do sleep 1; i=$((i + 1)); done kill "$pid" 2>/dev/null wait "$pid" 2>/dev/null if codex mcp get "$NAME" >/dev/null 2>&1; then say "Codex: Revnu connected. Sign in with: codex mcp login $NAME" else say "Codex: couldn't connect. Run: codex mcp add $NAME --url $URL"; fi fi fi if have gemini; then tools=1 if gemini mcp list 2>&1 | grep -qw "$NAME"; then say "Gemini CLI: Revnu already connected" elif gemini mcp add --transport http --scope user "$NAME" "$URL" >/dev/null 2>&1; then say "Gemini CLI: Revnu connected. Sign in with: /mcp auth revnu" else say "Gemini CLI: couldn't connect. Run: gemini mcp add --transport http --scope user revnu https://revnu.com/api/mcp"; fi fi if have npx; then if npx -y skills@latest add revnu-app/revnu-plugin --global --yes >/dev/null 2>&1; then say "Revnu skills installed" else say "Revnu skills: couldn't install. Run: npx skills add revnu-app/revnu-plugin --global"; fi else say "Revnu skills: need Node.js. Then run: npx skills add revnu-app/revnu-plugin --global" fi if [ "$tools" -eq 0 ]; then say "" say "No Claude Code, Codex or Gemini CLI found. For Claude, ChatGPT and Cursor: https://revnu.com/agents" exit 0 fi say "" say "Done. Open your coding agent and say: \"Set me up with revnu.com\"" } main