Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(distribution): add npm avibe entrypoint
cyh1d65b728e3de
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex dc30a26c8..0f61e89b0 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -19,6 +19,23 @@ jobs:pip install pre-commitpre-commit run --all-files+ npm-wrapper:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v5++ - uses: actions/setup-node@v5+ with:+ node-version: "20"++ - name: Test npm entrypoint+ working-directory: npm/avibe+ run: npm test++ - name: Validate npm package contents+ working-directory: npm/avibe+ run: npm pack --dry-run+install-upgrade-regression:runs-on: ubuntu-lateststeps:diff --git a/.github/workflows/publish_npm.yml b/.github/workflows/publish_npm.ymlnew file mode 100644index 000000000..a0d0a518a--- /dev/null+++ b/.github/workflows/publish_npm.yml@@ -0,0 +1,41 @@+name: Publish npm package++on:+ workflow_dispatch:+ inputs:+ ref:+ description: "Git ref to publish from"+ required: true+ default: "master"+ type: string++permissions:+ contents: read+ id-token: write++jobs:+ publish:+ runs-on: ubuntu-latest+ environment: npm+ steps:+ - name: Checkout+ uses: actions/checkout@v5+ with:+ ref: ${{ inputs.ref }}++ - name: Setup Node.js+ uses: actions/setup-node@v5+ with:+ node-version: "22.14.0"+ registry-url: "https://registry.npmjs.org"++ - name: Install npm with trusted publishing support+ run: npm install -g npm@latest++ - name: Test npm entrypoint+ working-directory: npm/avibe+ run: npm test++ - name: Publish avibe+ working-directory: npm/avibe+ run: npm publish --access publicdiff --git a/docs/plans/distribution-growth.md b/docs/plans/distribution-growth.mdindex b353ac794..e5dd995c8 100644--- a/docs/plans/distribution-growth.md+++ b/docs/plans/distribution-growth.md@@ -17,12 +17,20 @@ Make Vibe Remote easier to understand, easier to install, and easier for AI codi- `docs/INSTALL_FOR_AI_ZH.md`- Linked the AI-agent installation guides from the docs section without interrupting the landing-page narrative.- Updated package metadata and installer banner copy so the project no longer presents as Slack-only.+- Added an npm entrypoint package under `npm/avibe`:+ - `npx avibe` and globally installed `avibe` bootstrap the existing Python `vibe-remote` package.+ - The npm package does not ship a second runtime; it installs or locates the real `vibe` command and delegates to it.+ - `avibe init` and `avibe start` map to the default `vibe` startup flow.+ - `avibe status`, `doctor`, `remote`, `upgrade`, `task`, `hook`, and other commands pass through to `vibe`.+ - CI now tests the wrapper and validates the packed npm contents.+ - A manual GitHub Actions workflow can publish `avibe` to npm with provenance after npm trusted publishing is configured.## Next High-Leverage Work-1. Add a tiny npm wrapper package named `vibe-remote` or `vibe-remote-cli` that delegates to the existing installer.- - Purpose: capture `npm install -g ...` muscle memory in the AI coding community.- - Constraint: do not ship a second runtime; keep Python / uv as the source of truth until a binary packaging decision is made.+1. Publish the `avibe` npm package, then switch public install copy to npm-first.+ - Preferred public command after publish: `npx avibe`.+ - Global install path: `npm install -g avibe && avibe`.+ - Keep the curl / PowerShell installers documented as fallback paths.2. Add Homebrew distribution.- Short path: maintain a tap first.diff --git a/npm/avibe/README.md b/npm/avibe/README.mdnew file mode 100644index 000000000..1f380193b--- /dev/null+++ b/npm/avibe/README.md@@ -0,0 +1,51 @@+# avibe++NPM entrypoint for [Vibe Remote](https://github.com/cyhhao/vibe-remote).++Vibe Remote is still installed and upgraded as the Python package `vibe-remote`.+This package is a thin bootstrapper for developers who expect npm-native entry+points.++## Quick Start++```bash+npx avibe+```++Or install the npm entrypoint globally:++```bash+npm install -g avibe+avibe+```++The first run installs the underlying `vibe` command if needed, then starts the+local Vibe Remote setup wizard.++## Commands++```bash+avibe install # install or refresh the underlying vibe-remote Python CLI+avibe init # start the setup wizard+avibe start # start Vibe Remote+avibe status # show runtime status+avibe doctor # diagnose local setup issues+avibe remote # configure remote Web UI access+avibe upgrade # upgrade the underlying vibe-remote Python package+```++After bootstrap, `avibe` delegates to the real `vibe` command.++## Requirements++- Node.js 16++- macOS / Linux: `curl` or `wget`+- Windows: PowerShell++The installer downloads `uv` automatically when it is missing. `uv` manages the+Python runtime for `vibe-remote`.++## Docs++- <https://docs.avibe.bot>+- <https://github.com/cyhhao/vibe-remote>diff --git a/npm/avibe/bin/avibe.js b/npm/avibe/bin/avibe.jsnew file mode 100755index 000000000..2448b5529--- /dev/null+++ b/npm/avibe/bin/avibe.js@@ -0,0 +1,273 @@+#!/usr/bin/env node+"use strict";++const childProcess = require("node:child_process");+const fs = require("node:fs");+const os = require("node:os");+const path = require("node:path");++const packageJson = require("../package.json");++const INSTALL_SH_URL =+ process.env.AVIBE_INSTALL_SH_URL ||+ "https://raw.githubusercontent.com/cyhhao/vibe-remote/master/install.sh";+const INSTALL_PS1_URL =+ process.env.AVIBE_INSTALL_PS1_URL ||+ "https://raw.githubusercontent.com/cyhhao/vibe-remote/master/install.ps1";++function printHelp() {+ console.log(`avibe ${packageJson.version}++NPM entrypoint for Vibe Remote.++Usage:+ npx avibe Install Vibe Remote if needed, then start the setup wizard+ avibe Same as above after npm install -g avibe+ avibe install Install or refresh the underlying vibe-remote Python CLI+ avibe init Start the setup wizard+ avibe start Start Vibe Remote+ avibe status Show runtime status+ avibe doctor Diagnose local setup issues+ avibe remote Configure remote Web UI access+ avibe upgrade Upgrade the underlying vibe-remote Python package++After bootstrap, avibe delegates to the real 'vibe' command.+Docs: https://docs.avibe.bot`);+}++function printVersion() {+ console.log(`avibe ${packageJson.version}`);+}++function prependPathEntries(env, entries) {+ const delimiter = path.delimiter;+ const currentPath = env.PATH || env.Path || "";+ const existing = new Set(currentPath.split(delimiter).filter(Boolean));+ const nextEntries = [];++ for (const entry of entries) {+ if (entry && !existing.has(entry)) {+ nextEntries.push(entry);+ }+ }++ return {+ ...env,+ PATH: [...nextEntries, currentPath].filter(Boolean).join(delimiter),+ };+}++function candidateBinDirs() {+ const home = os.homedir();+ const dirs = [];++ if (process.platform === "win32") {+ const profile = process.env.USERPROFILE || home;+ dirs.push(path.join(profile, ".local", "bin"));+ dirs.push(path.join(profile, ".cargo", "bin"));+ } else {+ dirs.push(path.join(home, ".local", "bin"));+ dirs.push(path.join(home, ".cargo", "bin"));+ }++ return dirs;+}++function executableNames(name) {+ if (process.platform === "win32") {+ return [`${name}.exe`, `${name}.cmd`, `${name}.bat`, name];+ }+ return [name];+}++function isExecutable(filePath) {+ try {+ const stat = fs.statSync(filePath);+ return stat.isFile();+ } catch {+ return false;+ }+}++function resolveFromPath(command, env = process.env) {+ const pathValue = env.PATH || env.Path || "";+ for (const dir of pathValue.split(path.delimiter)) {+ if (!dir) {+ continue;+ }+ for (const executableName of executableNames(command)) {+ const candidate = path.join(dir, executableName);+ if (isExecutable(candidate)) {+ return candidate;+ }+ }+ }+ return null;+}++function findVibeBinary() {+ if (process.env.AVIBE_VIBE_BIN) {+ return process.env.AVIBE_VIBE_BIN;+ }++ const envWithCommonBins = prependPathEntries(process.env, candidateBinDirs());+ const fromPath = resolveFromPath("vibe", envWithCommonBins);+ if (fromPath) {+ return fromPath;+ }++ for (const dir of candidateBinDirs()) {+ for (const executableName of executableNames("vibe")) {+ const candidate = path.join(dir, executableName);+ if (isExecutable(candidate)) {+ return candidate;+ }+ }+ }++ return null;+}++function runCommand(command, args, options = {}) {+ const result = childProcess.spawnSync(command, args, {+ stdio: "inherit",+ shell: options.shell || false,+ env: options.env || prependPathEntries(process.env, candidateBinDirs()),+ });++ if (result.error) {+ throw result.error;+ }++ if (typeof result.status === "number") {+ return result.status;+ }++ return result.signal ? 1 : 0;+}++function hasCommand(command) {+ return Boolean(resolveFromPath(command, prependPathEntries(process.env, candidateBinDirs())));+}++function installWithCustomCommand() {+ if (!process.env.AVIBE_INSTALL_COMMAND) {+ return false;+ }++ const status = runCommand(process.env.AVIBE_INSTALL_COMMAND, [], { shell: true });+ if (status !== 0) {+ process.exit(status);+ }+ return true;+}++function installOnWindows() {+ const powershell = resolveFromPath("powershell", process.env) || resolveFromPath("pwsh", process.env);+ if (!powershell) {+ console.error("PowerShell is required to install Vibe Remote on Windows.");+ console.error("Manual install: https://docs.avibe.bot/quickstart");+ process.exit(1);+ }++ const script = `irm ${JSON.stringify(INSTALL_PS1_URL)} | iex`;+ const status = runCommand(powershell, ["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", script]);+ if (status !== 0) {+ process.exit(status);+ }+}++function installOnPosix() {+ let fetchCommand;+ if (hasCommand("curl")) {+ fetchCommand = `curl -fsSL ${shellQuote(INSTALL_SH_URL)} | bash`;+ } else if (hasCommand("wget")) {+ fetchCommand = `wget -qO- ${shellQuote(INSTALL_SH_URL)} | bash`;+ } else {+ console.error("curl or wget is required to install Vibe Remote.");+ console.error("Manual install: https://docs.avibe.bot/quickstart");+ process.exit(1);+ }++ const status = runCommand(fetchCommand, [], { shell: true });+ if (status !== 0) {+ process.exit(status);+ }+}++function shellQuote(value) {+ return `'${String(value).replace(/'/g, "'\\''")}'`;+}++function installVibe() {+ console.log("Installing Vibe Remote...");++ if (installWithCustomCommand()) {+ return;+ }++ if (process.platform === "win32") {+ installOnWindows();+ } else {+ installOnPosix();+ }+}++function ensureVibeInstalled() {+ const existing = findVibeBinary();+ if (existing) {+ return existing;+ }++ installVibe();++ const installed = findVibeBinary();+ if (installed) {+ return installed;+ }++ console.error("Vibe Remote was installed, but the 'vibe' command was not found on PATH.");+ console.error("Open a new terminal, or add the uv tool bin directory to PATH.");+ console.error("Common paths:");+ for (const dir of candidateBinDirs()) {+ console.error(` ${dir}`);+ }+ process.exit(1);+}++function normalizeArgs(args) {+ if (args[0] === "init" || args[0] === "start") {+ return args.slice(1);+ }+ return args;+}++function main() {+ const args = process.argv.slice(2);+ const command = args[0];++ if (command === "--help" || command === "-h" || command === "help") {+ printHelp();+ return;+ }++ if (command === "--version" || command === "-v") {+ printVersion();+ return;+ }++ if (command === "install") {+ installVibe();+ const vibe = findVibeBinary();+ if (vibe) {+ console.log(`Vibe Remote is ready: ${vibe}`);+ }+ return;+ }++ const vibe = ensureVibeInstalled();+ const status = runCommand(vibe, normalizeArgs(args));+ process.exit(status);+}++main();diff --git a/npm/avibe/package.json b/npm/avibe/package.jsonnew file mode 100644index 000000000..b767a372c--- /dev/null+++ b/npm/avibe/package.json@@ -0,0 +1,46 @@+{+ "name": "avibe",+ "version": "0.1.0",+ "description": "NPM entrypoint for installing and running Vibe Remote",+ "license": "MIT",+ "author": "cyhhao",+ "homepage": "https://docs.avibe.bot",+ "repository": {+ "type": "git",+ "url": "git+https://github.com/cyhhao/vibe-remote.git",+ "directory": "npm/avibe"+ },+ "bugs": {+ "url": "https://github.com/cyhhao/vibe-remote/issues"+ },+ "bin": {+ "avibe": "./bin/avibe.js"+ },+ "files": [+ "bin/",+ "README.md"+ ],+ "scripts": {+ "test": "node --test"+ },+ "keywords": [+ "avibe",+ "vibe-remote",+ "claude-code",+ "codex",+ "opencode",+ "slack",+ "discord",+ "telegram",+ "wechat",+ "lark",+ "ai-agent",+ "chatops"+ ],+ "engines": {+ "node": ">=16"+ },+ "publishConfig": {+ "access": "public"+ }+}diff --git a/npm/avibe/test/cli.test.js b/npm/avibe/test/cli.test.jsnew file mode 100644index 000000000..bcd3cdced--- /dev/null+++ b/npm/avibe/test/cli.test.js@@ -0,0 +1,114 @@+"use strict";++const assert = require("node:assert/strict");+const childProcess = require("node:child_process");+const fs = require("node:fs");+const os = require("node:os");+const path = require("node:path");+const test = require("node:test");++const cliPath = path.join(__dirname, "..", "bin", "avibe.js");++function makeTempEnv() {+ const root = fs.mkdtempSync(path.join(os.tmpdir(), "avibe-cli-test-"));+ const bin = path.join(root, "bin");+ const home = path.join(root, "home");+ fs.mkdirSync(bin, { recursive: true });+ fs.mkdirSync(home, { recursive: true });++ return { root, bin, home };+}++function writeFakeVibe(bin, label) {+ const vibePath = path.join(bin, process.platform === "win32" ? "vibe.cmd" : "vibe");+ if (process.platform === "win32") {+ fs.writeFileSync(vibePath, `@echo off\necho ${label} %*\n`);+ } else {+ fs.writeFileSync(vibePath, `#!/bin/sh\necho ${label} "$@"\n`);+ fs.chmodSync(vibePath, 0o755);+ }+ return vibePath;+}++function runCli(args, envOverrides = {}) {+ const env = {+ ...process.env,+ ...envOverrides,+ };++ return childProcess.spawnSync(process.execPath, [cliPath, ...args], {+ encoding: "utf8",+ env,+ });+}++test("prints wrapper help without installing", () => {+ const temp = makeTempEnv();+ const result = runCli(["--help"], {+ HOME: temp.home,+ USERPROFILE: temp.home,+ PATH: temp.bin,+ AVIBE_INSTALL_COMMAND: "exit 42",+ });++ assert.equal(result.status, 0);+ assert.match(result.stdout, /npx avibe/);+ assert.match(result.stdout, /npm install -g avibe/);+});++test("delegates commands to an existing vibe binary", () => {+ const temp = makeTempEnv();+ writeFakeVibe(temp.bin, "existing-vibe");++ const result = runCli(["status", "--json"], {+ HOME: temp.home,+ USERPROFILE: temp.home,+ PATH: temp.bin,+ });++ assert.equal(result.status, 0);+ assert.match(result.stdout, /existing-vibe status --json/);+});++test("installs vibe when missing, then delegates", () => {+ const temp = makeTempEnv();+ const installCommand =+ process.platform === "win32"+ ? `echo @echo off> "${path.join(temp.bin, "vibe.cmd")}" && echo echo installed-vibe %*>> "${path.join(temp.bin, "vibe.cmd")}"`+ : `/bin/mkdir -p "${temp.bin}" && /usr/bin/printf '#!/bin/sh\\necho installed-vibe "$@"\\n' > "${path.join(+ temp.bin,+ "vibe"+ )}" && /bin/chmod +x "${path.join(temp.bin, "vibe")}"`;++ const result = runCli(["doctor"], {+ HOME: temp.home,+ USERPROFILE: temp.home,+ PATH: temp.bin,+ AVIBE_INSTALL_COMMAND: installCommand,+ });++ assert.equal(result.status, 0);+ assert.match(result.stdout, /Installing Vibe Remote/);+ assert.match(result.stdout, /installed-vibe doctor/);+});++test("maps init and start to the default vibe command", () => {+ const temp = makeTempEnv();+ writeFakeVibe(temp.bin, "default-vibe");++ const init = runCli(["init"], {+ HOME: temp.home,+ USERPROFILE: temp.home,+ PATH: temp.bin,+ });+ const start = runCli(["start"], {+ HOME: temp.home,+ USERPROFILE: temp.home,+ PATH: temp.bin,+ });++ assert.equal(init.status, 0);+ assert.equal(start.status, 0);+ assert.match(init.stdout, /default-vibe\s*$/m);+ assert.match(start.stdout, /default-vibe\s*$/m);+});