|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | set -euo pipefail |
3 | 3 |
|
4 | | -# Wrap in a function so bash reads the entire script from stdin before executing. |
5 | | -# Without this, `curl | bash` breaks when we redirect stdin to /dev/tty. |
6 | | -main() { |
7 | | - # Redirect stdin to the terminal only when piped (e.g. curl | bash). |
8 | | - # When run directly, keep the inherited fd β TUI apps like claude need it untouched. |
9 | | - if [ ! -t 0 ]; then |
10 | | - exec < /dev/tty |
11 | | - fi |
| 4 | +# Run with: /bin/bash -c "$(curl -fsSL http://remobi.app/install.sh)" |
| 5 | +# The $() substitution downloads the script first, so stdin stays as the terminal. |
| 6 | +# This is the same pattern Homebrew uses β TUI apps like claude need real terminal stdin. |
12 | 7 |
|
13 | | - echo "" |
14 | | - echo " remobi β your terminal, everywhere" |
15 | | - echo " https://github.com/connorads/remobi" |
16 | | - echo "" |
17 | | - echo " This script will:" |
18 | | - echo " 1. Install the remobi setup skill (via npx skills)" |
19 | | - echo " 2. Ask which coding agent you use" |
20 | | - echo " 3. Start an interactive agent session that walks you through setup" |
21 | | - echo "" |
22 | | - read -r -p "Press Enter to continue..." |
23 | | - |
24 | | - # ββ Install the remobi-setup skill ββββββββββββββββββββββββββββββββββββββββ |
25 | | - |
26 | | - echo "" |
27 | | - echo "Installing the remobi setup skill..." |
28 | | - echo "" |
29 | | - npx skills add connorads/remobi |
30 | | - echo "" |
| 8 | +echo "" |
| 9 | +echo " remobi β your terminal, everywhere" |
| 10 | +echo " https://github.com/connorads/remobi" |
| 11 | +echo "" |
| 12 | +echo " This script will:" |
| 13 | +echo " 1. Install the remobi setup skill (via npx skills)" |
| 14 | +echo " 2. Ask which coding agent you use" |
| 15 | +echo " 3. Start an interactive agent session that walks you through setup" |
| 16 | +echo "" |
| 17 | +read -r -p "Press Enter to continue..." |
31 | 18 |
|
32 | | - # ββ Pick a coding agent βββββββββββββββββββββββββββββββββββββββββββββββββββ |
| 19 | +# ββ Install the remobi-setup skill ββββββββββββββββββββββββββββββββββββββββββ |
33 | 20 |
|
34 | | - echo "Which coding agent do you use?" |
35 | | - echo " 1) Claude Code" |
36 | | - echo " 2) Codex" |
37 | | - printf "Choose [1-2]: " |
38 | | - read -r choice |
| 21 | +echo "" |
| 22 | +echo "Installing the remobi setup skill..." |
| 23 | +echo "" |
| 24 | +npx skills add connorads/remobi |
| 25 | +echo "" |
39 | 26 |
|
40 | | - case "$choice" in |
41 | | - 1) agent="claude" ;; |
42 | | - 2) agent="codex" ;; |
43 | | - *) |
44 | | - echo "Invalid choice. Exiting." |
45 | | - exit 1 |
46 | | - ;; |
47 | | - esac |
| 27 | +# ββ Pick a coding agent βββββββββββββββββββββββββββββββββββββββββββββββββββββ |
48 | 28 |
|
49 | | - # ββ Check the agent is installed ββββββββββββββββββββββββββββββββββββββββββ |
| 29 | +echo "Which coding agent do you use?" |
| 30 | +echo " 1) Claude Code" |
| 31 | +echo " 2) Codex" |
| 32 | +printf "Choose [1-2]: " |
| 33 | +read -r choice |
50 | 34 |
|
51 | | - if ! command -v "$agent" > /dev/null 2>&1; then |
52 | | - echo "" |
53 | | - echo "Error: '$agent' is not installed." |
54 | | - echo "" |
55 | | - case "$agent" in |
56 | | - claude) echo " curl -fsSL https://claude.ai/install.sh | bash" ;; |
57 | | - codex) echo " npm install -g @openai/codex" ;; |
58 | | - esac |
59 | | - echo "" |
60 | | - echo "Install it, then re-run this script." |
| 35 | +case "$choice" in |
| 36 | + 1) agent="claude" ;; |
| 37 | + 2) agent="codex" ;; |
| 38 | + *) |
| 39 | + echo "Invalid choice. Exiting." |
61 | 40 | exit 1 |
62 | | - fi |
| 41 | + ;; |
| 42 | +esac |
63 | 43 |
|
64 | | - # ββ Launch interactive setup session ββββββββββββββββββββββββββββββββββββββ |
| 44 | +# ββ Check the agent is installed ββββββββββββββββββββββββββββββββββββββββββββ |
65 | 45 |
|
| 46 | +if ! command -v "$agent" > /dev/null 2>&1; then |
66 | 47 | echo "" |
67 | | - echo "Starting $agent with the remobi-setup skill..." |
| 48 | + echo "Error: '$agent' is not installed." |
68 | 49 | echo "" |
| 50 | + case "$agent" in |
| 51 | + claude) echo " curl -fsSL https://claude.ai/install.sh | bash" ;; |
| 52 | + codex) echo " npm install -g @openai/codex" ;; |
| 53 | + esac |
| 54 | + echo "" |
| 55 | + echo "Install it, then re-run this script." |
| 56 | + exit 1 |
| 57 | +fi |
| 58 | + |
| 59 | +# ββ Launch interactive setup session ββββββββββββββββββββββββββββββββββββββββ |
69 | 60 |
|
70 | | - # exec replaces this shell with the agent process, giving it full terminal control |
71 | | - exec "$agent" "Use the remobi-setup skill to onboard me." |
72 | | -} |
| 61 | +echo "" |
| 62 | +echo "Starting $agent with the remobi-setup skill..." |
| 63 | +echo "" |
73 | 64 |
|
74 | | -main "$@" |
| 65 | +# exec replaces this shell with the agent process, giving it full terminal control |
| 66 | +exec "$agent" "Use the remobi-setup skill to onboard me." |
0 commit comments