diff --git a/README.md b/README.md index e0ba11c..473cafe 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This puts broke in `~/broke` and opens a setup page. Paste in your keys there, o 2. **Plaid** (free for test banks): your bank connection. 3. **AI** (optional): broke finds Claude Code, Codex, Gemini CLI, opencode or a local model on your computer. Or connect OpenRouter in one click. -To start it again: double-click **Start broke.command** on a Mac, or run `npm run app` in the folder. +To start it again: open a new Terminal window and type `broke`. On Windows: `git clone https://github.com/nextwork-projects/broke`, then `npm run app` in that folder. diff --git a/install.sh b/install.sh index c248a98..a8990dd 100755 --- a/install.sh +++ b/install.sh @@ -11,4 +11,11 @@ command -v node >/dev/null || { echo "broke needs Node.js. Get the LTS version f if [ -d "$DIR/.git" ]; then echo "broke is already in $DIR. Starting it."; else git clone --quiet "$REPO" "$DIR"; fi cd "$DIR" -exec node scripts/start.mjs + +# Adds a `broke` command, so a new Terminal window starts it again with one word. +LINE="alias broke='node \"$DIR/scripts/start.mjs\"'" +for RC in "$HOME/.zshrc" "$HOME/.bashrc" "$HOME/.bash_profile"; do + [ "$RC" = "$HOME/.zshrc" ] || [ -f "$RC" ] || continue # zsh is the Mac default; bash files only if they exist + grep -qxF "$LINE" "$RC" 2>/dev/null || printf '\n# broke\n%s\n' "$LINE" >> "$RC" +done +BROKE_TIP=1 exec node scripts/start.mjs diff --git a/scripts/start.mjs b/scripts/start.mjs index da7de78..b7dd2b5 100755 --- a/scripts/start.mjs +++ b/scripts/start.mjs @@ -65,7 +65,7 @@ for (let i = 0; i < 60; i++) { await new Promise((r) => setTimeout(r, 1000)); const up = await fetch(url, { redirect: "manual" }).then(() => true, () => false); if (!up) continue; - console.log(`\nbroke is running at ${url}. Press Ctrl+C to stop it.\n`); + console.log(`\nbroke is running at ${url}. Press Ctrl+C to stop it.${process.env.BROKE_TIP ? "\nTo start it again later, open a new Terminal window and type: broke" : ""}\n`); openIt(); break; }