@jondeodat/claude-setup-cli 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +24 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -44,6 +44,13 @@ It never fails, so that it cannot break an `npm install` or a session start: a f
44
44
  unknown plugin…) is reported, and the run goes on. It does nothing without the `claude` CLI, in CI (`CI`
45
45
  set), or with `CLAUDE_SETUP_SKIP` set.
46
46
 
47
+ The `claude` CLI it runs is the one `CLAUDE_CODE_EXECPATH` names, or else the `claude` on the `PATH`,
48
+ whichever first answers `--version` as Claude Code. Claude Code sets `CLAUDE_CODE_EXECPATH` in the
49
+ processes it starts, a hook among them: a Claude Code installed only as an IDE extension puts no `claude`
50
+ on the `PATH`, but names its own binary in the variable, so its hooks still find it. The variable is not
51
+ documented, and may name a binary an update removed since or one that is not the `claude` CLI, hence the
52
+ check and the fallback.
53
+
47
54
  ## Installation
48
55
 
49
56
  ```sh
@@ -65,15 +72,8 @@ claude-setup [--hook] [--max-age <hours>]
65
72
  - `--max-age <hours>` refreshes the marketplaces only when the last refresh, recorded in
66
73
  `node_modules/.cache/claude-setup/state.json`, is older. Without it, every run refreshes.
67
74
 
68
- In a project, from the `prepare` script of its `package.json`, which runs on an `npm install` or `npm ci`
69
- in the project itself but not where the project is installed as a dependency (unlike `postinstall`):
70
-
71
- ```json
72
- "prepare": "claude-setup"
73
- ```
74
-
75
- And from a `SessionStart` hook of `.claude/settings.json`, once a day. The guard skips it in a clone where
76
- the dependencies are not installed yet:
75
+ In a project, from a `SessionStart` hook of `.claude/settings.json`, once a day. The guard skips it in a
76
+ clone where the dependencies are not installed yet:
77
77
 
78
78
  ```json
79
79
  "hooks": {
@@ -91,6 +91,21 @@ the dependencies are not installed yet:
91
91
  }
92
92
  ```
93
93
 
94
+ Optionally, also from the `prepare` script of its `package.json`, which runs on an `npm install` or
95
+ `npm ci` in the project itself but not where the project is installed as a dependency (unlike
96
+ `postinstall`):
97
+
98
+ ```json
99
+ "prepare": "claude-setup"
100
+ ```
101
+
102
+ - npm does not run it when `ignore-scripts` is set, a common hardening: `ignore-scripts` turns off the
103
+ scripts of the project's own `package.json` too, and `allowScripts` cannot let it through, since it only
104
+ covers the install scripts of dependencies and `ignore-scripts` overrides it. `npm run prepare` still
105
+ runs it.
106
+ - Run by npm, it only has `CLAUDE_CODE_EXECPATH` when the `npm install` itself was started from Claude
107
+ Code, such as from its Bash tool: otherwise it needs `claude` on the `PATH`.
108
+
94
109
  ## Development
95
110
 
96
111
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jondeodat/claude-setup-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Registers the Claude Code marketplaces and installs the plugins that a project declares in .claude/settings.json, at project scope.",
5
5
  "license": "MIT",
6
6
  "type": "module",