Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

build: bootstrap both projects from a fresh clone with one command

Shahriarb564f63a38d9
diff --git a/README.md b/README.md
index eacaade..5bf5d51 100644
--- a/README.md
+++ b/README.md
@@ -42,22 +42,23 @@ connections. One daemon owns the browser link, so several MCP clients can share
## Quick start
```sh
-git clone https://github.com/your-org/browsentic.git
+git clone https://github.com/imshaikot/browsentic.git
cd browsentic
-yarn install
-yarn build
+node scripts/setup.mjs
```
+That installs and builds both halves — the extension and the daemon, which is a separate package
+with its own dependencies. It needs nothing on your `PATH` but Node; the pinned Yarn release comes
+from the repository. Once installed, `yarn setup` re-runs the same thing.
+
Load the extension: open `chrome://extensions`, enable **Developer mode**, choose **Load unpacked**
and select `dist/chrome-mv3`.
-Then install the daemon and pair your browser:
+Then put the daemon on your `PATH` and pair your browser:
```sh
-yarn mcp:install # the daemon is a separate package with its own dependencies
-yarn mcp:build
-yarn mcp:link # puts `browsentic-mcp` on your PATH
-browsentic-mcp pair # prints a single use code, valid for 10 minutes
+yarn mcp:link # writes to the global npm prefix, so it stays a separate step
+browsentic-mcp pair # prints a single use code, valid for 10 minutes
```
Open the Browsentic popup, paste the code and press **Connect**. The daemon issues a long lived
@@ -286,6 +287,7 @@ as data, never as instructions.
## Development
```sh
+yarn setup # install and build both projects from scratch
yarn dev # build, launch a throwaway Chrome profile, hot reload
yarn dev:firefox
yarn build # production build
diff --git a/package.json b/package.json
index 7466031..9428636 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
"type": "module",
"packageManager": "[email protected]",
"scripts": {
+ "setup": "node scripts/setup.mjs",
"dev": "wxt",
"dev:firefox": "wxt -b firefox",
"build": "wxt build",
diff --git a/scripts/setup.mjs b/scripts/setup.mjs
new file mode 100644
index 0000000..23a7aa0
--- /dev/null
+++ b/scripts/setup.mjs
@@ -0,0 +1,58 @@
+#!/usr/bin/env node
+import { spawnSync } from 'node:child_process';
+import { existsSync, readFileSync } from 'node:fs';
+import { dirname, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+
+// Run the release .yarnrc.yml pins rather than whatever is on PATH — same reasoning as
+// yarnPath itself, except a fresh clone has no node_modules yet, so `yarn run` is not
+// available to re-exec us. Invoking the vendored release through node needs nothing but node.
+function yarn() {
+ const rc = join(root, '.yarnrc.yml');
+ const pinned = existsSync(rc) && /^yarnPath:\s*(\S+)/m.exec(readFileSync(rc, 'utf8'))?.[1];
+ if (pinned && existsSync(join(root, pinned))) return [process.execPath, [join(root, pinned)]];
+ return ['yarn', []];
+}
+
+// mcp/ is a separate Yarn project (its own lockfile), so the root install does not cover it.
+const STEPS = [
+ ['extension dependencies', ['install']],
+ ['extension build', ['build']],
+ ['daemon dependencies', ['--cwd', 'mcp', 'install']],
+ ['daemon build', ['--cwd', 'mcp', 'build']],
+];
+
+const [bin, prefix] = yarn();
+if (bin !== process.execPath) {
+ console.warn('! no vendored Yarn release found — falling back to `yarn` on PATH');
+}
+
+STEPS.forEach(([label, args], i) => {
+ console.log(`\n\x1b[1m▸ ${i + 1}/${STEPS.length} ${label}\x1b[0m`);
+ const r = spawnSync(bin, [...prefix, ...args], { cwd: root, stdio: 'inherit' });
+ if (r.error) {
+ // Nothing was launched at all — no status to report. Almost always a missing `yarn`
+ // on PATH after the vendored release failed to resolve.
+ console.error(`\n\x1b[31m✗ could not run \`${bin}\`: ${r.error.message}\x1b[0m`);
+ console.error(` Expected the pinned release at .yarn/releases/ — run this from inside the repo.\n`);
+ process.exit(1);
+ }
+ if (r.status !== 0) {
+ // status is null when a signal killed it, so report whichever one actually happened.
+ const how = r.signal ? `killed by ${r.signal}` : `exited ${r.status}`;
+ console.error(`\n\x1b[31m✗ ${label} failed — \`yarn ${args.join(' ')}\` ${how}\x1b[0m\n`);
+ process.exit(r.status || 1);
+ }
+});
+
+console.log(`
+\x1b[32m✓ Extension built\x1b[0m dist/chrome-mv3 — load it unpacked at chrome://extensions, Developer mode on
+\x1b[32m✓ Daemon built\x1b[0m mcp/dist
+
+Two steps are left. Both reach outside this directory, so they stay separate:
+
+ yarn mcp:link puts \`browsentic-mcp\` on your PATH (writes to the global npm prefix)
+ browsentic-mcp pair prints a single use code, valid for 10 minutes
+`);