@lousy-agents/agent-shell 4.0.1 → 5.0.0
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.
- package/README.md +13 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# agent-shell
|
|
1
|
+
# @lousy-agents/agent-shell
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
A flight recorder for npm script execution.
|
|
6
6
|
|
|
@@ -9,22 +9,24 @@ agent-shell is an npm `script-shell` shim that independently records what script
|
|
|
9
9
|
## Quick Start
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
# Install
|
|
13
|
-
npm install -
|
|
12
|
+
# Install globally
|
|
13
|
+
npm install -g @lousy-agents/agent-shell
|
|
14
14
|
|
|
15
15
|
# Configure npm to use agent-shell as the script shell
|
|
16
|
-
echo 'script-shell
|
|
16
|
+
echo 'script-shell=agent-shell' >> .npmrc
|
|
17
17
|
|
|
18
18
|
# Add event storage to .gitignore
|
|
19
19
|
echo '.agent-shell/' >> .gitignore
|
|
20
20
|
|
|
21
21
|
# Verify it's working
|
|
22
|
-
|
|
22
|
+
agent-shell --version
|
|
23
23
|
|
|
24
24
|
# Run any npm script — events are recorded automatically
|
|
25
25
|
npm test
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
> **Why global?** agent-shell is configured as npm's `script-shell`, so it must be available _before_ `npm ci` or `npm install` runs. A local dev dependency creates a circular dependency: npm needs agent-shell to execute the install script, but agent-shell isn't available until the install completes. Installing globally keeps the shim on `PATH` independent of `node_modules`.
|
|
29
|
+
|
|
28
30
|
## How It Works
|
|
29
31
|
|
|
30
32
|
When npm runs a script (e.g., `npm test`), it invokes the configured `script-shell` instead of `/bin/sh`. agent-shell wraps the real shell:
|
|
@@ -174,11 +176,11 @@ npm run lint && npm test && npm run build
|
|
|
174
176
|
|
|
175
177
|
### npm fails with "script-shell not found"
|
|
176
178
|
|
|
177
|
-
Your `.npmrc` references `agent-shell` but it's not installed:
|
|
179
|
+
Your `.npmrc` references `agent-shell` but it's not installed globally:
|
|
178
180
|
|
|
179
181
|
```bash
|
|
180
|
-
# Fix: install the package
|
|
181
|
-
npm install -
|
|
182
|
+
# Fix: install the package globally
|
|
183
|
+
npm install -g @lousy-agents/agent-shell
|
|
182
184
|
|
|
183
185
|
# Or: bypass temporarily
|
|
184
186
|
AGENTSHELL_PASSTHROUGH=1 npm test
|
|
@@ -198,7 +200,7 @@ Remove the `script-shell` line from `.npmrc`:
|
|
|
198
200
|
|
|
199
201
|
```bash
|
|
200
202
|
# Edit .npmrc and delete this line:
|
|
201
|
-
# script-shell
|
|
203
|
+
# script-shell=agent-shell
|
|
202
204
|
|
|
203
205
|
# Or remove it with sed:
|
|
204
206
|
sed -i '' '/script-shell/d' .npmrc
|
|
@@ -207,7 +209,7 @@ sed -i '' '/script-shell/d' .npmrc
|
|
|
207
209
|
Then optionally uninstall:
|
|
208
210
|
|
|
209
211
|
```bash
|
|
210
|
-
npm uninstall @lousy-agents/agent-shell
|
|
212
|
+
npm uninstall -g @lousy-agents/agent-shell
|
|
211
213
|
```
|
|
212
214
|
|
|
213
215
|
### Verify the shim is active
|