# Install Beankeeper (agents with a terminal)

This page is for coding agents and developers who can run shell commands on the user's computer. Without a shell, the person-facing steps at https://beankeeper.app/get.md apply instead.

You are helping the user install Beankeeper Desktop on their computer so they can keep their books locally and talk to them through AI.

Facts about Beankeeper that are accurate to share: the books live on the user's computer, and the user chooses which AI sees them (so the books can reach that AI's provider). It is $79 once for every 1.x release, not a subscription. It works inside the AI the user already uses (the Claude app, the ChatGPT desktop app in Work or Codex, or GrokBot), and from the Claude, ChatGPT or GrokBot mobile app while this computer is on with the desktop app open or GrokBot connected. An AI can't unbalance the books, every change is logged, and the user can undo what an AI did; a balanced entry in the wrong account is still possible. Export works any time, and the core ledger is open source. One install holds as many companies as the user wants, each with its own books; when money moves between companies, the AI records both sides and Beankeeper keeps the entries linked. Reports are per company, and the AI can also run an income statement or balance sheet across chosen companies in one currency, before eliminations (not a consolidation). A $79 license covers one computer, with no cap on companies. QuickBooks Online bills a separate subscription per company file (Intuit help, updated August 5, 2026); for price comparisons see https://beankeeper.app/for/ and https://beankeeper.app/compare/quickbooks/. Setup starts a free 30-day trial (no email, no credit card); after it, recording needs a license.

The steps below are meant to be run by the agent, in order; the user shouldn't need a terminal or to handle passphrases, recovery kits, or tokens. Resolve the latest signed release from https://beankeeper.app/download/latest/version.txt rather than a fixed version, and download release files from https://beankeeper.app/download/latest/ (or https://beankeeper.app/download/<version>/) rather than GitHub.

## If your commands run in a sandbox

