requestshield 0.1.4 → 0.1.5

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.
@@ -1,182 +1,183 @@
1
- # `requestshield` CLI reference
2
-
3
- Every RequestShield platform action goes through this CLI. There is no supported way
4
- to create keys, read the contract, or check traffic by hand-crafting HTTP calls, so if
5
- a task needs one of these values, run the command rather than guessing.
6
-
7
- Commands marked **auth** require a signed-in session (`requestshield signin`). The CLI
8
- also exposes local commands that do not need platform API access, such as `--help`,
9
- `--version`, and agent setup. Check once with `auth status` before a multi-step
10
- platform task instead of discovering it halfway through an edit.
11
-
12
- Most commands print JSON shaped `{"ok": true, "data": {...}}`. Parse `data`; treat
13
- `ok: false` as a hard stop and surface the message rather than continuing with edits.
14
-
15
- ## Contents
16
-
17
- - [General](#general)
18
- - [Authentication](#authentication)
19
- - [Key management](#key-management)
20
- - [Integration contract](#integration-contract)
21
- - [Applications](#applications)
22
- - [Credentials](#credentials)
23
- - [Service and monitoring](#service-and-monitoring)
24
- - [Billing](#billing)
25
- - [Agent integration](#agent-integration)
26
-
27
- ## General
28
-
29
- | Command | Purpose |
30
- | --- | --- |
31
- | `requestshield --help` | Usage and the full command list. Run this if a command below is rejected — the installed CLI may be older or newer than this file. |
32
- | `requestshield --version` | Installed CLI version, e.g. `requestshield 1.0.0`. |
33
- | `requestshield update check` | Latest available version. Use it when behaviour disagrees with this reference. |
34
-
35
- ## Authentication
36
-
37
- ```bash
38
- requestshield signin
39
- requestshield auth status
40
- ```
41
-
42
- **auth/API.**
43
-
44
- `signin` is interactive and stores a session on the machine. **Never try to automate
45
- it or ask for the user's credentials** — if the user is signed out, tell them to run it
46
- themselves and wait.
47
-
48
- `auth status` returns `{"ok":true,"data":{"authenticated":true,"customer_id":"customer_456"}}`.
49
- The `customer_id` is useful context to echo back so the user can confirm they are
50
- operating on the right account before you create or deactivate anything.
51
-
52
- ## Key management
53
-
54
- **The user runs these, not you.** They print the API Secret or change state for a live
55
- App Key, so hand over the exact command and let them run it in their own terminal. See
56
- "Key and secret management" in `SKILL.md` for the hand-off and the follow-up
57
- presence check.
58
-
59
- ```bash
60
- requestshield keys create --app-name <name>
61
- requestshield keys deactive --app-key <app-key> # or --app-name <name>
62
- requestshield app key rotate --app-key <app-key> # or --app-name <name>
63
- ```
64
-
65
- `keys create` returns both halves:
66
-
67
- ```
68
- App Key: app_123
69
- Secret Key: rs_sk_xxxxx
70
- Save this Secret Key now. It will not be shown again.
71
- ```
72
-
73
- The Secret Key appears exactly once. Warn the user *before* they run the command that
74
- they need somewhere to put it, and afterwards point them at the environment variable
75
- rather than repeating the value. Never ask them to paste the secret back — confirm it
76
- only by presence. See the secret-handling rules in `SKILL.md`.
77
-
78
- `keys deactive` (spelled that way in the CLI) needs at least one of `--app-key` or
79
- `--app-name`; if both are given, `--app-key` wins. Deactivation stops traffic being
80
- verified for that key, so name the affected app explicitly when you hand the command
81
- over and make sure the user means that key.
82
-
83
- `app key rotate` issues a new Secret Key for an existing App Key and deactivates the
84
- previous one. This is the correct response to a leaked or lost secret — it keeps the
85
- App Key stable, so no browser or config change is needed beyond the new secret. Like
86
- `keys create`, the user runs it.
87
-
88
- ## Integration contract
89
-
90
- ```bash
91
- requestshield contract
92
- ```
93
-
94
- **auth.** The authoritative integration surface — run this before writing any
95
- integration code. The block below is an **illustration of the shape only**; never read
96
- values out of it, and in particular do not treat its `available_modes` as the modes your
97
- customer has:
98
-
99
- ```json
100
- {"ok":true,"data":{
101
- "contract_version":"2026-08-27",
102
- "browser":{"script_url":"https://.../intellifend.js","token_header":"X-IntelliFend-Token",
103
- "available_modes":["manual"]},
104
- "backend":{"supported_languages":["java"],"min_jdk":17},
105
- "release_state":"..."}}
106
- ```
107
-
108
- Use `script_url` and `token_header` verbatim. Check `available_modes` before committing
109
- to seamless or manual — a mode absent from that list is not released, and writing an
110
- integration against it produces code that will not work. Check `supported_languages`
111
- before promising a backend integration for a stack that is not listed; the browser side
112
- alone provides no protection, so an unsupported backend means the honest answer is
113
- "not yet supported here".
114
-
115
- ## Applications
116
-
117
- ```bash
118
- requestshield apps list
119
- requestshield apps get <app-key>
120
- ```
121
-
122
- **auth.** `apps list` returns the applications the current user can access, each with
123
- `app_key`, `name`, and `status`. Use it to resolve a human-supplied app name to a key
124
- rather than asking the user to retype one.
125
-
126
- `apps get <app-key>` returns `app_id`, `app_name`, and `status`. Status distinguishes a
127
- key that has never seen traffic (`ready`) from one in normal service (`active`) — which
128
- is exactly the difference between "the integration is not wired up yet" and "it is
129
- working", so check it before spending time debugging code.
130
-
131
- ## Credentials
132
-
133
- ```bash
134
- requestshield credentials status <app-key>
135
- ```
136
-
137
- **auth.** Returns metadata only — `provisioned`, `active`, `shared` — and never the
138
- secret value. Use it to answer "is the secret configured?" without anyone having to
139
- paste a credential. A key that is `provisioned: false` explains backend failures far
140
- faster than reading code.
141
-
142
- ## Service and monitoring
143
-
144
- ```bash
145
- requestshield server
146
- requestshield challenge volume <app-key> [--from <time>] [--to <time>] [--granularity <value>]
147
- ```
148
-
149
- **auth.** `server` reports `healthy` or `degraded`. Check it first when an integration
150
- that was working starts behaving oddly a degraded platform explains fail-open
151
- behaviour on the backend without anything being wrong in the customer's code.
152
-
153
- `challenge volume` is runtime evidence that the browser/platform half is active. It is
154
- not proof that the protected backend enforces a blocking decision; the controlled
155
- negative test in `SKILL.md` provides that evidence. Times are ISO-8601
156
- (`2026-08-01T00:00:00Z`); `--granularity` takes values such as `hour` or `day`. A
157
- `challenge_count` of zero after the user has exercised the endpoint means the browser
158
- half is not firing that is a browser-side bug, not a backend one, so start with the
159
- mode's reference file.
160
-
161
- ## Billing
162
-
163
- ```bash
164
- requestshield get billing
165
- ```
166
-
167
- **auth.** Current plan and usage for the application. Read-only; surface it when the
168
- user asks about cost or limits.
169
-
170
- ## Agent integration
171
-
172
- ```bash
173
- requestshield agent setup
174
- requestshield agent setup --agent claude
175
- requestshield agent setup --agent codex
176
- ```
177
-
178
- Local setup. Installs this skill for the named agent. With no `--agent`, the CLI detects
179
- which agent is in use. Run it when the user wants the skill available in another repo or
180
- for the other agent; it is the supported alternative to copying files by hand. It should
181
- not require a RequestShield App Key or API Secret, and it must not create, rotate, or
182
- deactivate customer credentials.
1
+ # `requestshield` CLI reference
2
+
3
+ Every RequestShield platform action goes through this CLI. There is no supported way
4
+ to create keys, read the contract, or check traffic by hand-crafting HTTP calls, so if
5
+ a task needs one of these values, run the command rather than guessing.
6
+
7
+ Commands marked **auth** require a signed-in session (`requestshield signin`). The CLI
8
+ also exposes local commands that do not need platform API access, such as `--help`,
9
+ `--version`, and agent setup. Check once with `auth status` before a multi-step
10
+ platform task instead of discovering it halfway through an edit.
11
+
12
+ Most commands print JSON shaped `{"ok": true, "data": {...}}`. Parse `data`; treat
13
+ `ok: false` as a hard stop and surface the message rather than continuing with edits.
14
+
15
+ ## Contents
16
+
17
+ - [General](#general)
18
+ - [Authentication](#authentication)
19
+ - [Key management](#key-management)
20
+ - [Integration contract](#integration-contract)
21
+ - [Applications](#applications)
22
+ - [Credentials](#credentials)
23
+ - [Service and monitoring](#service-and-monitoring)
24
+ - [Billing](#billing)
25
+ - [Agent integration](#agent-integration)
26
+
27
+ ## General
28
+
29
+ | Command | Purpose |
30
+ | --- | --- |
31
+ | `requestshield --help` | Usage and the full command list. Run this if a command below is rejected — the installed CLI may be older or newer than this file. |
32
+ | `requestshield --version` | Installed CLI version, e.g. `requestshield 1.0.0`. |
33
+ | `requestshield update check` | Latest available version. Use it when behaviour disagrees with this reference. |
34
+
35
+ ## Authentication
36
+
37
+ ```bash
38
+ requestshield signin
39
+ requestshield auth status
40
+ ```
41
+
42
+ **auth/API.**
43
+
44
+ `signin` is interactive and stores a session on the machine. **Never try to automate
45
+ it or ask for the user's credentials** — if the user is signed out, tell them to run it
46
+ themselves and wait.
47
+
48
+ `auth status` returns `{"ok":true,"data":{"authenticated":true,"customer_id":"customer_456"}}`.
49
+ The `customer_id` is useful context to echo back so the user can confirm they are
50
+ operating on the right account before you create or deactivate anything.
51
+
52
+ ## Key management
53
+
54
+ **The user runs these, not you.** They print the API Secret or change state for a live
55
+ App Key, so hand over the exact command and let them run it in their own terminal. See
56
+ "Key and secret management" in `SKILL.md` for the hand-off and the follow-up
57
+ presence check.
58
+
59
+ ```bash
60
+ requestshield keys create --app-name <name>
61
+ requestshield keys deactive --app-key <app-key> # or --app-name <name>
62
+ requestshield app key rotate --app-key <app-key> # or --app-name <name>
63
+ ```
64
+
65
+ `keys create` returns both halves:
66
+
67
+ ```
68
+ App Key: app_123
69
+ Secret Key: rs_sk_xxxxx
70
+ Save this Secret Key now. It will not be shown again.
71
+ ```
72
+
73
+ The Secret Key appears exactly once. Warn the user *before* they run the command that
74
+ they need somewhere to put it, and afterwards point them at the environment variable
75
+ rather than repeating the value. Never ask them to paste the secret back — confirm it
76
+ only by presence. See the secret-handling rules in `SKILL.md`.
77
+
78
+ `keys deactive` (spelled that way in the CLI) needs at least one of `--app-key` or
79
+ `--app-name`; if both are given, `--app-key` wins. Deactivation stops traffic being
80
+ verified for that key, so name the affected app explicitly when you hand the command
81
+ over and make sure the user means that key.
82
+
83
+ `app key rotate` issues a new Secret Key for an existing App Key and deactivates the
84
+ previous one. This is the correct response to a leaked or lost secret — it keeps the
85
+ App Key stable, so no browser or config change is needed beyond the new secret. Like
86
+ `keys create`, the user runs it.
87
+
88
+ ## Integration contract
89
+
90
+ ```bash
91
+ requestshield contract
92
+ ```
93
+
94
+ **auth.** The authoritative integration surface — run this before writing any
95
+ integration code. The block below is an **illustration of the shape only**; never read
96
+ values out of it, and in particular do not treat its `available_modes` as the modes your
97
+ customer has:
98
+
99
+ ```json
100
+ {"ok":true,"data":{
101
+ "contract_version":"2026-08-27",
102
+ "browser":{"script_url":"https://.../intellifend.js","token_header":"X-IntelliFend-Token",
103
+ "available_modes":["manual"]},
104
+ "backend":{"supported_languages":["java"],"min_jdk":17},
105
+ "release_state":"..."}}
106
+ ```
107
+
108
+ Use `script_url` and `token_header` verbatim. Check `available_modes` before committing
109
+ to seamless or manual — a mode absent from that list is not released, and writing an
110
+ integration against it produces code that will not work. Check `supported_languages`
111
+ before promising a backend integration for a stack that is not listed; the browser side
112
+ alone provides no protection, so an unsupported backend means the honest answer is
113
+ "not yet supported here".
114
+
115
+ ## Applications
116
+
117
+ ```bash
118
+ requestshield apps list
119
+ requestshield apps get <app-key>
120
+ ```
121
+
122
+ **auth.** `apps list` returns the applications the current user can access, each with
123
+ `appKey`, `name`, `status`, `createdAt`, and `updatedAt`; JSON output also includes
124
+ `nextCursor`. Use it to resolve a human-supplied app name to a key rather than asking
125
+ the user to retype one.
126
+
127
+ `apps get <app-key>` returns `app_key`, `name`, and `status`. Status distinguishes a
128
+ key that has never seen traffic (`ready`) from one in normal service (`active`) which
129
+ is exactly the difference between "the integration is not wired up yet" and "it is
130
+ working", so check it before spending time debugging code.
131
+
132
+ ## Credentials
133
+
134
+ ```bash
135
+ requestshield credentials status <app-key>
136
+ ```
137
+
138
+ **auth.** Returns metadata only `provisioned`, `active`, `shared` and never the
139
+ secret value. Use it to answer "is the secret configured?" without anyone having to
140
+ paste a credential. A key that is `provisioned: false` explains backend failures far
141
+ faster than reading code.
142
+
143
+ ## Service and monitoring
144
+
145
+ ```bash
146
+ requestshield server
147
+ requestshield challenge volume <app-key> [--from <time>] [--to <time>] [--granularity <value>]
148
+ ```
149
+
150
+ **auth.** `server` reports `healthy` or `degraded`. Check it first when an integration
151
+ that was working starts behaving oddly a degraded platform explains fail-open
152
+ behaviour on the backend without anything being wrong in the customer's code.
153
+
154
+ `challenge volume` is runtime evidence that the browser/platform half is active. It is
155
+ not proof that the protected backend enforces a blocking decision; the controlled
156
+ negative test in `SKILL.md` provides that evidence. Times are ISO-8601
157
+ (`2026-08-01T00:00:00Z`); `--granularity` takes values such as `hour` or `day`. A
158
+ `challenge_count` of zero after the user has exercised the endpoint means the browser
159
+ half is not firing — that is a browser-side bug, not a backend one, so start with the
160
+ mode's reference file.
161
+
162
+ ## Billing
163
+
164
+ ```bash
165
+ requestshield get billing <app-key>
166
+ ```
167
+
168
+ **auth.** Current plan and usage for the explicitly selected application. Read-only;
169
+ surface it when the user asks about cost or limits.
170
+
171
+ ## Agent integration
172
+
173
+ ```bash
174
+ requestshield agent setup
175
+ requestshield agent setup --agent claude
176
+ requestshield agent setup --agent codex
177
+ ```
178
+
179
+ Local setup. Installs this skill for the named agent. With no `--agent`, the CLI detects
180
+ which agent is in use. Run it when the user wants the skill available in another repo or
181
+ for the other agent; it is the supported alternative to copying files by hand. It should
182
+ not require a RequestShield App Key or API Secret, and it must not create, rotate, or
183
+ deactivate customer credentials.