Skip to content

Reason Network: your team's coding agents, talking to each other. The engine behind `reason network`.

install.sh asks once: sign in with Reason, or no account

Lars Talian6d419fffc71c
diff --git a/README.md b/README.md
index 13d754e..43d89e7 100644
--- a/README.md
+++ b/README.md
@@ -10,25 +10,25 @@ opencode, pi and Reason.
## Get started
-No account needed. One person runs this and picks a team name:
-
```sh
curl -fsSL https://github.com/reason-machines/reason-network/releases/latest/download/install.sh | sh
```
-On Windows, in PowerShell:
+It asks one thing: sign in with Reason, or not.
+
+- **With Reason** (the default): your Reason workspace is the team, nobody passes links around, and your agents can
+ reach Reason's cloud agents too. The [Reason CLI](https://reasonmachines.com) installs and runs it; from then on
+ it's `reason network`.
+- **Without an account**: it installs just this engine, asks your name and a team name, and gives you a team link
+ (on your clipboard). Teammates open it, paste one command, type their name, and they're in. Or they tell their
+ agent "join my Reason Network team: <link>".
+
+On Windows (no account), in PowerShell:
```powershell
irm https://github.com/reason-machines/reason-network/releases/latest/download/install.ps1 | iex
```
-You get a team link (it's on your clipboard). Send it to your teammates: they open it, paste one command, type their
-name, and they're in. Or they tell their agent "join my Reason Network team: <link>".
-
-**On Reason?** `reason network` does all of this with your Reason login: your workspace is the team, nobody passes
-links around, and your agents also reach Reason's cloud agents. The [Reason CLI](https://reasonmachines.com) installs
-and updates this engine for you.
-
**Coming from tincan?** Nothing to do: tincan's last update moves each machine over (team, agents, background service).
## What you get
diff --git a/install.sh b/install.sh
index e10788f..cac0b08 100755
--- a/install.sh
+++ b/install.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Installs Reason Network on its own (no account needed) for macOS or Linux.
#
-# curl -fsSL <this url> | sh install, then set up (start or join a team)
+# curl -fsSL <this url> | sh install, then set up (with Reason, or start or join a team)
# curl -fsSL <this url> | sh -s -- <team link> install, then join that team
# curl -fsSL <this url> | sh -s -- <team link> --as <name> the same, without questions (for agents)
# curl -fsSL <this url> | sh -s -- init <team> --as <name> install and start a team, without questions
@@ -29,6 +29,28 @@ case "$(uname -m)" in
esac
target="$arch-$os"
+# Starting fresh in a terminal: Reason first. With it, your Reason workspace is the team (no links to pass around),
+# your agents reach Reason's cloud agents, and the Reason CLI installs and updates this engine. Without it, a team
+# link and no account. Never asked when joining with a link, for agents, or for updates.
+if [ $# -eq 0 ] && [ -z "${REASON_NETWORK_NO_PROMPT:-}" ] && [ ! -e "$bin_dir/reason-network" ] && (exec </dev/tty) 2>/dev/null; then
+ say "With Reason, your Reason workspace is the team (no links to pass around) and your agents can reach Reason's"
+ say "cloud agents. Without it: a team link, no account."
+ printf 'Sign in with Reason? [Y/n] '
+ read -r answer </dev/tty || answer=n
+ case "$answer" in
+ [nN]*) ;;
+ *)
+ reason="$(command -v reason || true)"
+ if [ -z "$reason" ]; then
+ curl -fsSL https://reasonmachines.com/install.sh | bash -s -- --minimal --no-login ||
+ die "installing Reason failed; run this again and answer n to go without an account"
+ reason="${REASON_INSTALL_DIR:-$HOME/.local/bin}/reason"
+ fi
+ exec "$reason" network </dev/tty
+ ;;
+ esac
+fi
+
if [ -n "${REASON_NETWORK_DOWNLOAD_BASE:-}" ]; then
base="$REASON_NETWORK_DOWNLOAD_BASE"
elif [ "$version" = latest ]; then