@vectros-ai/cli 0.5.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/AUTHORING.md ADDED
@@ -0,0 +1,241 @@
1
+ # Authoring Vectros blueprints
2
+
3
+ A **blueprint** is a versioned, reviewed bundle for one use case: a schema set
4
+ + a **least-privilege** AccessProfile + a service principal + optional seed
5
+ data, all with stable identifiers so applying it twice converges instead of
6
+ duplicating. `vectros bootstrap --blueprint <file>` applies it to provision a
7
+ ready-to-use data model + a narrow `ssk_*` scoped key — no root key, no manual
8
+ admin steps.
9
+
10
+ This guide is the authoring loop. Everything here except `bootstrap` is
11
+ **creds-free and offline** — you can iterate on a blueprint with no account.
12
+
13
+ > The examples use the bare `vectros` binary — install it once with
14
+ > `npm i -g @vectros-ai/cli`, or prefix any command with `npx -y @vectros-ai/cli`
15
+ > (no install, but slower per call — fine for a one-off, tedious for the loop).
16
+
17
+ ## The loop
18
+
19
+ ```
20
+ vectros blueprint init my-thing # 1. scaffold a starter
21
+ # …edit ./my-thing.blueprint.yaml…
22
+ vectros blueprint validate ./my-thing.blueprint.yaml # 2. structural + scope-gate + lint (offline)
23
+ vectros blueprint plan ./my-thing.blueprint.yaml # 3. preview what it provisions (offline)
24
+ vectros blueprint-test ./my-thing.blueprint.yaml --env staging # 4. prove it live (creds; auto-teardown)
25
+ vectros bootstrap --blueprint ./my-thing.blueprint.yaml # 5. apply for real (needs a bridge token)
26
+ ```
27
+
28
+ Steps 1–3 are **creds-free and offline**. Step 4 (`blueprint-test`) and step 5 (`bootstrap`) hit a live
29
+ environment — sign in once first with `vectros login` (`vectros whoami` shows the active session;
30
+ `vectros logout` clears it), or pass `--token`.
31
+
32
+ ### 1. `init` — scaffold
33
+
34
+ ```
35
+ vectros blueprint init my-thing # → ./my-thing.blueprint.yaml (commented template)
36
+ vectros blueprint init my-tasks --from task-management # copy the closest bundled exemplar
37
+ vectros blueprint init my-thing --out ./bp.yaml --force # custom path / overwrite
38
+ ```
39
+
40
+ The default scaffold is a heavily-commented YAML starter — the comments *are*
41
+ the docs. `--from <bundled>` copies a real bundled blueprint (run
42
+ `vectros blueprint list` to see them) so you start from a working example.
43
+ A name must be 2–50 chars: a lowercase letter, then lowercase letters / digits
44
+ / dashes (it's the stable idempotency key).
45
+
46
+ ### 2. `validate` — the inner-loop check (no creds)
47
+
48
+ `validate` runs three layers and exits non-zero on any failure:
49
+
50
+ 1. **Structural** — the file parses against the blueprint schema (readable
51
+ `path: message` errors, e.g. `schemas[0].fields[1]: Required`).
52
+ 2. **Scope gate** — the requested `allowedActions` are data-plane only. This is
53
+ the trust boundary: control-plane scopes (`keys`, `profiles`,
54
+ `users`, `admin`, …) and the `*` wildcard are **hard-rejected, no override**.
55
+ A forked or hand-written blueprint gets the *identical* gate a bundled one
56
+ does — it can never escalate.
57
+ 3. **Lint** — semantic checks: duplicate `fieldId`, a `lookupField` naming a
58
+ field that doesn't exist, a `seed` for a typeName with no schema (errors);
59
+ `enumValues` on an incompatible type, and the dataScope null-sentinel nudge
60
+ (warnings — they print but don't fail).
61
+
62
+ `validate` accepts a file path **or** a bundled blueprint name.
63
+
64
+ ### 3. `plan` — preview before you mint
65
+
66
+ `plan` validates, then prints a terraform-style preview of exactly what
67
+ `bootstrap` would provision — schemas, context, principal, profile, key, seed —
68
+ **without minting anything**:
69
+
70
+ ```
71
+ Plan for blueprint 'my-thing' (v1.0.0) → context 'mcp':
72
+ + schema 'thing' (2 fields, HYBRID) lookup: [externalId]
73
+ + context 'mcp' (MCP — my-thing)
74
+ + principal 'my-thing-sp' (SERVICE)
75
+ + profile scopes [records:r, records:c, records:u, search:r, schemas:r] (data-plane ✓)
76
+ + key my-thing-<machine> (mint 1 scoped ssk_*)
77
+ + seed 1 record(s)
78
+ ```
79
+
80
+ `bootstrap` shows the same plan and asks for confirmation before minting
81
+ (`--yes` skips the prompt for CI/agents; `--print` previews without minting).
82
+
83
+ ### 4. `blueprint-test` — prove it live, then clean up (needs creds)
84
+
85
+ `validate`/`plan` are static; `blueprint-test` is the live proof. It **applies** the blueprint to a real
86
+ environment, **asserts** the result — the app-context + every schema read back, and the freshly minted
87
+ `ssk_*` authenticates as a scoped key carrying exactly the actions you requested — then **tears down**
88
+ everything it created:
89
+
90
+ ```
91
+ vectros login # sign in once (or pass --token)
92
+ vectros blueprint-test ./my-thing.blueprint.yaml --env staging
93
+ vectros blueprint-test task-management --keep # leave the graph in place to inspect it
94
+ ```
95
+
96
+ Teardown is the default and runs even if an assertion fails. It is **created-only** — a pre-apply
97
+ snapshot means it never deletes a schema or AccessProfile that already existed, so it's safe to point at
98
+ a shared staging tenant. (It does **not** delete the app-context: that's idempotent and reused.) Exit
99
+ `0` = applied + every assertion passed; `1` = an assertion failed or apply errored; `2` = no credential,
100
+ or the blueprint asked for control-plane scope (the same gate `validate` enforces). Run this before you
101
+ ship a blueprint — it catches an unusable or mis-scoped credential that the offline checks can't.
102
+
103
+ ## The format, field by field
104
+
105
+ ```yaml
106
+ name: my-thing # stable id + idempotency key. Re-running NEVER duplicates.
107
+ version: 1.0.0
108
+ description: One line describing what this blueprint provisions.
109
+ contextId: mcp # 3-31 chars, lowercase-start. The app-context the key binds to.
110
+
111
+ schemas:
112
+ - typeName: thing # immutable after first apply
113
+ displayName: Thing
114
+ indexMode: HYBRID # HYBRID (default) | SEMANTIC | TEXT
115
+ fields:
116
+ - fieldId: title
117
+ fieldType: string # string | number | boolean | date | enum | array | object | reference
118
+ required: true
119
+ searchable: true # contributes to full-text + semantic search
120
+ filterable: false # available as a query filter
121
+ validation: { minLength: 1, maxLength: 200 } # server-enforced (ValidationRules)
122
+ renderHints: { label: Title, widget: text, order: 1, displayField: true } # UI hints (displayField = the headline column)
123
+ - fieldId: externalId
124
+ fieldType: string
125
+ required: true
126
+ lookupFields: [title] # extra O(1) exact-match lookup indexes (max 10);
127
+ # object form { fieldName, unique?, rangeEnabled?,
128
+ # sortBy?, allowOverflow? } for constraints/range.
129
+ # externalId has a built-in finder — don't list it.
130
+ capabilities: { auditHistory: true } # default true; surfaced for a self-documenting audit posture
131
+
132
+ accessProfile:
133
+ allowedActions: [records:r, records:c, records:u, search:r, schemas:r]
134
+ # dataScope binds the key to specific owners. Include `null` to ALSO grant
135
+ # tenant-level (shared) records — without it the key sees ONLY the listed
136
+ # owners' records, not shared/seed data:
137
+ # dataScope: { orgId: [<org-uuid>, null] }
138
+
139
+ servicePrincipal:
140
+ externalId: my-thing-sp # stable; the principal the profile + key bind to
141
+ displayName: My Thing
142
+
143
+ seed:
144
+ - typeName: thing
145
+ externalId: seed-welcome # stable → idempotent; re-apply converges
146
+ fields: { title: "Hello" }
147
+ ```
148
+
149
+ YAML or JSON are both accepted (chosen by extension). The bundled library is
150
+ authored in TypeScript; YAML is the authoring affordance for your own.
151
+
152
+ ### Choosing lookup indexes — a permanent decision
153
+
154
+ `lookupFields` are how you reach records *directly* — by exact value, by an
155
+ ordered range, by prefix — without running a search. The shape you give each one
156
+ is **migration-locked**: once a schema is live, you cannot change a lookup field's
157
+ index shape, *even by removing and re-adding the field* (the platform answers
158
+ "use a new field name for different range behavior"). So decide deliberately,
159
+ before customers build on the schema. Three knobs, each permanent:
160
+
161
+ - **Equality vs. `rangeEnabled`.** Default is **equality** — exact match, and the
162
+ right choice for ids, foreign keys, status enums, and categories (you want
163
+ "all records with `status = new`", not a range of statuses). Set
164
+ **`rangeEnabled: true`** only for values you query as an *order* — dates,
165
+ sequence numbers, scores, versions — to get `from`/`to`/`prefix` queries
166
+ ("created in 2026-06", "due this week"). Range lookups are billed at the
167
+ range-index rate.
168
+ - *Watch the ordering:* range/prefix order is **lexical**. ISO-8601 dates sort
169
+ chronologically (safe). An ordinal **enum** like `priority: low|…|urgent`
170
+ sorts alphabetically (`high < low < medium < urgent`) — **not** by severity —
171
+ so leave ordinal enums as equality, or model them as numbers.
172
+
173
+ - **The 7-slot equality budget.** Each schema has **7 fast equality-lookup
174
+ slots**. Equality lookups consume them in declaration order; the ownership ids
175
+ and `externalId` ride their own first-class slots and do **not** count.
176
+ `rangeEnabled` lookups use a relationship row instead of a slot, so they don't
177
+ count against the 7 either. An 8th equality lookup is **rejected** unless you
178
+ set `allowOverflow: true` on it, which accepts a higher-cost secondary index.
179
+ Keep equality lookups lean.
180
+
181
+ - **`sortBy` — the order results come back in.** For an *equality* lookup,
182
+ `sortBy` sets the listing order: `createdAt` (default), `lastUpdated`, or a
183
+ declared field. *Trap:* sorting by an **optional** payload field silently drops
184
+ records that don't have it from that lookup — and it's locked. Use `createdAt`/
185
+ `lastUpdated` (always present) unless every record is guaranteed to carry the
186
+ field.
187
+
188
+ **Sensitive fields can still be looked up — by exact match only.** A
189
+ `sensitive` field is HMAC'd into a per-tenant **blind index**, so you *can* list
190
+ it in `lookupFields` for exact find-by-value (e.g. find an intake by client name)
191
+ without the value ever being stored in the clear or entering the search index. A
192
+ blind hash is not orderable, so a sensitive lookup **cannot** be `rangeEnabled`,
193
+ and no lookup's `sortBy` may name a sensitive field (the platform rejects both).
194
+
195
+ ### Reference fields — typed links between record types
196
+
197
+ A `reference` field is a foreign key to another record. It needs **both** the
198
+ target type and the surface it lives on (the same `typeName` can exist on more
199
+ than one surface, so the surface disambiguates which lookup resolves the link):
200
+
201
+ ```yaml
202
+ - fieldId: establishedByDecision
203
+ fieldType: reference
204
+ targetTypeName: decision # the typeName it points at
205
+ targetSurface: record # record | document | user | org | client (REQUIRED)
206
+ targetField: externalId # the target's UNIQUE lookup to match (defaults to externalId)
207
+ cardinality: one # one (a single id) | many (an array of ids)
208
+ ```
209
+
210
+ The link resolves within the same context, and the target must **exist when the
211
+ referencing record is written** (write-time existence is enforced by default) —
212
+ so if you seed a referencing record, seed its target first. To query "which X
213
+ reference Y", add the reference field to `lookupFields` as an equality lookup
214
+ (there is no reverse-reference index on this surface).
215
+
216
+ ### The scope gate — what you can and can't request
217
+
218
+ The gate allows only **data-plane** resources:
219
+ `records`, `schemas`, `search`, `documents`, `folders`, `inference`.
220
+ Operations are `c|r|u|d`, combinable (`records:cru`), with a per-resource
221
+ wildcard (`records:*`). Anything else — control-plane resources or the bare
222
+ `*` — is rejected, and there is **intentionally no override flag**. This is
223
+ *why* it's safe to apply a blueprint you didn't write: the binary is the trust
224
+ boundary, not the file.
225
+
226
+ ### The idempotency contract
227
+
228
+ Re-applying a blueprint **converges, never duplicates**, because everything has
229
+ a stable id: `name` (the blueprint), `typeName` (schemas), the service
230
+ principal's `externalId`, the per-machine key name, and each seed record's
231
+ `externalId`. Bump `version` when you evolve a blueprint. (Note: schema
232
+ `typeName` is immutable after first apply.)
233
+
234
+ ## Distribution
235
+
236
+ - **Bundled** — reviewed, versioned blueprints shipped in the library
237
+ (`vectros blueprint list`). Apply by name: `--blueprint task-management`.
238
+ - **Local / file** — your own, applied by path: `--blueprint ./my-thing.yaml`.
239
+ The "copy & own" path. Same scope gate, no new trust surface.
240
+
241
+ Apache-2.0
package/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@vectros-ai/cli` are documented here.
4
+ This project adheres to [Semantic Versioning](https://semver.org).
5
+
6
+ ## 0.5.0 — 2026-06-20
7
+
8
+ Initial public release of the `vectros` provisioning CLI.
9
+
10
+ ### Added
11
+
12
+ - `vectros bootstrap` — provision a least-privilege MCP credential (a scoped
13
+ `ssk_*` key plus its matching data-plane AccessProfile, and optionally a
14
+ blueprint) in one command, without your root key.
15
+ - `vectros blueprint` — author and inspect blueprints offline (`init`,
16
+ `validate`, `plan`, `list`); no credentials required.
17
+ - `vectros blueprint-test` — apply a blueprint to a live environment, assert it
18
+ provisioned a working credential, then tear it down.
19
+ - PKCE browser login and a documented verb catalog. Every command supports
20
+ `--help`; the authoring loop is documented in `AUTHORING.md`.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Vectros
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # @vectros-ai/cli
2
+
3
+ The Vectros provisioning CLI — the `vectros` binary. Two command groups:
4
+
5
+ - **`vectros bootstrap`** — provision a least-privilege MCP credential (+ optional blueprint).
6
+ - **`vectros blueprint`** — author + inspect blueprints (`init` / `validate` / `plan` / `list`), creds-free.
7
+ - **`vectros blueprint-test`** — apply a blueprint to a live env, assert it provisioned a working credential, then tear it down.
8
+
9
+ ```bash
10
+ npx -y @vectros-ai/cli bootstrap # provision a credential
11
+ npx -y @vectros-ai/cli blueprint --help # the authoring commands
12
+ ```
13
+
14
+ Every command has `--help`. The authoring loop is documented in
15
+ [AUTHORING.md](./AUTHORING.md).
16
+
17
+ ## `vectros bootstrap`
18
+
19
+ Provisions a **least-privilege** Vectros credential for the
20
+ [`@vectros-ai/mcp-server`](https://www.npmjs.com/package/@vectros-ai/mcp-server)
21
+ in one command — **without your root key** and without manual admin-app steps.
22
+ It:
23
+
24
+ - mints a scoped key (`ssk_*`) for **this machine** (independently rotatable),
25
+ - creates the matching AccessProfile — **data-plane only**,
26
+ - optionally scaffolds a use-case **blueprint** (e.g. `task-management`: a
27
+ schema + seed data), and
28
+ - safe-merges the `vectros` server entry into your MCP client config
29
+ (`claude_desktop_config.json` — Claude Desktop, Cursor, Cline), backing up
30
+ the original first. Pass `--client code` to target **Claude Code** instead:
31
+ it merges the project `.mcp.json` and prints the equivalent `claude mcp add`
32
+ command.
33
+
34
+ ```bash
35
+ # Interactive — pick a blueprint (or a blank read-only credential), sign in once.
36
+ npx -y @vectros-ai/cli bootstrap
37
+
38
+ # Scripted / agent — token in the env, no prompts.
39
+ VECTROS_BOOTSTRAP_TOKEN=… npx -y @vectros-ai/cli bootstrap \
40
+ --blueprint task-management --yes
41
+
42
+ # Login once, then bootstrap unattended — no token needed; --yes reuses your
43
+ # stored `vectros login` session.
44
+ npx -y @vectros-ai/cli login
45
+ npx -y @vectros-ai/cli bootstrap --blueprint task-management --yes
46
+
47
+ # See every flag.
48
+ npx -y @vectros-ai/cli bootstrap --help
49
+ ```
50
+
51
+ Re-running is idempotent; `--rotate` revokes + re-mints just this machine's key.
52
+
53
+ ## `vectros blueprint` — authoring (creds-free)
54
+
55
+ Author and inspect blueprints without an account. You'll run these repeatedly,
56
+ so install once and drop the `npx` prefix (`npm i -g @vectros-ai/cli`, or prefix
57
+ each command with `npx -y @vectros-ai/cli`). The inner loop:
58
+
59
+ ```bash
60
+ vectros blueprint init my-thing # scaffold a commented YAML starter
61
+ # …edit ./my-thing.blueprint.yaml…
62
+ vectros blueprint validate ./my-thing.blueprint.yaml # structural + scope-gate + lint
63
+ vectros blueprint plan ./my-thing.blueprint.yaml # preview what bootstrap would provision
64
+ vectros bootstrap --blueprint ./my-thing.blueprint.yaml # apply it
65
+ ```
66
+
67
+ - `init` — write a starter (`--from <bundled>` copies an exemplar; `--out`, `--force`).
68
+ - `validate` — structural parse → scope gate → linter. Accepts a file **or** a bundled name.
69
+ - `plan` — validate, then a terraform-style preview; mints nothing.
70
+ - `list` — the bundled library.
71
+
72
+ Full guide: [AUTHORING.md](./AUTHORING.md). Format reference:
73
+ [`@vectros-ai/blueprints`](https://www.npmjs.com/package/@vectros-ai/blueprints).
74
+
75
+ ## `vectros blueprint-test` — verify it actually provisions (creds-required)
76
+
77
+ `validate`/`plan` check a blueprint statically; `blueprint-test` proves it
78
+ end-to-end against a live environment. It **applies** the blueprint, **asserts**
79
+ the result (the app-context + each schema are readable back, and the freshly
80
+ minted `ssk_*` authenticates as a scoped key with the requested actions), then
81
+ **tears down** what it created — schemas, the AccessProfile, seed records, and
82
+ the key. Teardown is *created-only*: anything that already existed before the run
83
+ is left untouched, so it's safe to point at a shared staging tenant.
84
+
85
+ ```bash
86
+ # Apply → assert → teardown against staging (sign in first, or pass --token).
87
+ vectros blueprint-test ./my-thing.blueprint.yaml --env staging
88
+
89
+ # Leave the provisioned graph in place to inspect it.
90
+ vectros blueprint-test task-management --keep
91
+ ```
92
+
93
+ Exit `0` = applied and every assertion passed; `1` = an assertion failed or apply
94
+ errored; `2` = no credential, or the blueprint requested control-plane scope.
95
+ The app-context is intentionally **not** deleted (it's idempotent and reused).
96
+
97
+ ## The scope gate (the trust boundary)
98
+
99
+ Blueprints are **untrusted input** (agent- or community-authored) and the
100
+ CLI runs under an elevated ephemeral bridge token. So the trust boundary is
101
+ **this binary, not the blueprint**: a hardcoded **scope gate** bounds every
102
+ mint to a data-plane allowlist (`records` / `schemas` / `search` / `documents`
103
+ / `folders` / `inference`). Any control-plane scope (keys / profiles / users /
104
+ billing / admin) or `*` wildcard **hard-rejects** — the CLI mints nothing and
105
+ exits non-zero. There is intentionally **no override flag**.
106
+
107
+ ## See also
108
+
109
+ - [`@vectros-ai/mcp-server`](https://www.npmjs.com/package/@vectros-ai/mcp-server) — the runtime this CLI provisions for.
110
+ - [`@vectros-ai/blueprints`](https://www.npmjs.com/package/@vectros-ai/blueprints) — the curated use-case library the CLI applies.
111
+
112
+ ## License
113
+
114
+ Apache-2.0. See the LICENSE file.