requestshield 0.1.2 → 0.1.4
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 +106 -93
- package/package.json +2 -2
- package/skills/requestshield/SKILL.md +307 -44
- package/skills/requestshield/assets/AGENTS.codex.md +62 -0
- package/skills/requestshield/references/backend-java-core.md +128 -0
- package/skills/requestshield/references/backend-spring-boot.md +145 -0
- package/skills/requestshield/references/browser-manual.md +210 -0
- package/skills/requestshield/references/browser-seamless.md +164 -0
- package/skills/requestshield/references/cli.md +182 -0
- package/skills/requestshield/references/integration-planning.md +389 -0
- package/skills/requestshield/references/troubleshooting.md +118 -0
- package/src/agent-detector.mjs +74 -0
- package/src/args.mjs +85 -122
- package/src/cli.mjs +51 -51
- package/src/commands/agent-setup.mjs +185 -91
package/README.md
CHANGED
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
# RequestShield CLI
|
|
2
2
|
|
|
3
|
-
Customer-facing
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Customer-facing CLI for IntelliFend RequestShield. It allows customers to sign
|
|
4
|
+
in, rotate application credentials, install the RequestShield Skill for Codex
|
|
5
|
+
or Claude, and update an npm-installed CLI.
|
|
6
6
|
|
|
7
|
-
Current package version: `0.1.
|
|
7
|
+
Current package version: `0.1.4`.
|
|
8
8
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
11
|
-
- Node.js 22.13 or newer
|
|
12
|
-
- pnpm for local development and release builds.
|
|
11
|
+
- Node.js 22.13 or newer.
|
|
13
12
|
- A RequestShield customer management API.
|
|
14
|
-
-
|
|
13
|
+
- npm for local development and publishing.
|
|
15
14
|
|
|
16
|
-
The management API defaults to `https://api.intellifend.ai`.
|
|
17
|
-
|
|
15
|
+
The management API defaults to `https://api.intellifend.ai`. Set
|
|
16
|
+
`REQUESTSHIELD_API_URL` to use a different management API during development.
|
|
18
17
|
|
|
19
18
|
## Implemented commands
|
|
20
19
|
|
|
21
20
|
```console
|
|
22
21
|
requestshield signin
|
|
23
22
|
requestshield keys create [--yes]
|
|
24
|
-
requestshield agent setup
|
|
23
|
+
requestshield agent setup [--force]
|
|
24
|
+
requestshield agent setup --codex [--force]
|
|
25
|
+
requestshield agent setup --claude [--force]
|
|
25
26
|
requestshield update check
|
|
26
27
|
requestshield --help
|
|
27
28
|
requestshield --version
|
|
28
29
|
```
|
|
29
30
|
|
|
30
|
-
The full command catalog shown by `requestshield --help` includes planned
|
|
31
|
-
commands. Only the commands listed above are currently implemented.
|
|
32
|
-
|
|
33
31
|
### Sign in
|
|
34
32
|
|
|
35
33
|
```console
|
|
@@ -37,11 +35,11 @@ requestshield signin
|
|
|
37
35
|
```
|
|
38
36
|
|
|
39
37
|
Starts the device authorization flow. The CLI prints the verification URL and
|
|
40
|
-
user code
|
|
41
|
-
session is
|
|
38
|
+
user code without opening the browser automatically. After authorization, the
|
|
39
|
+
session is stored for the current operating-system user.
|
|
42
40
|
|
|
43
|
-
For CI or automation, `REQUESTSHIELD_ACCESS_TOKEN
|
|
44
|
-
|
|
41
|
+
For CI or automation, provide `REQUESTSHIELD_ACCESS_TOKEN`. A token supplied by
|
|
42
|
+
the environment is used directly and is not persisted by the CLI.
|
|
45
43
|
|
|
46
44
|
### Create new keys
|
|
47
45
|
|
|
@@ -49,151 +47,168 @@ An environment token is never persisted by the CLI.
|
|
|
49
47
|
requestshield keys create
|
|
50
48
|
```
|
|
51
49
|
|
|
52
|
-
Asks the customer to type `ROTATE`, then
|
|
53
|
-
credentials and
|
|
50
|
+
Asks the customer to type `ROTATE`, then calls the management API to deactivate
|
|
51
|
+
the previous credentials and create a new `appKey` and `apiSecret`.
|
|
54
52
|
|
|
55
|
-
- `appKey`
|
|
56
|
-
- `apiSecret` is a backend-only secret
|
|
57
|
-
|
|
58
|
-
- `--yes` skips the
|
|
53
|
+
- `appKey` is the public application identifier.
|
|
54
|
+
- `apiSecret` is a backend-only secret displayed once.
|
|
55
|
+
- The CLI does not save the returned `apiSecret`.
|
|
56
|
+
- `--yes` skips the confirmation prompt for non-interactive automation.
|
|
59
57
|
|
|
60
58
|
Store the Secret Key in a backend secret manager immediately after creation.
|
|
61
59
|
|
|
62
|
-
### Install the
|
|
60
|
+
### Install the Agent Skill
|
|
61
|
+
|
|
62
|
+
Let the CLI detect the installed coding agent:
|
|
63
63
|
|
|
64
64
|
```console
|
|
65
|
-
requestshield agent setup
|
|
65
|
+
requestshield agent setup
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
Or select an agent explicitly:
|
|
69
|
+
|
|
70
|
+
```console
|
|
71
|
+
requestshield agent setup --codex
|
|
72
|
+
requestshield agent setup --claude
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The CLI installs the Skill into:
|
|
76
|
+
|
|
77
|
+
- Codex: `~/.agents/skills/requestshield`
|
|
78
|
+
- Claude: `~/.claude/skills/requestshield`
|
|
71
79
|
|
|
72
|
-
If
|
|
73
|
-
|
|
80
|
+
If exactly one supported agent is detected, it is selected automatically. If
|
|
81
|
+
both are detected in an interactive terminal, the CLI asks which one to use.
|
|
82
|
+
If neither is detected, select one with `--codex` or `--claude`.
|
|
83
|
+
|
|
84
|
+
Existing Skill content is preserved. Add `--force` to replace it:
|
|
74
85
|
|
|
75
86
|
```console
|
|
76
|
-
requestshield agent setup --
|
|
87
|
+
requestshield agent setup --codex --force
|
|
77
88
|
```
|
|
78
89
|
|
|
90
|
+
Restart the selected agent or start a new task after installation.
|
|
91
|
+
|
|
79
92
|
### Check for updates
|
|
80
93
|
|
|
81
94
|
```console
|
|
82
95
|
requestshield update check
|
|
83
96
|
```
|
|
84
97
|
|
|
85
|
-
|
|
86
|
-
version exists, the CLI displays the current and latest versions
|
|
87
|
-
|
|
98
|
+
Checks the npm registry for the latest `requestshield` version. When a newer
|
|
99
|
+
version exists, the CLI displays the current and latest versions and asks:
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
Update to RequestShield <version>? (y/N):
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Entering `y` runs the equivalent of:
|
|
88
106
|
|
|
89
107
|
```console
|
|
90
108
|
npm install --global requestshield@<latest-version>
|
|
91
109
|
```
|
|
92
110
|
|
|
93
|
-
This
|
|
94
|
-
|
|
95
|
-
Windows Inno Setup installer.
|
|
111
|
+
This command requires an interactive terminal, Node.js, and npm. It updates a
|
|
112
|
+
global npm installation; it does not replace a standalone Windows executable.
|
|
96
113
|
|
|
97
|
-
## Install
|
|
114
|
+
## Install with npm
|
|
98
115
|
|
|
99
|
-
Install globally
|
|
116
|
+
Install globally:
|
|
100
117
|
|
|
101
118
|
```console
|
|
102
119
|
npm install --global requestshield
|
|
103
120
|
requestshield --help
|
|
121
|
+
requestshield --version
|
|
104
122
|
```
|
|
105
123
|
|
|
106
|
-
Run without
|
|
124
|
+
Run a specific version without installing globally:
|
|
107
125
|
|
|
108
126
|
```console
|
|
109
|
-
npx --yes requestshield@0.1.
|
|
110
|
-
npx --yes requestshield@0.1.
|
|
127
|
+
npx --yes requestshield@0.1.4 --help
|
|
128
|
+
npx --yes requestshield@0.1.4 signin
|
|
111
129
|
```
|
|
112
130
|
|
|
131
|
+
To invoke the update command through npx, include the package name:
|
|
132
|
+
|
|
133
|
+
```console
|
|
134
|
+
npx --yes requestshield@0.1.4 update check
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Do not run `npx update check`; npm interprets `update` as the name of a different
|
|
138
|
+
npm package.
|
|
139
|
+
|
|
113
140
|
## Local development
|
|
114
141
|
|
|
115
142
|
From the `requestshield-cli` directory:
|
|
116
143
|
|
|
117
144
|
```console
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
145
|
+
npm install
|
|
146
|
+
npm run lint
|
|
147
|
+
npm run typecheck
|
|
148
|
+
npm test
|
|
149
|
+
npm run build
|
|
123
150
|
node src/main.mjs --help
|
|
124
151
|
node src/main.mjs --version
|
|
125
152
|
```
|
|
126
153
|
|
|
127
|
-
`build`
|
|
128
|
-
|
|
154
|
+
The current `build` script validates the syntax of the `.mjs` source files. It
|
|
155
|
+
does not generate a standalone executable.
|
|
129
156
|
|
|
130
|
-
|
|
157
|
+
### Test the update flow locally
|
|
158
|
+
|
|
159
|
+
The manual update test mocks the registry and install operation, so it does not
|
|
160
|
+
publish a package or change the installed version:
|
|
131
161
|
|
|
132
162
|
```powershell
|
|
133
|
-
$env:REQUESTSHIELD_MOCK_LATEST_VERSION = "0.1.
|
|
134
|
-
|
|
163
|
+
$env:REQUESTSHIELD_MOCK_LATEST_VERSION = "0.1.5"
|
|
164
|
+
npm run test:update-check:manual
|
|
135
165
|
Remove-Item Env:REQUESTSHIELD_MOCK_LATEST_VERSION
|
|
136
166
|
```
|
|
137
167
|
|
|
138
|
-
|
|
139
|
-
change the installed CLI version.
|
|
168
|
+
After entering `y`, the test prints `[MOCK] Would install ...`.
|
|
140
169
|
|
|
141
|
-
##
|
|
170
|
+
## Packaging the RequestShield Skill
|
|
142
171
|
|
|
143
|
-
The
|
|
144
|
-
|
|
172
|
+
The canonical Skill is stored at `../skills/requestshield`. Do not maintain a
|
|
173
|
+
second source copy inside this package.
|
|
145
174
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
node --experimental-sea-config .\sea-config.json
|
|
150
|
-
Copy-Item (Get-Command node.exe).Source .\dist\requestshield.exe -Force
|
|
151
|
-
pnpm exec postject .\dist\requestshield.exe NODE_SEA_BLOB .\dist\requestshield.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
|
|
152
|
-
.\dist\requestshield.exe --help
|
|
153
|
-
```
|
|
175
|
+
Before npm creates the package, the `prepack` hook temporarily copies the
|
|
176
|
+
canonical Skill to `skills/requestshield`. The `postpack` hook removes that
|
|
177
|
+
generated copy after packaging.
|
|
154
178
|
|
|
155
|
-
|
|
156
|
-
not require Node.js to be installed on the customer's machine.
|
|
179
|
+
Inspect the files that npm will publish:
|
|
157
180
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Install Inno Setup 6, then compile the installer and pass the current package
|
|
161
|
-
version explicitly:
|
|
162
|
-
|
|
163
|
-
```powershell
|
|
164
|
-
New-Item -ItemType Directory -Force -Path .\release | Out-Null
|
|
165
|
-
& "$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe" "/DAppVersion=0.1.2" "/FRequestShieldSetup-0.1.2-windows-x64" ".\installer\requestshield.iss"
|
|
181
|
+
```console
|
|
182
|
+
npm pack --dry-run
|
|
166
183
|
```
|
|
167
184
|
|
|
168
|
-
|
|
169
|
-
It installs `requestshield.exe` under the current user's local application-data
|
|
170
|
-
directory and adds that directory to the user `PATH`. The customer must open a
|
|
171
|
-
new terminal before running:
|
|
185
|
+
Create a local tarball:
|
|
172
186
|
|
|
173
187
|
```console
|
|
174
|
-
|
|
188
|
+
npm pack
|
|
175
189
|
```
|
|
176
190
|
|
|
177
191
|
## Publish to npm
|
|
178
192
|
|
|
179
|
-
|
|
180
|
-
|
|
193
|
+
npm does not allow an existing package version to be overwritten. Check the
|
|
194
|
+
published version, merge the latest team changes, then choose a new version in
|
|
195
|
+
`package.json` before publishing.
|
|
181
196
|
|
|
182
197
|
```console
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
198
|
+
npm view requestshield version
|
|
199
|
+
npm run lint
|
|
200
|
+
npm run typecheck
|
|
201
|
+
npm test
|
|
202
|
+
npm pack --dry-run
|
|
203
|
+
npm publish --access public
|
|
188
204
|
```
|
|
189
205
|
|
|
190
|
-
|
|
191
|
-
publishing, verify the registry state:
|
|
206
|
+
Verify the published package:
|
|
192
207
|
|
|
193
208
|
```console
|
|
194
209
|
npm view requestshield version
|
|
195
210
|
npm dist-tag ls requestshield
|
|
196
|
-
npx --yes requestshield@0.1.
|
|
211
|
+
npx --yes requestshield@0.1.4 --version
|
|
197
212
|
```
|
|
198
213
|
|
|
199
214
|
## Management API contract
|
|
@@ -227,7 +242,5 @@ The response contains `appKey` and the one-time `apiSecret`.
|
|
|
227
242
|
## Security notes
|
|
228
243
|
|
|
229
244
|
- Never place an access token or Secret Key in URLs, command arguments, logs,
|
|
230
|
-
fixtures, or committed files.
|
|
245
|
+
test fixtures, or committed files.
|
|
231
246
|
- The CLI does not persist the Secret Key returned by `keys create`.
|
|
232
|
-
- Sign the Windows executable and installer before distributing them to
|
|
233
|
-
customers, and publish a checksum through a trusted release channel.
|
package/package.json
CHANGED