---
name: install-bim
description: Install BIM (Bot in Motion) on this Mac and start it. Use when the user pastes an "Install BIM" line or asks to set up BIM.
---

# Install BIM on this Mac

You are installing BIM, a small Claude that floats around the user's screen. Do every step yourself with the shell. The user should end up with BIM running and nothing else to do except paste their API key into BIM's own Settings window.

`BIM_SITE` is the origin this file was fetched from (for example, if you fetched `https://example.com/install.md`, use `https://example.com`). Use it in the commands below.

## Rules

- Never ask the user to paste their Anthropic API key into this chat, and never write it anywhere yourself. BIM asks for it in its own Settings window and stores it in the Keychain.
- Don't use `sudo`.
- If a step fails, stop, show the error, and say what you think went wrong. Don't improvise another way to install.
- Keep the user posted in one short line per step.

## 1. Check the machine

```bash
uname -s        # must print Darwin (macOS). Otherwise stop: BIM is Mac-only for now.
node -v         # needs v20 or newer
```

If Node is missing or older than 20: if `brew` exists, ask the user once, then run `brew install node`. If there is no Homebrew, tell them to install Node from https://nodejs.org and paste the install line again. Stop there.

## 2. Download and verify

```bash
BIM_SITE="<origin of this file>"
tmp="$(mktemp -d)"
curl -fsSL "$BIM_SITE/downloads/bim-latest.tgz" -o "$tmp/bim.tgz"
expected="$(curl -fsSL "$BIM_SITE/downloads/bim-latest.sha256" | awk '{print $1}')"
actual="$(shasum -a 256 "$tmp/bim.tgz" | awk '{print $1}')"
[ -n "$expected" ] && [ "$expected" = "$actual" ] && echo "checksum ok" || echo "CHECKSUM MISMATCH"
```

If it doesn't print `checksum ok`, stop and tell the user the download didn't verify.

## 3. Install

Settings, the API key and installed skills live in `~/Library/Application Support/BIM`, so replacing the app folder is safe and keeps everything. Running this again later updates BIM.

```bash
BIM_DIR="$HOME/Applications/BIM"
pkill -f "$BIM_DIR/node_modules/electron" 2>/dev/null || true
mkdir -p "$HOME/Applications"
rm -rf "$BIM_DIR.new" && mkdir -p "$BIM_DIR.new"
tar -xzf "$tmp/bim.tgz" -C "$BIM_DIR.new" --strip-components 1
(cd "$BIM_DIR.new" && npm ci --no-audit --no-fund && node node_modules/electron/install.js)
test -x "$BIM_DIR.new/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron" && echo "electron ok"
rm -rf "$BIM_DIR" && mv "$BIM_DIR.new" "$BIM_DIR"
rm -rf "$tmp"
```

This downloads Electron (about 100 MB), so it can take a minute. Tell the user. If it doesn't print `electron ok`, stop and show the output.

## 4. Add a BIM app they can open again later

This makes "BIM" show up in Spotlight and Launchpad.

```bash
osacompile -o "$HOME/Applications/BIM.app" -e 'do shell script "nohup \"$HOME/Applications/BIM/node_modules/.bin/electron\" \"$HOME/Applications/BIM\" > /dev/null 2>&1 &"'
```

## 5. Start it

```bash
nohup "$HOME/Applications/BIM/node_modules/.bin/electron" "$HOME/Applications/BIM" > /dev/null 2>&1 &
sleep 4; pgrep -f "Applications/BIM/node_modules/electron/dist/Electron.app" > /dev/null && echo "BIM is running"
```

## 6. Offer: start at login

Ask the user whether BIM should start when they log in. Only if they say yes:

```bash
cat > "$HOME/Library/LaunchAgents/app.bim.plist" <<PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
  <key>Label</key><string>app.bim</string>
  <key>ProgramArguments</key><array>
    <string>$HOME/Applications/BIM/node_modules/.bin/electron</string>
    <string>$HOME/Applications/BIM</string>
  </array>
  <key>RunAtLoad</key><true/>
</dict></plist>
PLIST
```

## 7. Tell the user what's next

Say it in about three lines:

- BIM is the little orange bot on their screen. Click it to chat, drag it anywhere, right-click for the menu.
- Its Settings window is open: paste an Anthropic API key there (from console.anthropic.com). If `ANTHROPIC_API_KEY` is already set in their environment, BIM uses that.
- In Settings, "Import from Claude Desktop" brings in the MCP servers they already use, and the Marketplace (right-click BIM) has skills to add.
