Skip to content

Match postinstall skills scope to npm install context#54

Merged
lbebber merged 2 commits into
mainfrom
postinstall-scope-from-npm
Jun 18, 2026
Merged

Match postinstall skills scope to npm install context#54
lbebber merged 2 commits into
mainfrom
postinstall-scope-from-npm

Conversation

@lbebber

@lbebber lbebber commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Passes --global to cio skills install when installed via npm i -g (global)
  • Passes --project when installed as a project dependency (npm i @customerio/cli)
  • Uses npm_config_global env var, which npm sets to "true" during global installs

Previously the postinstall relied on the CLI's non-TTY fallback (which defaults to global). This makes the intent explicit and enables project-scoped installs for npm scripts usage.

Test plan

  • Verified npm_config_global is "true" during npm i -g
  • npm i -g @customerio/cli → should install skills globally (~/.claude/skills/)
  • npm i @customerio/cli in a project → should install skills in the project (./.claude/skills/)

… context

Use npm_config_global to detect whether the package was installed
globally (npm i -g) or as a project dependency, and pass the
matching scope flag to cio skills install.
npm runs postinstall with cwd inside node_modules, not the project
root. Use INIT_CWD (set by npm to the original working directory)
so --project installs skills into the actual project directory.
@lbebber lbebber merged commit 22a791b into main Jun 18, 2026
17 checks passed
@lbebber lbebber deleted the postinstall-scope-from-npm branch June 18, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant