Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/feat-browser-standalone-executable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"turno-browser": patch
---

turno-browser now also comes as a standalone executable for machines without Node or npm: one file per platform (macOS on Apple silicon and Intel, Linux x64, and an experimental Windows x64) on each GitHub release, with `SHA256SUMS` and build provenance attestations. The executable is both programs: `turno-browser <command>`, and `turno-browser mcp` for the MCP server. In it, `turno-browser setup` and `init` give the agent the executable itself (`<path>/turno-browser mcp --identity <id>`), and `status` and `doctor` recognize that entry in an agent's config. See [Install without Node](https://turno.wimo.dev/docs/browser/get-started#install-without-node).
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ name: release
# with Harden-Runner blocking every host outside its allow list (as in tag).
# Trusted publishing stages each version; a maintainer approves it on npmjs.com.
# tag creates the git tags and GitHub releases of what was published.
# standalone after a turno-browser release, the standalone executables (standalone.yml),
# built from the tarball that was published and uploaded to its GitHub release. It
# runs after npm has the version, so a failure here never holds back the npm release.
on:
push:
branches: [main]
Expand Down Expand Up @@ -173,6 +176,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write # create tags and releases
outputs:
browser-version: ${{ steps.tag.outputs.browser-version }}
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
Expand All @@ -186,6 +191,7 @@ jobs:
name: release
path: release
- name: Tag and release what was published
id: tag
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
Expand All @@ -201,4 +207,20 @@ jobs:
gh api "repos/$REPO/git/refs" -f "ref=refs/tags/$name@$version" -f "sha=$SHA"
gh release create "$name@$version" --repo "$REPO" --verify-tag "${flags[@]}" \
--title "$name $version" --notes-file "${name}-${version}.notes.md" "${name}-${version}.cdx.json"
if [ "$name" = turno-browser ]; then echo "browser-version=$version" >> "$GITHUB_OUTPUT"; fi
done

standalone:
name: standalone executables
needs: tag
if: needs.tag.outputs.browser-version != ''
permissions:
contents: write # upload the archives to the turno-browser release
id-token: write # sign their attestations
attestations: write # store their attestations
# A local reusable workflow already comes from the commit of this run; the newer "$/" form
# means the same and is not yet understood by every workflow linter.
uses: ./.github/workflows/standalone.yml # zizmor: ignore[self-repository]
with:
version: ${{ needs.tag.outputs.browser-version }}
release-artifact: release
203 changes: 203 additions & 0 deletions .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
name: standalone

# The standalone turno-browser executables: one file per platform for machines without Node or
# npm (scripts/standalone-build.mjs). Three jobs, so the one that can write never runs project code:
# build on macOS (the macOS executables are signed ad hoc there), every target from the
# same packed package and the pinned Node.js; uploads the archives and SHA256SUMS
# as an artifact. No id-token, no secrets.
# smoke on each platform: the executable answers --version and an MCP initialize
# (scripts/standalone-smoke.mjs). Windows is experimental and may fail.
# release attests the archives and uploads them with SHA256SUMS to the GitHub release
# turno-browser@<version>. Skipped in a dry run, which keeps them in the run's artifact.
# Signing: the macOS executables are signed ad hoc and the Windows one is not signed, so
# Gatekeeper and SmartScreen warn on a browser download (the docs say what to do). Developer ID
# signing and notarization, or Authenticode, would sign each executable in the build job before
# it is zipped, with the certificates as secrets; there are none yet.
# Callers: release.yml after it publishes turno-browser (with the tarball it published); a
# maintainer, for a version already on npm (workflow_dispatch); a pull request that changes the
# build, as a dry run from the checkout.
on:
workflow_call:
inputs:
version:
description: turno-browser version
required: true
type: string
release-artifact:
description: artifact of the calling run with the packed tarballs (built from them, not from npm)
required: false
type: string
default: ""
workflow_dispatch:
inputs:
version:
description: turno-browser version on npm with a GitHub release (turno-browser@<version>)
required: true
type: string
dry-run:
description: keep the archives in this run's artifacts instead of uploading them to the release
required: false
type: boolean
default: true
pull_request:
paths:
- .github/workflows/standalone.yml
- scripts/standalone-*
- scripts/local-registry.mjs

