Skip to content
Back to search

rho

An AI agent that stays running, remembers across sessions, and checks in on its own. macOS, Linux, Android. Built on Pi.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/mikeyobrien/rho with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/mikeyobrien/rho'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mikeyobrien--rho/badge.svg)](/listings/mikeyobrien--rho)

HTML

<a href="/listings/mikeyobrien--rho"><img src="/api/listings/mikeyobrien--rho/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prerequisites: **Node.js 18+**, **tmux**, **git**

npm install -g @rhobot-dev/rho
rho init && rho sync
rho login && rho start
rho

That gives you: - initialized config in `~/.rho/` - authenticated provider access via pi - background heartbeat daemon - an attached interactive session

First 5 minutes

Run these after install:

rho status                # daemon + module health
/rho status               # heartbeat status (inside session)
/rho now                  # trigger immediate check-in
/brain                    # open memory viewer
/vault inbox              # see captured knowledge items

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 205 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. ---
  2. name: install-rho
  3. description: "Install and configure Rho from scratch (Doom-style init.toml + sync). Only prereq: a coding agent that can run shell commands."
  4. ---
  5. # Install Rho
  6. Rho is a persistent AI agent framework. It runs in tmux, checks in on a heartbeat, accumulates memory in a single brain.jsonl file, and manages a knowledge vault. This skill installs it from scratch.
  7. **Prerequisites:** A coding agent that can run shell commands. That's it.
  8. **What gets installed:**
  9. - System deps (Node.js 18+, npm, tmux, git)
  10. - [pi coding agent](https://github.com/badlogic/pi-mono) (the runtime rho extends)
  11. - [rho](https://github.com/mikeyobrien/rho) (the agent framework)
  12. - Config files in `~/.rho/` (init.toml, packages.toml, brain.jsonl)
  13. **Time:** ~5 minutes on a decent connection.
  14. ## Parameters
  15. - **agent_name** (optional, default: `rho`): Name written into `~/.rho/init.toml`.
  16. - **heartbeat_interval** (optional, default: `30m`): How often the agent checks in. Written to `[settings.heartbeat].interval`.
  17. ## Steps
  18. ### 1. Detect environment
  19. Print OS, shell, and dependency versions. This determines the install path.
  20. **Constraints:**
  21. - You MUST print OS + shell + node version (if present).
  22. - You MUST NOT assume Termux unless `$TERMUX_VERSION` is set.
  23. ```bash
  24. uname -a
  25. printf "SHELL=%s\n" "$SHELL"
  26. command -v node >/dev/null && node -v || echo "node: missing"
  27. command -v npm >/dev/null && npm -v || echo "npm: missing"
  28. command -v tmux >/dev/null && tmux -V || echo "tmux: missing"
  29. command -v git >/dev/null && git --version || echo "git: missing"
  30. command -v pi >/dev/null && pi --version || echo "pi: missing"
  31. command -v rho >/dev/null && rho --version || echo "rho: missing"
  32. ```
  33. ### 2. Install system dependencies
  34. **Constraints:**
  35. - You MUST ensure: Node.js >= 18, npm, tmux, git.
  36. - You MUST detect the platform and use the correct package manager.
  37. - You MUST NOT blindly run `sudo apt install` — detect the package manager first.
  38. #### Android / Termux
  39. ```bash
  40. pkg update -y
  41. pkg install -y nodejs-lts tmux git
  42. ```
  43. #### macOS
  44. ```bash
  45. brew install node tmux git
  46. ```
  47. #### Linux
  48. Detect the package manager:
  49. | Distro | Command |
  50. |--------|---------|
  51. | NixOS | Add to `environment.systemPackages` or `nix-shell -p nodejs tmux git` |
  52. | Debian/Ubuntu | `sudo apt update && sudo apt install -y nodejs npm tmux git` |
  53. | Arch | `sudo pacman -S nodejs npm tmux git` |
  54. | Fedora | `sudo dnf install nodejs npm tmux git` |
  55. If Node.js version is < 18, use [NodeSource](https://github.com/nodesource/distributions) or nvm.
  56. ### 3. Install pi coding agent
  57. pi is the runtime that rho extends. Install it globally.
  58. **Constraints:**
  59. - You MUST install pi globally if `command -v pi` fails.
  60. - You MUST verify the install succeeded.
  61. ```bash
  62. command -v pi >/dev/null || npm install -g @mariozechner/pi-coding-agent
  63. pi --version
  64. ```
  65. ### 4. Install rho
  66. Clone the repo and run the installer. The installer handles config bootstrapping, CLI setup, and brain initialization.
  67. **Constraints:**
  68. - You MUST clone to `~/.rho/project` (the default path).
  69. - You MUST NOT clone if the repo already exists (pull instead).
  70. - You MUST run `install.sh` from within the repo directory.
  71. ```bash
  72. if [ -d ~/.rho/project/.git ]; then
  73. echo "Rho repo exists, pulling latest..."
  74. cd ~/.rho/project && git pull --ff-only
  75. else
  76. git clone https://github.com/mikeyobrien/rho.git ~/.rho/project
  77. fi
  78. cd ~/.rho/project && bash install.sh
  79. ```
  80. The installer will:
  81. 1. Detect your platform
  82. 2. Check/install remaining dependencies
  83. 3. Install Node deps for the project
  84. 4. Set up the `rho` CLI on your PATH
  85. 5. Run `rho init` (generates `~/.rho/init.toml`, `~/.rho/packages.toml`, and brain.jsonl defaults)
  86. 6. Run `rho sync` (writes pi's `settings.json` from your config)
  87. ### 5. Configure heartbeat interval (optional)
  88. If the user requested a non-default interval, edit `~/.rho/init.toml`:
  89. ```bash
  90. # Find the [settings.heartbeat] section and set the interval
  91. sed -i 's/interval = "30m"/interval = "'"${HEARTBEAT_INTERVAL}"'"/' ~/.rho/init.toml
  92. rho sync
  93. ```
  94. ### 6. Verify installation
  95. **Constraints:**
  96. - You MUST run `rho doctor` and report any failures.
  97. - You MUST NOT declare success if doctor reports errors.
  98. ```bash
  99. rho doctor
  100. ```
  101. ### 7. Authenticate
  102. **Constraints:**
  103. - You MUST tell the user to run `rho login` to set up their LLM provider.
  104. - You MUST NOT run `rho login` automatically (it's interactive).
  105. Tell the user:
  106. > Run `rho login` to authenticate with your LLM provider (Anthropic, OpenAI, etc). This is interactive — you'll need to provide API keys or log in via browser.
  107. ### 8. Start rho (optional)
  108. **Constraints:**
  109. - You MUST ask before starting background processes.
  110. ```bash
  111. rho
  112. ```
  113. This starts the daemon if needed and attaches to the tmux session.
  114. ### 9. Post-install orientation
  115. Share these essentials with the user:
  116. **Key files:**
  117. - `~/.rho/init.toml` — Main config (Doom-style: modules, settings)
  118. - `~/.rho/packages.toml` — Third-party pi packages
  119. - `~/.rho/brain/brain.jsonl` — Single source of truth for all memory (behaviors, learnings, preferences, tasks, reminders)
  120. **Memory system:**
  121. - `/brain` or `brain action=list` — View memory stats
  122. - `brain action=add type=learning text="..."` — Add a learning
  123. - `brain action=add type=preference text="..." category=Code` — Add a preference
  124. - `brain action=add type=task description="..." priority=high` — Add a task
  125. - `brain action=add type=reminder text="..." cadence={kind:"daily",at:"08:00"}` — Add a reminder
  126. - `memory-consolidate` — Run consolidation (decay stale entries, mine sessions since last consolidation)
  127. **CLI basics:**
  128. - `rho` — Start and attach
  129. - `rho status` — Show daemon and module status
  130. - `rho doctor` — Health check
  131. - `rho trigger` — Force immediate heartbeat
  132. - `rho stop` — Stop daemon
  133. - `rho upgrade` — Update rho and sync new modules
  134. **Inside a session:**
  135. - `/rho status` — Heartbeat state
  136. - `/rho now` — Trigger check-in
  137. - `/rho interval 30m` — Set check-in interval
  138. **tmux essentials (if unfamiliar):**
  139. - Detach: `Ctrl-b d`
  140. - List sessions: `tmux -L rho ls`
  141. - Attach: `tmux -L rho attach -t rho`
  142. ## Troubleshooting
  143. | Problem | Fix |
  144. |---------|-----|
  145. | `rho sync` says pi missing | `npm install -g @mariozechner/pi-coding-agent` |
  146. | `rho doctor` shows settings out of sync | `rho sync` |
  147. | `rho` not found after install | Add `~/.local/bin` to PATH |
  148. | tmux missing | Install with your platform's package manager |
  149. | Node.js < 18 | Upgrade via nvm or NodeSource |
  150. | `install.sh` fails on NixOS | Dependencies must be in your nix config, not installed via apt |
README.md · README · 295 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # rho
  2. [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mikeyobrien/rho)
  3. [![@tau_rho_ai](https://img.shields.io/badge/@tau__rho__ai-000000?logo=x)](https://x.com/tau_rho_ai)
  4. An always-on personal AI operator that:
  5. - stays running in the background,
  6. - remembers context across sessions,
  7. - and checks in proactively on a schedule.
  8. Runs on **macOS**, **Linux**, and **Android** (plus **iPhone/iPad via SSH**).
  9. <p align="center">
  10. <img alt="rho web ui" src="docs/web-ui-hero.jpg" />
  11. </p>
  12. Built on [pi coding agent](https://github.com/badlogic/pi-mono).
  13. <details>
  14. <summary><b>Terminal demo</b></summary>
  15. ![Rho demo](docs/demo.gif)
  16. </details>
  17. ---
  18. ## Why rho
  19. Most AI tools are stateless chat tabs. rho is built for ongoing operation.
  20. - **Persistent memory**: durable context across sessions
  21. - **Memory observability**: inspect, search, and edit what the agent has learned
  22. - **Proactive heartbeat**: check-ins every 30m by default
  23. - **Local-first state**: your memory and config stay on your machine
  24. - **BYO model/provider**: use your own pi/provider setup
  25. - **Multi-surface control**: terminal, web UI, Telegram, and agent email
  26. ---
  27. ## 2-minute quick start (recommended)
  28. Prerequisites: **Node.js 18+**, **tmux**, **git**
  29. ```bash
  30. npm install -g @rhobot-dev/rho
  31. rho init && rho sync
  32. rho login && rho start
  33. rho
  34. ```
  35. That gives you:
  36. - initialized config in `~/.rho/`
  37. - authenticated provider access via pi
  38. - background heartbeat daemon
  39. - an attached interactive session
  40. ### First 5 minutes
  41. Run these after install:
  42. ```bash
  43. rho status # daemon + module health
  44. /rho status # heartbeat status (inside session)
  45. /rho now # trigger immediate check-in
  46. /brain # open memory viewer
  47. /vault inbox # see captured knowledge items
  48. ```
  49. ---
  50. ## Web UI (first-class, built in)
  51. rho includes a browser workspace for day-to-day operation:
  52. - chat with real-time streaming responses
  53. - session browsing + forking from any message
  54. - memory management (`/brain` entries)
  55. - task management
  56. - config editing (`~/.rho/init.toml`)
  57. - line-level code review at `/review`
  58. ### Lightweight + performant by design
  59. - **No-build web split**: server logic in `web/*.ts`, browser runtime in `web/public/js/*.js` (no frontend bundler/transpile pipeline).
  60. - **Lean server runtime**: Hono-based routes with response compression enabled.
  61. - **Low-latency updates**: live RPC/WebSocket streaming for chat responses.
  62. - **Push over poll where possible**: server emits `sessions_changed` UI events; client updates immediately.
  63. - **Idle-aware behavior**: polling pauses when the tab is hidden or user is idle, then resumes on activity.
  64. - **Render throttling for streams**: markdown updates are debounced (150ms) to reduce UI churn during rapid token deltas.
  65. - **Session metadata caching**: session info is cached by file `mtime` to avoid unnecessary re-reads.
  66. ```bash
  67. rho web
  68. rho web --port 4000
  69. rho web --open
  70. ```
  71. Then open `http://localhost:3141` (or your host IP).
  72. ### Positioning vs OpenClaw / nanobot
  73. | Project | Web experience emphasis |
  74. |---|---|
  75. | **rho** | Built-in operator workspace with stronger memory observability and a lightweight no-build stack (chat, learned-memory inspection/editing, tasks, config, review) |
  76. | **OpenClaw** | Strong Gateway Control UI + WebChat control plane |
  77. | **nanobot** | README primarily emphasizes CLI + channel gateway flows |
  78. ---
  79. ## Install alternatives
  80. <details>
  81. <summary><b>pi package install</b></summary>
  82. ```bash
  83. pi install npm:@rhobot-dev/rho
  84. rho init && rho sync
  85. rho login && rho start
  86. ```
  87. </details>
  88. <details>
  89. <summary><b>macOS / Linux (installer script)</b></summary>
  90. ```bash
  91. git clone https://github.com/mikeyobrien/rho.git ~/.rho/project
  92. cd ~/.rho/project && ./install.sh
  93. ```
  94. The installer checks missing dependencies and supports NixOS.
  95. </details>
  96. <details>
  97. <summary><b>Android (Termux)</b></summary>
  98. Install [Termux](https://f-droid.org/packages/com.termux/) and [Termux:API](https://f-droid.org/packages/com.termux.api/) from F-Droid, then:
  99. ```bash
  100. curl -fsSL https://rhobot.dev/install | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 142 on GitHub
  101. ```
  102. If Termux can't build the optional `node-pty` native module, rho still installs and runs. Only the embedded web terminal drawer is disabled until `node-pty` works on that device.
  103. </details>
  104. <details>
  105. <summary><b>iPhone / iPad via SSH</b></summary>
  106. Run rho on a server/VPS/home machine, then connect from iOS using Termius (or any SSH client).
  107. Guide: [docs/iphone-setup.md](docs/iphone-setup.md)
  108. </details>
  109. ---
  110. ## What you can do with rho
  111. | Use case | What rho does |
  112. |---|---|
  113. | **Daily operator loop** | Keeps reminders/tasks alive between sessions and runs periodic check-ins |
  114. | **Memory-backed coding copilot** | Stores durable behavior/preferences/learnings, and lets you inspect/edit that learned state directly |
  115. | **Inbox agent** | Gets `name@rhobot.dev`, polls, reads, and replies to email |
  116. | **Telegram-controlled agent** | Receives prompts from Telegram and responds in-thread |
  117. | **Browser control panel** | Web UI for chat, memory, tasks, and config |
  118. ---
  119. ## Mobile Live Mode (native Android wrapper)
  120. If you use the native Android wrapper (`mobile/rho-android`) to run rho-web, background behavior has two explicit modes:
  121. - **Idle Mode (default):** best battery behavior. No always-on background socket while the app is backgrounded; reconnect + replay happens when the app becomes active again.
  122. - **Live Mode (GO LIVE):** starts an Android foreground service with a persistent notification and lease heartbeats to keep active streams alive while locked/backgrounded.
  123. Use **Live Mode** when stream continuity matters (for example, long active responses while the phone is locked). Without it, WebView background limits can cause disconnect/orphan behavior around the default orphan window.
  124. Tradeoffs:
  125. - higher battery/network usage while Live Mode is active,
  126. - persistent foreground notification,
  127. - explicit user-controlled lifecycle (`GO LIVE` / `STOP LIVE`).
  128. Baseline Live Mode reliability does **not** require Firebase credentials.
  129. ---
  130. ## Surfaces and modules
  131. ### Core runtime
  132. - **Heartbeat**: scheduled autonomous check-ins
  133. - **Brain**: append-only structured memory (`brain.jsonl`)
  134. - **Vault**: markdown knowledge graph (`~/.rho/vault/`)
  135. ### Channels
  136. - **Email**: agent inbox at `name@rhobot.dev`
  137. - **Telegram**: polling adapter with allowlist + moderation flow
  138. ### Interface
  139. - **CLI**: `rho ...` commands
  140. - **Session slash commands**: `/rho`, `/brain`, `/vault`, `/skill`, `/telegram`, `/email`
  141. - **Web UI**: chat + memory/tasks/config in browser
  142. ---
  143. ## Security and ownership model
  144. - **Your memory is local** (`~/.rho/brain/brain.jsonl`)
  145. - **Your config is local** (`~/.rho/init.toml`, `~/.rho/packages.toml`)
  146. - **Your providers are yours** (`rho login` via pi)
  147. - **Telegram controls**: allowlists and mention gating
  148. - **Email controls**: sender controls + outbound policy limits
  149. No hosted rho memory backend required.
  150. ---
  151. ## Command quick reference
  152. ```bash
  153. rho # start and attach
  154. rho init # initialize ~/.rho config
  155. rho sync # sync rho config to pi
  156. rho doctor # health + config checks
  157. rho login # authenticate providers
  158. rho start # start background daemon
  159. rho stop # stop daemon
  160. rho status # daemon/module status
  161. rho trigger # force heartbeat now
  162. rho logs # recent heartbeat output
  163. rho config # show effective config
  164. rho calc "2 + 2 * 3" # quick arithmetic calculator
  165. rho upgrade # update and resync
  166. rho skills <args> # skills provider wrapper
  167. ```
  168. Inside a session:
  169. ```text
  170. /rho status heartbeat state
  171. /rho now immediate check-in
  172. /rho interval 30m set check-in interval
  173. /rho enable/disable toggle heartbeat
  174. /bootstrap status bootstrap lifecycle state
  175. /brain memory operations
  176. /vault inbox captured vault items
  177. /skill run pdd planning workflow
  178. /skill run code-assist implementation workflow
  179. ```
  180. ---
  181. ## Platform support
  182. | Platform | Status | Notes |
  183. |---|---|---|
  184. | Linux | Supported | Native install + daemon + web UI |
  185. | macOS | Supported | Native install + daemon + web UI |
  186. | Android (Termux) | Supported | Extra mobile capabilities via platform skills |
  187. | iPhone/iPad | Supported (SSH client) | Run rho remotely, connect via SSH |
  188. ---
  189. ## Docs map
  190. - [Demo walkthrough](docs/demo.md)
  191. - [Telegram setup + troubleshooting](docs/telegram.md)
  192. - [iPhone/iPad setup](docs/iphone-setup.md)
  193. - [Android mobile app over Tailscale](docs/mobile-tailscale.md)
  194. - [VPS setup guide](docs/vps-setup.md)
  195. - [Skills providers (vercel + clawhub)](docs/skills.md)
  196. - [Brain bootstrapping guide](docs/bootstrapping-brain.md)
  197. - [Configuration reference](docs/configuration.md)
  198. ---
  199. ## For contributors
  200. Project structure and internals are intentionally modular:
  201. - `cli/` for command surface and daemon orchestration
  202. - `extensions/` for runtime tools/modules
  203. - `skills/` for portable markdown runbooks
  204. - `platforms/` for platform-specific installs/capabilities
  205. - `web/` for browser UI + RPC bridge
  206. For full tree + extension/skill details, see current `README.md` and `docs/`.
  207. ---
  208. ## Links
  209. - [pi coding agent](https://github.com/badlogic/pi-mono)
  210. - [@tau_rho_ai](https://x.com/tau_rho_ai)
install.sh · Bundled script · 347 lines · 1 finding marked
  1. #!/usr/bin/env bash
  2. # Rho — Universal installer
  3. #
  4. # Two modes, auto-detected:
  5. #
  6. # User install (curl | bash, or run standalone):
  7. # curl -fsSL https://rhobot.dev/install | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 7 on GitHub
  8. # Installs rho via npm. No repo clone needed.
  9. #
  10. # Developer install (run from a git checkout):
  11. # git clone https://github.com/mikeyobrien/rho.git
  12. # cd rho && ./install.sh
  13. # Symlinks rho CLI from local source, installs local deps.
  14. #
  15. # Both paths end with: rho init + rho sync.
  16. #
  17. # Usage: ./install.sh [--force]
  18. # --force: overwrite existing config files
  19. #
  20. # Idempotent: safe to run multiple times.
  21. set -e
  22. # ── Colors ─────────────────────────────────────────────────
  23. RED='\033[0;31m'
  24. GREEN='\033[0;32m'
  25. YELLOW='\033[1;33m'
  26. CYAN='\033[0;36m'
  27. NC='\033[0m'
  28. info() { echo -e "${CYAN}>${NC} $1"; }
  29. ok() { echo -e "${GREEN}ok${NC} $1"; }
  30. warn() { echo -e "${YELLOW}!!${NC} $1"; }
  31. fail() { echo -e "${RED}error${NC} $1"; exit 1; }
  32. # ── Parse args ─────────────────────────────────────────────
  33. FORCE=0
  34. for arg in "$@"; do
  35. case "$arg" in
  36. --force) FORCE=1 ;;
  37. esac
  38. done
  39. # ── Detect install mode ───────────────────────────────────
  40. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" 2>/dev/null && pwd)"
  41. detect_mode() {
  42. # Dev mode: script lives alongside our package.json (git checkout or extracted archive)
  43. if [ -f "$SCRIPT_DIR/package.json" ]; then
  44. if grep -q '"@rhobot-dev/rho"' "$SCRIPT_DIR/package.json" 2>/dev/null; then
  45. MODE="dev"
  46. REPO_DIR="$SCRIPT_DIR"
  47. return
  48. fi
  49. fi
  50. MODE="user"
  51. }
  52. # ── Detect platform ───────────────────────────────────────
  53. detect_platform() {
  54. if [ -n "$TERMUX_VERSION" ]; then
  55. PLATFORM="android"
  56. else
  57. case "$(uname -s)" in
  58. Darwin) PLATFORM="macos" ;;
  59. Linux) PLATFORM="linux" ;;
  60. *) fail "Unsupported OS: $(uname -s)" ;;
  61. esac
  62. fi
  63. }
  64. # ── Banner ─────────────────────────────────────────────────
  65. show_banner() {
  66. echo ""
  67. echo -e "${CYAN}rho${NC} -- persistent ai agent"
  68. echo -e "${CYAN}---${NC} $PLATFORM / $MODE install"
  69. echo ""
  70. }
  71. # ── System dependencies ───────────────────────────────────
  72. install_deps_android() {
  73. if ! command -v termux-battery-status &>/dev/null; then
  74. warn "Termux:API not installed"
  75. echo " Install from F-Droid: https://f-droid.org/packages/com.termux.api/"
  76. echo " Rho will work without it, but you'll miss notifications, sensors, etc."
  77. echo ""
  78. read -p "Continue anyway? [Y/n] " -n 1 -r
  79. echo
  80. [[ $REPLY =~ ^[Nn]$ ]] && exit 1
  81. fi
  82. info "Installing system packages..."
  83. pkg update -y -q 2>/dev/null
  84. pkg install -y -q nodejs-lts tmux 2>/dev/null
  85. if [ "$MODE" = "dev" ]; then
  86. pkg install -y -q git 2>/dev/null
  87. fi
  88. ok "nodejs $(node --version), tmux"
  89. }
  90. install_deps_macos() {
  91. local missing=()
  92. command -v node &>/dev/null || missing+=("node")
  93. command -v npm &>/dev/null || missing+=("npm")
  94. command -v tmux &>/dev/null || missing+=("tmux")
  95. if [ ${#missing[@]} -gt 0 ]; then
  96. warn "Missing: ${missing[*]}"
  97. if command -v brew &>/dev/null; then
  98. info "Installing via Homebrew..."
  99. for pkg in "${missing[@]}"; do
  100. case "$pkg" in
  101. node|npm) brew install node ;;
  102. *) brew install "$pkg" ;;
  103. esac
  104. done
  105. else
  106. echo ""
  107. echo " Install Homebrew: https://brew.sh"
  108. echo " Then: brew install node tmux"
  109. fail "Missing dependencies"
  110. fi
  111. fi
  112. ok "node $(node --version), tmux"
  113. }
  114. install_deps_linux() {
  115. local missing=()
  116. command -v node &>/dev/null || missing+=("node")
  117. command -v npm &>/dev/null || missing+=("npm")
  118. command -v tmux &>/dev/null || missing+=("tmux")
  119. if [ ${#missing[@]} -gt 0 ]; then
  120. warn "Missing: ${missing[*]}"
  121. echo ""
  122. if [ -f /etc/NIXOS ] || command -v nixos-rebuild &>/dev/null; then
  123. echo " Add nodejs and tmux to environment.systemPackages, or:"
  124. echo " nix-shell -p nodejs tmux"
  125. elif command -v apt &>/dev/null; then
  126. echo " sudo apt update && sudo apt install -y nodejs npm tmux"
  127. elif command -v pacman &>/dev/null; then
  128. echo " sudo pacman -S nodejs npm tmux"
  129. elif command -v dnf &>/dev/null; then
  130. echo " sudo dnf install nodejs npm tmux"
  131. else
  132. echo " Install node (18+), npm, and tmux using your package manager"
  133. fi
  134. echo ""
  135. fail "Install missing dependencies and re-run"
  136. fi
  137. ok "node $(node --version), tmux"
  138. }
  139. # ── Install pi ─────────────────────────────────────────────
  140. install_pi() {
  141. if command -v pi &>/dev/null; then
  142. ok "pi already installed"
  143. else
  144. info "Installing pi coding agent..."
  145. npm install -g @mariozechner/pi-coding-agent
  146. ok "pi installed"
  147. fi
  148. }
  149. # ── Install rho (user mode: npm) ──────────────────────────
  150. install_rho_npm() {
  151. info "Installing rho via npm..."
  152. if command -v rho &>/dev/null; then
  153. local current
  154. current=$(rho --version 2>/dev/null || echo "unknown")
  155. ok "rho already installed ($current), upgrading..."
  156. fi
  157. npm install -g @rhobot-dev/rho
  158. ok "rho $(rho --version 2>/dev/null)"
  159. }
  160. # ── Install rho (dev mode: local checkout) ────────────────
  161. install_rho_dev() {
  162. info "Installing rho from local checkout: $REPO_DIR"
  163. # Local node deps
  164. info "Installing Node dependencies..."
  165. (cd "$REPO_DIR" && npm install)
  166. # Install extension-level dependencies
  167. for ext_pkg in "$REPO_DIR"/extensions/*/package.json; do
  168. [ -f "$ext_pkg" ] || continue
  169. local ext_dir
  170. ext_dir="$(dirname "$ext_pkg")"
  171. info "Installing deps for extension: $(basename "$ext_dir")"
  172. (cd "$ext_dir" && npm install)
  173. done
  174. # Clean up old-style symlinks from previous installs
  175. local pi_dir="$HOME/.pi/agent"
  176. if [ -L "$pi_dir/extensions" ]; then
  177. rm -f "$pi_dir/extensions"
  178. elif [ -d "$pi_dir/extensions" ]; then
  179. find "$pi_dir/extensions" -maxdepth 1 -type l -delete 2>/dev/null || true
  180. fi
  181. if [ -L "$pi_dir/skills" ]; then
  182. rm -f "$pi_dir/skills"
  183. elif [ -d "$pi_dir/skills" ]; then
  184. find "$pi_dir/skills" -maxdepth 1 -type l -delete 2>/dev/null || true
  185. fi
  186. # Symlink rho CLI from this checkout
  187. local bin_dir
  188. if [ -n "$PREFIX" ] && [ -d "$PREFIX/bin" ]; then
  189. bin_dir="$PREFIX/bin"
  190. else
  191. bin_dir="$HOME/.local/bin"
  192. mkdir -p "$bin_dir"
  193. fi
  194. # Remove legacy wrapper symlinks
  195. for name in rho-daemon rho-status rho-stop rho-trigger rho-login; do
  196. [ -L "$bin_dir/$name" ] && rm -f "$bin_dir/$name"
  197. done
  198. chmod +x "$REPO_DIR/cli/index.ts" 2>/dev/null || true
  199. ln -sf "$REPO_DIR/cli/index.ts" "$bin_dir/rho"
  200. ok "rho CLI -> $bin_dir/rho (linked to $REPO_DIR/cli/index.ts)"
  201. # Platform-specific scripts
  202. if [ "$PLATFORM" = "android" ]; then
  203. local stt_dir="$REPO_DIR/platforms/android/scripts/bin"
  204. if [ -d "$stt_dir" ]; then
  205. mkdir -p "$HOME/bin"
  206. for script in "$stt_dir"/stt "$stt_dir"/stt-send; do
  207. [ -f "$script" ] || continue
  208. chmod +x "$script"
  209. ln -sf "$script" "$HOME/bin/$(basename "$script")"
  210. done
  211. ok "STT scripts -> ~/bin"
  212. fi
  213. fi
  214. # Warn about PATH on non-Termux
  215. if [ "$PLATFORM" != "android" ]; then
  216. case ":$PATH:" in
  217. *":$bin_dir:"*) ;;
  218. *)
  219. warn "$bin_dir is not in your PATH. Add to your shell profile:"
  220. echo " export PATH=\"$bin_dir:\$PATH\""
  221. ;;
  222. esac
  223. fi
  224. }
  225. # ── Bootstrap config ──────────────────────────────────────
  226. bootstrap_config() {
  227. echo ""
  228. info "Initializing config..."
  229. local init_args="--name rho"
  230. if [ "$FORCE" -eq 1 ]; then
  231. init_args="$init_args --force"
  232. fi
  233. if [ "$MODE" = "dev" ]; then
  234. # Run CLI directly from checkout, sync with local source
  235. node --experimental-strip-types "$REPO_DIR/cli/index.ts" init $init_args
  236. echo ""
  237. info "Syncing config (source: $REPO_DIR)..."
  238. RHO_SOURCE="$REPO_DIR" node --experimental-strip-types "$REPO_DIR/cli/index.ts" sync
  239. else
  240. rho init $init_args
  241. echo ""
  242. info "Syncing config..."
  243. rho sync
  244. fi
  245. }
  246. # ── Platform setup ────────────────────────────────────────
  247. run_platform_setup() {
  248. if [ "$MODE" = "dev" ]; then
  249. local setup="$REPO_DIR/platforms/$PLATFORM/setup.sh"
  250. if [ -f "$setup" ]; then
  251. echo ""
  252. chmod +x "$setup"
  253. bash "$setup"
  254. fi
  255. fi
  256. }
  257. # ── Done ───────────────────────────────────────────────────
  258. show_done() {
  259. echo ""
  260. echo -e "${GREEN}rho is ready.${NC}"
  261. echo ""
  262. echo " rho start and attach"
  263. echo " rho start start in background"
  264. echo " rho login connect your LLM provider"
  265. echo ""
  266. echo " /rho status check heartbeat (inside session)"
  267. echo " /rho now trigger check-in"
  268. echo ""
  269. case "$PLATFORM" in
  270. android)
  271. echo " optional:"
  272. echo " install Tasker for UI automation"
  273. echo " use /brain to manage memory and reminders"
  274. ;;
  275. *)
  276. echo " optional:"
  277. echo " use /brain to manage memory and reminders"
  278. ;;
  279. esac
  280. echo ""
  281. }
  282. # ── Main ───────────────────────────────────────────────────
  283. detect_mode
  284. detect_platform
  285. show_banner
  286. case "$PLATFORM" in
  287. android) install_deps_android ;;
  288. macos) install_deps_macos ;;
  289. linux) install_deps_linux ;;
  290. esac
  291. install_pi
  292. if [ "$MODE" = "dev" ]; then
  293. install_rho_dev
  294. else
  295. install_rho_npm
  296. fi
  297. bootstrap_config
  298. run_platform_setup
  299. show_done

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.