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"