permissions: {}

concurrency:
group: standalone-${{ github.event_name }}-${{ github.ref }}-${{ inputs.version }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
name: build
runs-on: macos-15
timeout-minutes: 30
permissions:
contents: read # check out the code
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- id: pin
name: Pinned Node.js release (a SEA blob only loads in the release that wrote it)
run: echo "node=$(jq -r .version scripts/standalone-node.json)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ steps.pin.outputs.node }}
- id: version
name: Version
env:
VERSION: ${{ inputs.version }}
run: |
if [ -z "$VERSION" ]; then VERSION=$(jq -r .version packages/browser/package.json); fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
# A pull request: the packages of this checkout, packed as a release packs them.
- if: github.event_name == 'pull_request'
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- if: github.event_name == 'pull_request'
name: Pack turno-core and turno-browser from the checkout
run: |
pnpm install --frozen-lockfile
mkdir -p "$RUNNER_TEMP/tarballs"
for dir in core browser; do (cd "packages/$dir" && pnpm pack --pack-destination "$RUNNER_TEMP/tarballs"); done
# The release: the tarballs it published.
- if: inputs.release-artifact != ''
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: ${{ inputs.release-artifact }}
path: ${{ runner.temp }}/tarballs
- name: Build the executables
env:
FROM: ${{ (github.event_name == 'pull_request' || inputs.release-artifact != '') && format('{0}/tarballs', runner.temp) || inputs.version }}
run: node scripts/standalone-build.mjs --from "$FROM" --out standalone
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: standalone
path: standalone/
if-no-files-found: error
retention-days: 7

smoke:
name: smoke (${{ matrix.target }})
needs: build
strategy:
fail-fast: false
matrix:
include:
- { target: darwin-arm64, os: macos-15 }
- { target: darwin-x64, os: macos-15-intel }
- { target: linux-x64, os: ubuntu-latest }
# Experimental until turno-browser supports Windows.
- { target: win-x64, os: windows-latest, experimental: true }
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental == true }}
timeout-minutes: 15
permissions:
contents: read # check out the smoke script
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
if: runner.os == 'Linux'
with:
egress-policy: block
allowed-endpoints: >
github.com:443
api.github.com:443
objects.githubusercontent.com:443
release-assets.githubusercontent.com:443
nodejs.org:443
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: scripts/standalone-smoke.mjs
sparse-checkout-cone-mode: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: standalone
path: standalone
- name: Check the archive against SHA256SUMS and unpack it
shell: bash
env:
TARGET: ${{ matrix.target }}
run: |
cd standalone
grep " turno-browser-$TARGET.zip\$" SHA256SUMS > one.sum
if command -v sha256sum >/dev/null; then sha256sum -c one.sum; else shasum -a 256 -c one.sum; fi
mkdir unpacked
if [ "$RUNNER_OS" = Windows ]; then 7z x -bd -ounpacked "turno-browser-$TARGET.zip"; else unzip -q -d unpacked "turno-browser-$TARGET.zip"; fi
ls -l unpacked
- name: --version and an MCP initialize
shell: bash
env:
VERSION: ${{ needs.build.outputs.version }}
run: |
exe=standalone/unpacked/turno-browser
if [ "$RUNNER_OS" = Windows ]; then exe="$exe.exe"; fi
node scripts/standalone-smoke.mjs "$exe" "$VERSION"

