Add a broke command: typing broke in a new Terminal starts it again (#1)

This commit is contained in:
minimus7 authored and GitHub committed 2026-11-09 17:05:00 -06:00
1 parent af66279940
commit 0d9ccfa209
3 files changed
+10 -3

No files matched your search

+1 -1
View File
@@ -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.
+8 -1
View File
@@ -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
+1 -1
View File
@@ -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;
}