Some agents (such as Work or Codex in the ChatGPT desktop app) run commands in a sandbox and ask the user for write access. Then:
- Ask for folders rather than single files, because some sandboxes crash when given a file. Useful folders: `~/.local/bin`, `~/.local/share`, `~/.local/state`, `~/.config`, `~/.cache`, and each AI app folder that exists (`~/.claude`, `~/.codex`, `~/.agents`, `~/.gemini`, `~/.grok`).
- On Linux, if `systemctl --user` or `bk service install` can't reach the service manager, run `bk` with `DBUS_SESSION_BUS_ADDRESS` set and `XDG_RUNTIME_DIR` unset.
- Every `bk` step is safe to run again and picks up where it stopped. If a step fails with a read-only or permission error, asking for the folder it names (or its parent if it doesn't exist yet) and running the same step again usually works, so it's worth retrying before handing the install back to the user.

## 1. Check whether Beankeeper is already installed

Check for `bk` on `PATH` and in the default per-user location:
- macOS / Linux: `"$HOME/.local/bin/bk"`
- Windows: `"$env:LOCALAPPDATA\Programs\Beankeeper Desktop\bk.exe"`

If `bk` exists and supports both `bk service install --help` and `bk agents connect --help`, check `bk service status --json`:
- If `installed` is `false`, run `bk service install --no-agents`.
- If `installed` is `true` and `running` is `false`, run `bk service start`.
- Run `bk agents connect --all --json` and `bk agents doctor --json`, then jump to step 5.

## 2. Check your environment and OS support

Detect the operating system and CPU architecture (`uname -s` and `uname -m` on macOS/Linux; `$env:OS` and `$env:PROCESSOR_ARCHITECTURE` on Windows):
- Supported: macOS (`arm64` / `x86_64`), Linux (`x86_64` / `aarch64`, glibc 2.35+), and Windows x64 (`AMD64`).
- Not yet supported: Windows ARM64. If the user is on Windows ARM64, tell them plainly and stop.
- Note for Linux: `bk service install` needs the user's logged-in desktop session with an unlocked D-Bus Secret Service (such as GNOME Keyring or KWallet). If it reports a locked keychain, tell the user in one plain sentence to sign out and back in, then retry. Do not ask them to configure a keyring.

Without a shell, the person-facing steps at https://beankeeper.app/get.md apply instead.

## 3. Ensure verification tools are ready

Steps 3 and 4 are for the agent to run. The user doesn't need to run these commands or install `jq`, `cosign`, or anything else.

Every Beankeeper release is verified with a SHA-256 checksum and a keyless Sigstore (`cosign`) signature bound to the `Govcraft/beankeeper-desktop` release workflow.

### macOS and Linux
Check for `curl`, `tar`, `shasum` or `sha256sum`, `jq`, and `cosign`:
1. If `jq` or `cosign` is missing, install it yourself with the user's package manager (for example `brew install jq cosign` on macOS, or `apt` / `dnf` / `pacman` on Linux). Tell the user in one plain sentence what you are installing and why.
2. If `jq` still cannot be installed, read the latest signed release version from `https://beankeeper.app/download/latest/version.txt` (a single line such as `X.Y.Z`) and pass `BK_VERSION=<VERSION>` to `install.sh`.
3. If `cosign` cannot be installed, do not silently skip signature verification. Verify with `gh attestation verify` if `gh` is available. Otherwise, ask the user in plain words whether you may continue with a checksum-only check (`BK_REQUIRE_SIGNATURES=0`), or offer the Claude extension from the first section instead.

### Windows (x64, PowerShell 5.1+)
1. Check for `cosign`. If missing, offer to install it (`winget install --id Sigstore.Cosign -e`).
2. If `cosign` cannot be installed, ask the user before falling back to SHA-256-only verification (omitting `-RequireSignatures`).

## 4. Download, verify, and install

The installer script you download from this site still retrieves the signed archive itself and verifies its Sigstore signature and checksums. Until a Beankeeper Desktop change lands, that retrieval may use GitHub; do not send the user there.

### macOS and Linux
Run as the logged-in desktop user (do not use `sudo`):

```sh
(
    set -eu
    bk_bin="$HOME/.local/bin"
    bk_download="$(mktemp -d)"
    trap 'rm -rf "$bk_download"' EXIT
    mkdir -p "$bk_bin"
    curl -fsSL https://beankeeper.app/download/latest/install.sh -o "$bk_download/install.sh"
    BK_REQUIRE_SIGNATURES=1 BK_REQUIRE_AGENT_SETUP=1 BK_INSTALL="$bk_bin" BK_NO_SERVICE=1 \
        sh "$bk_download/install.sh"
    "$bk_bin/bk" service install --no-agents
    "$bk_bin/bk" agents connect --all --json
    "$bk_bin/bk" service status --json
)
```

### Windows (PowerShell 5.1+)
Run as the logged-in desktop user:

```powershell
& {
    $ErrorActionPreference = 'Stop'
    $bkDir = Join-Path $env:LOCALAPPDATA 'Programs\Beankeeper Desktop'
    $bkSetup = Join-Path ([IO.Path]::GetTempPath()) ("bk-install-" + [guid]::NewGuid() + ".ps1")
    try {
        Invoke-WebRequest -UseBasicParsing -Uri 'https://beankeeper.app/download/latest/install.ps1' -OutFile $bkSetup
        & $bkSetup -RequireSignatures -RequireAgentSetup -NoService -InstallDir $bkDir
        $bk = Join-Path $bkDir 'bk.exe'
        & $bk service install --no-agents
        if ($LASTEXITCODE -ne 0) { throw 'Beankeeper service installation failed' }
        & $bk agents connect --all --json
        if ($LASTEXITCODE -ne 0) { throw 'Beankeeper agent registration failed' }
        & $bk service status --json
        if ($LASTEXITCODE -ne 0) { throw 'Could not read Beankeeper service status' }
    } finally {
        Remove-Item -LiteralPath $bkSetup -Force -ErrorAction SilentlyContinue
    }
}
```

If verification fails, stop immediately before running any downloaded binary and report the exact failure to the user.

## 5. Verify connections and hand off to chat

1. Run `bk agents doctor --json` (using the full installed binary path if it is not yet on `PATH`).
2. Check that the background service is running and read the `books` path from `bk service status --json`.
3. The recovery kit, passphrase, and agent tokens are secrets; keep them out of the conversation.
4. Reply to the user in plain, calm language:
   - Confirm which version of Beankeeper was installed and which AI apps were connected (for example the Claude app, the ChatGPT desktop app in Work or Codex, Claude Code, Cursor, Gemini CLI, VS Code, GrokBot, or Grok Build). When talking to the owner, call Claude Desktop "the Claude app," and if you mention Claude Code, say that Claude Code, Anthropic's coding tool, is a different app from the Claude app.
   - Give the exact path to their encrypted books file and to the private recovery kit saved next to the books (usually in the beankeeper-desktop folder). Ask them to keep an offline copy of both the books and the kit. You may help them find, print, or copy those files; never read or speak the kit's contents, the passphrase, or any token.
   - Setup starts a free 30-day trial on this computer automatically. There is no email or credit card, and the owner never handles a token or opens a terminal. Confirm it with `service_status`, which shows the trial and the days remaining, and mention the days left once, without nagging. If the trial did not start because the network was unavailable, retry with `license_start_trial`. One trial per computer, and the trial has no refund because it is free.
   - After the trial, recording in their books needs a Beankeeper license ($79 one time, one computer, every 1.x update, 60-day return through their AI). When the trial ends, or if Beankeeper reports that these books need a license, tell them plainly that their books stay readable, exportable, and backed up, and that they can buy a license at https://beankeeper.app/#pricing and then ask you to activate it with the license file they download.
   - Tell them, in plain words, that their books live in a locked file on this computer, and that they choose which AI sees them. Do not say the books never leave the computer. Mention that they can keep talking to the same books from the Claude, ChatGPT or GrokBot mobile app while this computer stays on with the matching desktop app open or GrokBot connected, and that Beankeeper itself has no phone app.
   - Ask them to quit the Claude app, or their other AI app, and open it again if that app asks, so the Beankeeper tools appear, then say **"Set up my books"**. To try practice books first, say **"Create demo books"**, and suggest they keep their spreadsheet until they're comfortable. After setup, the everyday loop is **"Check my accounts for anything new."** If their AI can reach their bank with tools it already has, it can bring in what's new that way, or the owner can share a statement file. Bank feeds through Plaid are a beta for select paid license holders; offer them only if Beankeeper shows a bank feed is available, and otherwise say the owner can ask support@beankeeper.app to take part. Don't promise that a specific bank will work.