release:
name: upload to the release
needs: [build, smoke]
if: github.event_name != 'pull_request' && !inputs.dry-run
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write # upload the archives to the release
id-token: write # sign the attestations
attestations: write # store the attestations
steps:
# Block mode: the release upload (api.github.com, uploads.github.com) and the attestation
# signing (token.actions.githubusercontent.com and Sigstore), as in release.yml's publish job.
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
uploads.github.com:443
token.actions.githubusercontent.com:443
fulcio.sigstore.dev:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: standalone
path: standalone
- uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
with:
subject-path: standalone/*.zip
- name: Upload to turno-browser@${{ needs.build.outputs.version }}
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
VERSION: ${{ needs.build.outputs.version }}
working-directory: standalone
run: gh release upload "turno-browser@$VERSION" turno-browser-*.zip SHA256SUMS --repo "$REPO" --clobber
68 changes: 67 additions & 1 deletion apps/docs/content/docs/browser/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Get started"
description: "Install turno-browser and let turno-browser init set it up: an identity, a sign-in by hand and your agent."
---

turno-browser works on its own: you do not need turno to use it. It needs Node 22.11 or newer and a Chromium-based browser on the machine: Google Chrome, or Microsoft Edge, Brave or Chromium ([Choosing the browser](/docs/browser/identities#choosing-the-browser)). It downloads no browser unless you ask: on a machine with none, and no admin password to install one, `turno-browser install-browser` puts Chrome for Testing in your user cache.
turno-browser works on its own: you do not need turno to use it. It needs Node 22.11 or newer (or the [standalone executable](#install-without-node), which needs no Node) and a Chromium-based browser on the machine: Google Chrome, or Microsoft Edge, Brave or Chromium ([Choosing the browser](/docs/browser/identities#choosing-the-browser)). It downloads no browser unless you ask: on a machine with none, and no admin password to install one, `turno-browser install-browser` puts Chrome for Testing in your user cache.

## Install

Expand All @@ -13,6 +13,72 @@ npm install --global turno-browser

This installs two commands: `turno-browser`, which manages identities, and `turno-browser-mcp`, the MCP server an agent runs for one identity.

## Install without Node

On a machine without Node or npm, use the standalone executable: one file that holds turno-browser and the Node.js runtime it needs. It still drives the Chrome, Edge or Brave installed on the machine, or the Chrome for Testing that `turno-browser install-browser` puts in your user cache. The GitHub release of each turno-browser version, tagged `turno-browser@<version>` on the [releases page](https://github.com/wimo-dev/turno/releases), has one archive per platform and a `SHA256SUMS` file:

| Platform | Archive |
|---|---|
| macOS, Apple silicon | `turno-browser-darwin-arm64.zip` |
| macOS, Intel | `turno-browser-darwin-x64.zip` |
| Linux, x64 | `turno-browser-linux-x64.zip` |
| Windows, x64 (experimental) | `turno-browser-win-x64.zip` |

Windows is experimental: turno-browser does not support Windows yet, so that executable is published for testing and may not work.

Each archive holds the executable (`turno-browser`, or `turno-browser.exe`) and its license files. The one executable is both programs: `turno-browser <command>` is the CLI, and `turno-browser mcp` is the MCP server that `turno-browser-mcp` is in the npm package.

```sh
version=0.9.0 # the version you want
platform=darwin-arm64
base="https://github.com/wimo-dev/turno/releases/download/turno-browser%40$version"
curl -fLO "$base/turno-browser-$platform.zip"
curl -fLO "$base/SHA256SUMS"
```

### Check the download

Compare the archive with `SHA256SUMS`:

```sh
shasum -a 256 -c SHA256SUMS --ignore-missing # macOS
sha256sum -c SHA256SUMS --ignore-missing # Linux
```

On Windows, `Get-FileHash .\turno-browser-win-x64.zip -Algorithm SHA256` in PowerShell prints the hash to compare with the line in `SHA256SUMS`.

Each archive also has a build provenance attestation: a signed record that the release workflow of this repository built it. With the [GitHub CLI](https://cli.github.com):

```sh
gh attestation verify turno-browser-darwin-arm64.zip --repo wimo-dev/turno
```

### Put it in place

Unzip the archive and move the executable to a folder you keep, for example `~/.local/bin` (add that folder to your `PATH` to type just `turno-browser`):

```sh
unzip turno-browser-darwin-arm64.zip turno-browser
mkdir -p ~/.local/bin && mv turno-browser ~/.local/bin/
~/.local/bin/turno-browser --version
```

`turno-browser setup` and `init` give the agent this executable by its full path (`<path>/turno-browser mcp --identity <id>`), so after moving it, run `setup` again. To update, replace the file with the one from a newer release; the identities stay.

**macOS.** The executable is not signed with an Apple Developer ID yet, so Gatekeeper refuses to open a copy that a browser downloaded. A file fetched with `curl`, as above, is not marked and runs as it is. For a browser download, remove the mark in Terminal:

```sh
xattr -d com.apple.quarantine ~/.local/bin/turno-browser
```

or, after the first refusal, open System Settings, Privacy & Security, and click Open Anyway next to the message about `turno-browser` (on macOS 14 and older, Control-click the file in Finder and choose Open).

**Windows.** The executable is not Authenticode-signed yet, so SmartScreen may warn that it is unrecognized: choose More info, then Run anyway. In PowerShell, `Unblock-File .\turno-browser.exe` removes the downloaded-from-the-internet mark before the first run.

### Where it keeps its data

The same places as the npm package, so the standalone executable and an npm install share the identities: profiles and settings under `~/.local/share/turno/browser/` (or `$XDG_DATA_HOME/turno/browser/`), and Chrome for Testing, when you install it, in the Playwright cache (`~/Library/Caches/ms-playwright` on macOS, `~/.cache/ms-playwright` on Linux, or `PLAYWRIGHT_BROWSERS_PATH`). The executable itself writes nothing next to itself.

## Set it up

```sh
Expand Down
6 changes: 6 additions & 0 deletions packages/browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ turno-browser init
identity to your agent. Each step is also a command of its own: `turno-browser add`, `login` and
`setup`.

No Node on the machine? Each [GitHub release](https://github.com/wimo-dev/turno/releases) of
turno-browser also has a standalone executable for macOS (Apple silicon and Intel) and Linux, with
`SHA256SUMS` and build provenance attestations; a Windows one is experimental.
[Install without Node](https://turno.wimo.dev/docs/browser/get-started#install-without-node) has
the steps.

The docs are at [turno.wimo.dev/docs/browser](https://turno.wimo.dev/docs/browser), starting with
[Get started](https://turno.wimo.dev/docs/browser/get-started).

Expand Down
6 changes: 4 additions & 2 deletions packages/browser/src/agent-mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ export function findEntry(agent: McpAgent, id: string, env: NodeJS.ProcessEnv):
}

/**
* True when the entry runs turno-browser-mcp (by name, or this package's bin/mcp.js) or turno.
* A server merely named `browser-<something>` (browser-use, say) is someone else's.
* True when the entry runs turno-browser-mcp (by name, or this package's bin/mcp.js), the
* standalone turno-browser executable with `mcp`, or turno. A server merely named
* `browser-<something>` (browser-use, say) is someone else's.
*/
export function isTurnoEntry(e: McpEntry): boolean {
const words = [e.command ?? "", ...(e.args ?? [])];
if (/^turno-browser(\.exe)?$/i.test(e.command?.split(/[\\/]/).pop() ?? "") && e.args?.[0] === "mcp") return true;
return words.some(
(w) =>
basename(w) === "turno-browser-mcp" || basename(w) === "turno" || /turno-browser[\\/].*bin[\\/]mcp\.js$/.test(w),
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/src/cli/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ export async function init(c: Ctx, args: string[], io: Io, run: RunCommand = run
let exit: number = Exit.ok;
if (agent === "none") say(`Skipped. ${b} setup <agent> --identity ${id} prints it later.`);
else {
const { command, onPath } = mcpCommand(io.env);
const cfg = setupConfig(agent, id, command);
const { command, args: lead, onPath } = mcpCommand(io.env);
const cfg = setupConfig(agent, id, command, lead);
if (!onPath) cfg.notes.push("turno-browser-mcp is not on the PATH here, so this names it by its full path.");
const info = agent === "json" ? undefined : AGENTS[agent];
const register = info?.add?.(cfg.server, command, cfg.args) ?? null;
Expand Down
Loading
Loading