# Install Maurice

You are the code agent on this machine, with a terminal. "Connect" means you can call Maurice from this session. A Console account is not required for this first local use. Do not use sudo. Do not paste secrets, tokens, or pairing links in your report.

Maurice is one `maurice` binary: the CLI and the free local runtime, with no account and no Docker. The script picks the newest stable version for this machine from the https://get.agentmaurice.app manifest (not the GitHub API), downloads the archive and its SHA-256 from that same site, and verifies the checksum itself. On macOS it also verifies the Apple signature of the binary.

## 1. Say where you are, before any download

Print the operating system (`uname -s`), the architecture (`uname -m`), the data directory `$HOME/.maurice/one`, and whether this shell is a container (`/.dockerenv` or `/run/.containerenv`), a remote session (`SSH_CONNECTION`), or the account from `id -un`.

On Windows, in PowerShell, print `[System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture`, the directory `$HOME\.maurice\one` and the account (`whoami`).

Qualified today: macOS Apple Silicon (`Darwin` and `arm64`), Linux `x86_64` (amd64), Linux `aarch64` (arm64), Windows x64. Intel Mac (`Darwin` and `x86_64`): stop, there is no public archive. If this is not the machine that was asked for, stop before downloading.

## 2. Install the script from agentmaurice.ai

Download into a temporary directory, never the current directory. Install URL: https://agentmaurice.ai/install.sh. Readable source (audit): https://github.com/agentmaurice/maurice/blob/c33f41e7ecf6cef4f566b779772e2f4d13fb5f88/install.sh. Do not use `raw.githubusercontent.com` or `api.github.com`. Do not add `--version`.

The script selects the newest stable version that exists for this operating system and architecture. If the same version or a newer one is already installed, it keeps it. Otherwise, including an earlier Maurice preview, it replaces the binary, stops the old process, and starts Maurice again on the same directory `$HOME/.maurice/one`. It does not delete that directory and does not print a new pairing prompt.

```sh
install_tmp="$(mktemp -d)"
curl -fsSL https://agentmaurice.ai/install.sh -o "$install_tmp/install.sh"
sh "$install_tmp/install.sh" --install-dir "$HOME/.local/bin" --no-autostart --data-dir "$HOME/.maurice/one"
```

On Windows, in PowerShell, without administrator rights. Install URL: https://agentmaurice.ai/install.ps1. Readable source (audit): https://github.com/agentmaurice/maurice/blob/c33f41e7ecf6cef4f566b779772e2f4d13fb5f88/install.ps1. The binary goes to `%LOCALAPPDATA%\AgentMaurice\bin\maurice.exe`. Install counting does not exist on Windows yet: add no counting flag.

```powershell
$installTmp = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid().ToString('N'))
New-Item -ItemType Directory -Path $installTmp | Out-Null
Invoke-WebRequest -UseBasicParsing https://agentmaurice.ai/install.ps1 -OutFile "$installTmp\install.ps1"
powershell -NoProfile -ExecutionPolicy Bypass -File "$installTmp\install.ps1" -NoAutostart -DataDir "$HOME\.maurice\one"
```

Add `--report-installation` only if the person's message contains "I agree to count this install". That flag sends only a random id, the version, the operating system and the CPU architecture to https://get.agentmaurice.app and the same four fields to PostHog EU. Without that sentence, do not add the flag.

If a flag is rejected, stop and show the exact usage text. Do not invent another installer.

## 3. Prove you can use it

Version and doctor are not enough. Maurice must respond, you must have working access, and a call with no business effect must succeed.

```sh
"$HOME/.local/bin/maurice" version --json
"$HOME/.local/bin/maurice" doctor --data-dir "$HOME/.maurice/one" --json
"$HOME/.local/bin/maurice" ping
```

On Windows:

```powershell
$maurice = Join-Path $env:LOCALAPPDATA 'AgentMaurice\bin\maurice.exe'
& $maurice version --json
& $maurice doctor --data-dir "$HOME\.maurice\one" --json
& $maurice ping
```

Expected: `version` is v2.2.1 or newer, doctor shows running, health_ok and storage_ok, and ping answers 200 OK. `--data-dir` is temporary: the context does not keep the directory yet.

If you cannot call Maurice yet, follow the pairing block already printed. If there is none, run `"$HOME/.local/bin/maurice" setup --pairing-prompt` once. Do not run it again if you can already call Maurice. Do not paste the link.

If that block contains a call command, run it once. A `workflow call` still needs `--runtime-url http://127.0.0.1:5011` until the context keeps that URL. That flag is temporary. Do not invent a workflow.

Report one line: "Maurice is installed and connected", plus the version, the doctor status, and the call result. No pairing link.

Do not run `maurice update install`: it installs the CLI alone, without the local runtime. To update Maurice, run this procedure again.

The data directory is readable by programs running as this user. Stop at the first failure. Retry a failed command at most once.

## 4. Automatic startup, only if the person asks for it

The install above does not start Maurice again after the machine restarts. Never use `--home-profile vm`, `vm-managed` or `home-bootstrap`: those profiles are for VMs reached through an SSH tunnel or managed by the Console, and they change how Maurice is accessed.

On Linux, first check that this machine has a systemd user session:

```sh
systemctl --user show-environment >/dev/null
```

If it fails (for example "Failed to connect to user scope bus"), register nothing. Maurice keeps running. Report: "Automatic startup is not available on this machine; after a restart, running this procedure again starts Maurice." Stop there.

On macOS, there is nothing to check. On Linux once the check passes, and on macOS, run once:

```sh
"$HOME/.local/bin/maurice" stop --data-dir "$HOME/.maurice/one"
"$HOME/.local/bin/maurice" service install --data-dir "$HOME/.maurice/one"
"$HOME/.local/bin/maurice" service status
"$HOME/.local/bin/maurice" ping
```

On Windows, without administrator rights:

```powershell
& $maurice stop --data-dir "$HOME\.maurice\one"
& $maurice service install --data-dir "$HOME\.maurice\one"
& $maurice service status
& $maurice ping
```

Maurice then starts each time this user's session opens. If any of these four commands fails, remove the service with `"$HOME/.local/bin/maurice" service uninstall` (on Windows: `& $maurice service uninstall`), start Maurice by hand with `"$HOME/.local/bin/maurice" start --wait 120s --data-dir "$HOME/.maurice/one"` (on Windows: `& $maurice start --wait 120s --data-dir "$HOME\.maurice\one"`), check `ping`, then report the failure with its exact message.
