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 CHANGED
@@ -1,35 +1,33 @@
1
1
  # RequestShield CLI
2
2
 
3
- Customer-facing command-line tool for RequestShield. The CLI lets a customer
4
- sign in, rotate application credentials, install the RequestShield Skill for
5
- Codex, and check for a newer npm release.
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.2`.
7
+ Current package version: `0.1.4`.
8
8
 
9
9
  ## Requirements
10
10
 
11
- - Node.js 22.13 or newer when running from source, npm, or npx.
12
- - pnpm for local development and release builds.
11
+ - Node.js 22.13 or newer.
13
12
  - A RequestShield customer management API.
14
- - Windows x64 and Inno Setup 6 when building the Windows installer.
13
+ - npm for local development and publishing.
15
14
 
16
- The management API defaults to `https://api.intellifend.ai`. During local
17
- development, set `REQUESTSHIELD_API_URL` to another API origin when needed.
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 --agent codex [--force]
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 but does not open a browser automatically. After authorization, the
41
- session is saved in the current user's application-data directory.
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` may provide the access token.
44
- An environment token is never persisted by the CLI.
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 atomically deactivates the previous
53
- credentials and creates a new `appKey` and `apiSecret`.
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` identifies the application and may be used by the client integration.
56
- - `apiSecret` is a backend-only secret, is displayed once, and is not saved by
57
- the CLI.
58
- - `--yes` skips the interactive confirmation and is intended for automation.
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 Codex Skill
60
+ ### Install the Agent Skill
61
+
62
+ Let the CLI detect the installed coding agent:
63
63
 
64
64
  ```console
65
- requestshield agent setup --agent codex
65
+ requestshield agent setup
66
66
  ```
67
67
 
68
- Installs the bundled RequestShield Skill into
69
- `$CODEX_HOME/skills/requestshield`, or `~/.codex/skills/requestshield` when
70
- `CODEX_HOME` is not set. Restart Codex or start a new task after installation.
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 that Skill already exists, the command preserves it. Use `--force` to
73
- replace the existing copy:
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 --agent codex --force
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
- Reads the latest `requestshield` version from the npm registry. If a newer
86
- version exists, the CLI displays the current and latest versions, asks the user
87
- to confirm with `y`, then runs:
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 updater is for npm global installations and requires `node` and `npm` on
94
- the customer's machine. It does not replace an executable installed by the
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 and run with npm
114
+ ## Install with npm
98
115
 
99
- Install globally so `requestshield` is available from any directory:
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 a global installation:
124
+ Run a specific version without installing globally:
107
125
 
108
126
  ```console
109
- npx --yes requestshield@0.1.2 --help
110
- npx --yes requestshield@0.1.2 signin
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
- pnpm install
119
- pnpm lint
120
- pnpm typecheck
121
- pnpm test
122
- pnpm build
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` currently validates the syntax of all `.mjs` files. It does not create
128
- the standalone Windows executable.
154
+ The current `build` script validates the syntax of the `.mjs` source files. It
155
+ does not generate a standalone executable.
129
156
 
130
- To test the update interaction without publishing or installing anything:
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.3"
134
- pnpm test:update-check:manual
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
- The manual test prints `[MOCK] Would install ...`; it intentionally does not
139
- change the installed CLI version.
168
+ After entering `y`, the test prints `[MOCK] Would install ...`.
140
169
 
141
- ## Build the standalone Windows executable
170
+ ## Packaging the RequestShield Skill
142
171
 
143
- The project uses Node.js Single Executable Applications (SEA). Run these steps
144
- from the `requestshield-cli` directory in PowerShell:
172
+ The canonical Skill is stored at `../skills/requestshield`. Do not maintain a
173
+ second source copy inside this package.
145
174
 
146
- ```powershell
147
- New-Item -ItemType Directory -Force -Path .\dist | Out-Null
148
- pnpm exec esbuild .\src\main.mjs --bundle --platform=node --format=cjs --target=node22 --outfile=.\dist\requestshield.cjs
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
- The generated file is `dist\requestshield.exe`. It contains Node.js and does
156
- not require Node.js to be installed on the customer's machine.
179
+ Inspect the files that npm will publish:
157
180
 
158
- ## Build the Windows installer
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
- The installer is written to `release\RequestShieldSetup-0.1.2-windows-x64.exe`.
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
- requestshield --help
188
+ npm pack
175
189
  ```
176
190
 
177
191
  ## Publish to npm
178
192
 
179
- Before publishing, update `version` in `package.json`, run the checks, and
180
- inspect the package contents:
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
- pnpm lint
184
- pnpm typecheck
185
- pnpm test
186
- pnpm pack --dry-run
187
- pnpm publish --access public --no-git-checks
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
- npm may ask for a one-time password in the interactive terminal. After
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.2 --version
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "requestshield",
3
- "version": "0.1.2",
4
- "description": "Customer CLI for RequestShield.",
3
+ "version": "0.1.4",
4
+ "description": "Customer CLI for IntelliFend RequestShield.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "requestshield": "src/main.mjs"