@startvibecoding/vibe-browser 0.1.0-pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # vibe-browser
2
+
3
+ Fast browser automation CLI and Go SDK for AI agents.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @startvibecoding/vibe-browser
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ # Open a page
15
+ vibe-browser open https://example.com
16
+
17
+ # Take a snapshot (see interactive elements)
18
+ vibe-browser snapshot -i
19
+
20
+ # Click an element
21
+ vibe-browser click "button"
22
+
23
+ # Take a screenshot
24
+ vibe-browser screenshot -o page.png
25
+ ```
26
+
27
+ ## Features
28
+
29
+ - CLI mode for direct terminal use
30
+ - SDK mode for Go programmatic access
31
+ - MCP server for AI agents (Claude, Cursor, etc.)
32
+ - Daemon mode for long-running sessions
33
+ - Chrome DevTools Protocol support
34
+ - Accessibility snapshots with element refs
35
+
36
+ ## Links
37
+
38
+ - [GitHub](https://github.com/startvibecoding/vibe-browser)
39
+ - [Documentation](https://github.com/startvibecoding/vibe-browser#readme)
40
+
41
+ ## License
42
+
43
+ Apache-2.0
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Wrapper script that resolves and executes the platform-specific binary.
4
+ // When installed via `npm i -g @startvibecoding/vibe-browser`, this script finds the
5
+ // correct binary from the platform-specific optional dependency package.
6
+
7
+ const { execFileSync } = require('child_process');
8
+ const path = require('path');
9
+ const fs = require('fs');
10
+
11
+ const SCOPE = '@startvibecoding';
12
+ const PKG_BASE = 'vibe-browser';
13
+
14
+ // Map npm os/cpu to package name
15
+ const PLATFORM_MAP = {
16
+ 'linux-x64-glibc': `${SCOPE}/${PKG_BASE}-linux-x64`,
17
+ 'linux-arm64-glibc': `${SCOPE}/${PKG_BASE}-linux-arm64`,
18
+ 'linux-x64-musl': `${SCOPE}/${PKG_BASE}-linux-musl-x64`,
19
+ 'linux-arm64-musl': `${SCOPE}/${PKG_BASE}-linux-musl-arm64`,
20
+ 'darwin-x64': `${SCOPE}/${PKG_BASE}-darwin-x64`,
21
+ 'darwin-arm64': `${SCOPE}/${PKG_BASE}-darwin-arm64`,
22
+ 'win32-x64': `${SCOPE}/${PKG_BASE}-win32-x64`,
23
+ 'win32-arm64': `${SCOPE}/${PKG_BASE}-win32-arm64`,
24
+ };
25
+
26
+ function detectPlatform() {
27
+ const os = process.platform;
28
+ const arch = process.arch;
29
+
30
+ if (os === 'linux') {
31
+ const isMusl = (() => {
32
+ try {
33
+ if (fs.existsSync('/etc/alpine-release')) return true;
34
+ const { execSync } = require('child_process');
35
+ const output = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
36
+ return output.includes('musl');
37
+ } catch {
38
+ return false;
39
+ }
40
+ })();
41
+ return `${os}-${arch}-${isMusl ? 'musl' : 'glibc'}`;
42
+ }
43
+
44
+ return `${os}-${arch}`;
45
+ }
46
+
47
+ function findBinary() {
48
+ const platform = detectPlatform();
49
+ const packageName = PLATFORM_MAP[platform];
50
+
51
+ if (!packageName) {
52
+ console.error(`Unsupported platform: ${platform}`);
53
+ console.error(`Supported platforms: ${Object.keys(PLATFORM_MAP).join(', ')}`);
54
+ process.exit(1);
55
+ }
56
+
57
+ const searchDirs = [];
58
+ const addSearchDir = (dir) => {
59
+ if (dir && !searchDirs.includes(dir)) {
60
+ searchDirs.push(dir);
61
+ }
62
+ };
63
+
64
+ try {
65
+ addSearchDir(path.dirname(require.resolve(`${packageName}/package.json`)));
66
+ } catch {}
67
+
68
+ // Scoped packages may be in node_modules/@scope/pkg-name
69
+ const pkgShortName = packageName.replace(`${SCOPE}/`, '');
70
+ addSearchDir(path.join(__dirname, '..', 'node_modules', SCOPE, pkgShortName));
71
+ addSearchDir(path.join(__dirname, '..', '..', pkgShortName));
72
+ addSearchDir(path.join(__dirname, '..', '..', SCOPE, pkgShortName));
73
+
74
+ for (const pkgDir of searchDirs) {
75
+ const binName = process.platform === 'win32' ? 'vibe-browser.exe' : 'vibe-browser';
76
+ const binPath = path.join(pkgDir, 'bin', binName);
77
+
78
+ if (fs.existsSync(binPath)) {
79
+ return binPath;
80
+ }
81
+ }
82
+
83
+ // Fallback: check if there's a binary directly in the main package's bin/
84
+ const fallbackBinName = (() => {
85
+ const suffix = process.platform === 'win32' ? '.exe' : '';
86
+ const osMap = { linux: 'linux', darwin: 'darwin', win32: 'windows' };
87
+ const archMap = { x64: 'amd64', arm64: 'arm64' };
88
+ return `vibe-browser-${osMap[process.platform]}-${archMap[process.arch]}${suffix}`;
89
+ })();
90
+
91
+ const fallbackPath = path.join(__dirname, fallbackBinName);
92
+ if (fs.existsSync(fallbackPath)) {
93
+ return fallbackPath;
94
+ }
95
+
96
+ console.error(`Could not find vibe-browser binary for platform: ${detectPlatform()}`);
97
+ console.error(`Searched for package: ${packageName}`);
98
+ console.error(`Searched in: ${searchDirs.join(', ')}`);
99
+ console.error('');
100
+ console.error('If you installed globally, try reinstalling:');
101
+ console.error(' npm install -g @startvibecoding/vibe-browser');
102
+ console.error('');
103
+ console.error('If the problem persists, install via Go:');
104
+ console.error(' go install github.com/startvibecoding/vibe-browser/cmd/vibe-browser@latest');
105
+ process.exit(1);
106
+ }
107
+
108
+ const binaryPath = findBinary();
109
+ const args = process.argv.slice(2);
110
+
111
+ try {
112
+ execFileSync(binaryPath, args, { stdio: 'inherit' });
113
+ } catch (err) {
114
+ if (err.status !== undefined) {
115
+ process.exit(err.status);
116
+ }
117
+ process.exit(1);
118
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@startvibecoding/vibe-browser",
3
+ "version": "0.1.0-pre",
4
+ "description": "Fast browser automation CLI and Go SDK for AI agents",
5
+ "bin": {
6
+ "vibe-browser": "bin/vibe-browser"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node scripts/postinstall.js"
10
+ },
11
+ "files": [
12
+ "bin/",
13
+ "scripts/",
14
+ "README.md"
15
+ ],
16
+ "keywords": [
17
+ "browser",
18
+ "automation",
19
+ "ai",
20
+ "agent",
21
+ "cdp",
22
+ "chrome",
23
+ "cli",
24
+ "sdk",
25
+ "mcp"
26
+ ],
27
+ "author": "",
28
+ "license": "Apache-2.0",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/startvibecoding/vibe-browser.git",
32
+ "directory": "npm"
33
+ },
34
+ "engines": {
35
+ "node": ">=14"
36
+ },
37
+ "optionalDependencies": {
38
+ "@startvibecoding/vibe-browser-linux-x64": "0.1.0-pre",
39
+ "@startvibecoding/vibe-browser-linux-arm64": "0.1.0-pre",
40
+ "@startvibecoding/vibe-browser-linux-musl-x64": "0.1.0-pre",
41
+ "@startvibecoding/vibe-browser-linux-musl-arm64": "0.1.0-pre",
42
+ "@startvibecoding/vibe-browser-darwin-x64": "0.1.0-pre",
43
+ "@startvibecoding/vibe-browser-darwin-arm64": "0.1.0-pre",
44
+ "@startvibecoding/vibe-browser-win32-x64": "0.1.0-pre",
45
+ "@startvibecoding/vibe-browser-win32-arm64": "0.1.0-pre"
46
+ }
47
+ }
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Skip postinstall output in CI or when suppressed
4
+ if (process.env.CI || process.env.npm_config_yes || process.env.VIBE_BROWSER_SKIP_POSTINSTALL) {
5
+ process.exit(0);
6
+ }
7
+
8
+ const os = require('os');
9
+ const path = require('path');
10
+
11
+ const RESET = '\x1b[0m';
12
+ const BOLD = '\x1b[1m';
13
+ const DIM = '\x1b[2m';
14
+ const CYAN = '\x1b[36m';
15
+ const BRIGHT_CYAN = '\x1b[96m';
16
+ const WHITE = '\x1b[97m';
17
+
18
+ const logo = [
19
+ ' __ ',
20
+ ' _ _____ ___/ /___ _',
21
+ ' | | / / _ `/ __/ __ `/',
22
+ ' | |/ / /_/ / / / /_/ /',
23
+ ' |___/\\__,_/_/ \\__,_/ ',
24
+ ].join('\n');
25
+
26
+ function pkgVersion() {
27
+ try {
28
+ return require('../package.json').version;
29
+ } catch {
30
+ return '';
31
+ }
32
+ }
33
+
34
+ const ver = pkgVersion();
35
+ const verStr = ver ? ` ${DIM}v${ver}${RESET}` : '';
36
+
37
+ console.log();
38
+ console.log(`${BRIGHT_CYAN}${BOLD}${logo}${RESET}${verStr}`);
39
+ console.log();
40
+ console.log(` ${BOLD}${WHITE}Fast browser automation CLI for AI agents${RESET}`);
41
+ console.log();
42
+ console.log(` ${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
43
+ console.log();
44
+ console.log(` ${BOLD}Quick Start${RESET}`);
45
+ console.log();
46
+ console.log(` vibe-browser open https://example.com ${DIM}Open a page${RESET}`);
47
+ console.log(` vibe-browser snapshot -i ${DIM}See interactive elements${RESET}`);
48
+ console.log(` vibe-browser click "button" ${DIM}Click an element${RESET}`);
49
+ console.log(` vibe-browser screenshot -o page.png ${DIM}Take screenshot${RESET}`);
50
+ console.log();
51
+ console.log(` ${BOLD}Docs${RESET} ${CYAN}https://github.com/startvibecoding/vibe-browser${RESET}`);
52
+ console.log();