docs/setup.md

Setup

Pick one way to install. Each ends with Shrok running and waiting for your phone. Then follow pairing.md.

Homebrew

On a Mac:

sh
1brew tap bjoernaagaard/shrok
2brew trust bjoernaagaard/shrok # Homebrew asks you to trust a tap before it loads its formulas
3brew install shrok
4mkdir -p ~/Library/Application\ Support/Shrok
5(umask 077; echo 'ANTHROPIC_API_KEY=sk-ant-...' >> ~/Library/Application\ Support/Shrok/secrets.env)
6brew services start shrok
7shrok pair

The key goes into secrets.env in Shrok's data folder, which only your user can read. Shrok refuses the file if anyone else can. To use OpenAI instead, set OPENAI_API_KEY.

Shrok logs to $(brew --prefix)/var/log/shrok.log and keeps its data in ~/Library/Application Support/Shrok.

Debian and Ubuntu

Download shrok_<version>_amd64.deb or shrok_<version>_arm64.deb from the releases page, then install it:

sh
1sudo apt install ./shrok_*_$(dpkg --print-architecture).deb

Store the key as an encrypted systemd credential, set the time zone and locale, and start Shrok:

sh
1echo -n 'sk-ant-...' | sudo systemd-creds encrypt --name=ANTHROPIC_API_KEY - /etc/credstore.encrypted/ANTHROPIC_API_KEY
2printf 'SHROK_TIME_ZONE=Europe/Copenhagen\nSHROK_LOCALE=en-GB\n' | sudo tee /etc/shrok/env
3sudo systemctl enable --now shrok
4sudo -u shrok shrok pair

Shrok runs as the user shrok, keeps its data in /var/lib/shrok, and logs to the journal: journalctl -u shrok. The package loads an AppArmor profile selected only by Shrok's systemd service. On Ubuntu 24.04 and later, it lets the service and its children make the user namespaces their sandboxes need. It does not attach to the system bubblewrap executable or grant namespaces to other users.

Docker

Create a fresh private deployment folder with PRIVATE_DIRECTORY_MODE=0700; mkdir -m "$PRIVATE_DIRECTORY_MODE" shrok-deploy. Copy compose.yaml, seccomp.json and the apparmor folder from packaging/oci into it. Run these commands inside that folder:

sh
1PRIVATE_DIRECTORY_MODE=0700
2PRIVATE_SECRET_MODE=0400
3SHROK_UID=10001
4SHROK_GID=10001
5mkdir -m "$PRIVATE_DIRECTORY_MODE" secrets
6printf %s 'sk-ant-...' | sudo install -o "$SHROK_UID" -g "$SHROK_GID" -m "$PRIVATE_SECRET_MODE" /dev/stdin secrets/ANTHROPIC_API_KEY
7printf 'SHROK_TIME_ZONE=Europe/Copenhagen\nSHROK_LOCALE=en-GB\n' >.env
8sudo apparmor_parser -r -W apparmor/shrok-container # only on hosts with AppArmor, such as Ubuntu
9docker compose up -d
10docker compose exec shrok shrok pair

The secret file is owned by the image's user, UID 10001, and is readable only by that user. The private host directories prevent other host users from reaching it. Compose binds this file without changing its host ownership or permissions.

On Docker Desktop or OrbStack, which have no AppArmor, delete the apparmor=shrok-container line from compose.yaml.

Shrok's sandbox and browser need user namespaces. Docker's default seccomp profile blocks them, so the image runs with seccomp.json. That profile is Docker's own with five more system calls allowed: clone, unshare, mount, umount2 and pivot_root. It also needs systempaths=unconfined so the sandbox can mount its own /proc. It never needs --privileged. The image has no time zone of its own, so set SHROK_TIME_ZONE.

The image has no Google or X programs. To use them, build an image on top of it that installs gws or xurl.

Portable archive

Download shrok-<version>-<os>-<arch>.tar.gz from the releases page. It holds Shrok, Node, Obscura, SimpleX's library and a headless browser.

sh
1sudo tar --no-same-owner --no-same-permissions -xzf shrok-*-linux-*.tar.gz -C /opt
2sudo mv /opt/shrok-*-linux-* /opt/shrok
3sudo chown -R root:root /opt/shrok
4sudo apt install bubblewrap socat ripgrep # or your system's packages
5sudo apparmor_parser -r /opt/shrok/share/apparmor/* # Ubuntu 24.04 and later
6ANTHROPIC_API_KEY=sk-ant-... SHROK_DATA_DIR=~/shrok /opt/shrok/bin/shrok run

On Ubuntu 24.04 and later, use the bundled systemd unit to select the service's AppArmor profile. For a foreground run on those hosts, install apparmor-utils and replace the final command above with ANTHROPIC_API_KEY=sk-ant-... SHROK_DATA_DIR=~/shrok aa-exec -p shrok-bwrap -- /opt/shrok/bin/shrok run. This explicitly selects the profile for that invocation without changing other users' bubblewrap policy.

On Linux, the browser needs the system libraries the .deb lists, which most desktop systems have. A systemd unit for /opt/shrok is in share/systemd/shrok.service. It runs Shrok as the user shrok, so create that user first.

On a Mac, unpack the archive in a folder you own and start it from there:

sh
1tar -xzf shrok-*-macos-*.tar.gz
2ANTHROPIC_API_KEY=sk-ant-... ./shrok-*-macos-*/bin/shrok run

Leave it running and use its full path to pair in another terminal, as shown in pairing.md. If you set SHROK_DATA_DIR, set it to the same path in both terminals. The first start after unpacking takes longer, while macOS checks the new programs.

CI verification credentials

Before enabling the verify workflow, create a GitHub environment named verification in the repository's Settings. Require a trusted reviewer, prevent self-review and disable administrator bypass. Put ANTHROPIC_API_KEY only in that environment, not in repository or organization secrets available to branch workflows. Review the exact source commit before approving a run. Both verification jobs require this environment. Model keys are passed only to their browser security steps on manual runs of main. Pushes to verification branches run without model keys.