From 4e3b4f24a4071b3070207166b8be9c94c87be9a6 Mon Sep 17 00:00:00 2001 From: Minh Phong Do Date: Wed, 24 Jun 2026 22:06:17 -0700 Subject: [PATCH] fix: run installer automatically on global npm install --- bin/postinstall.js | 13 +++++++++++++ package.json | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 bin/postinstall.js diff --git a/bin/postinstall.js b/bin/postinstall.js new file mode 100644 index 0000000..c986a52 --- /dev/null +++ b/bin/postinstall.js @@ -0,0 +1,13 @@ +#!/usr/bin/env node + +// Skip if explicitly opted out +if (process.env.SEED_SKIP_POSTINSTALL === '1') process.exit(0); + +// Only run automatically on global installs, not local/dependency installs +if (!process.env.npm_config_global) process.exit(0); + +try { + require('./install.js'); +} catch (err) { + console.warn('\n [seed] postinstall skipped:', err.message, '\n'); +} diff --git a/package.json b/package.json index 1e28a29..da07acf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,9 @@ { "name": "@chrisai/seed", "version": "1.0.0", + "scripts": { + "postinstall": "node bin/postinstall.js" + }, "description": "Typed project incubator — guided ideation through graduation for Claude Code. Part of the Agentic OS by Chris AI Systems.", "bin": { "seed": "bin/install.js"