@sackville-mcp/cli 0.0.1-alpha.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/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 Curtis Autery
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,288 @@
1
+ # @sackville-mcp/cli
2
+
3
+ The Sackville command-line tool — a human entry point over the same engines the
4
+ MCP servers expose. Two surfaces:
5
+
6
+ - **docs search** (`search`/`get`/`versions`/`detect`) over [`@sackville-mcp/core`](../core).
7
+ - **API testing** (`api …`) over [`@sackville-mcp/api`](../api).
8
+
9
+ ## Install / invoke
10
+
11
+ There's no published npm package yet, so run it from the built workspace:
12
+
13
+ ```bash
14
+ pnpm -r build # once (or: pnpm -F @sackville-mcp/cli build)
15
+ node packages/cli/dist/bin.mjs --help
16
+ ```
17
+
18
+ The examples below use `sackville` as shorthand for `node packages/cli/dist/bin.mjs`.
19
+
20
+ ---
21
+
22
+ ## API testing quickstart
23
+
24
+ Sackville runs **Bruno `.bru`** requests from a **collection directory**. Its
25
+ richer assertions and captures live in a sidecar `<request>.sackville.yml` next
26
+ to each `.bru`, so the `.bru` stays 100% Bruno-GUI compatible (ADR 0004).
27
+
28
+ ```
29
+ mycollection/
30
+ bruno.json # optional Bruno collection marker
31
+ get-user.bru # the request
32
+ get-user.sackville.yml # optional: assertions + captures
33
+ environments/Public.bru # optional: {{baseUrl}} and other vars
34
+ ```
35
+
36
+ A ready-to-run sample lives at [`examples/api/jsonplaceholder`](../../examples/api/jsonplaceholder)
37
+ (hits the free, no-auth [JSONPlaceholder](https://jsonplaceholder.typicode.com) API).
38
+
39
+ **1. See what's in a collection:**
40
+
41
+ ```console
42
+ $ sackville api list examples/api/jsonplaceholder
43
+ POST create-post {{baseUrl}}/posts
44
+ GET get-user {{baseUrl}}/users/1
45
+ GET list-posts {{baseUrl}}/posts?userId=1
46
+ ```
47
+
48
+ **2. Inspect one request** (reports the secret *names* a request needs, never values):
49
+
50
+ ```console
51
+ $ sackville api get examples/api/jsonplaceholder get-user
52
+ GET {{baseUrl}}/users/1
53
+ Accept: application/json
54
+ required secrets: (none)
55
+ ```
56
+
57
+ **3. Run it.** `{{baseUrl}}` comes from the `Public` environment, so no flags
58
+ are needed beyond `--env` (or pass `--var baseUrl=https://…` instead):
59
+
60
+ ```console
61
+ $ sackville api run examples/api/jsonplaceholder get-user --env Public
62
+ GET https://jsonplaceholder.typicode.com/users/1
63
+ sent
64
+ status 200 176ms
65
+ PASS status equals
66
+ PASS header contains
67
+ PASS jsonpath exists $.name
68
+ body: sackville://run/<id>/body
69
+ ```
70
+
71
+ Exit code is **0** only when the request was sent *and* every assertion passed
72
+ (and, with `--openapi`, the contract validated) — so it drops straight into CI.
73
+
74
+ **4. Get structured output** for scripts/agents with `--json`:
75
+
76
+ ```console
77
+ $ sackville api run examples/api/jsonplaceholder get-user --env Public --json
78
+ { "request": {…}, "sent": true, "dryRun": false,
79
+ "response": { "status": 200, "assertions": [...], "captured": { "userName": "Leanne Graham" }, … } }
80
+ ```
81
+
82
+ **5. Chain requests** — captures thread forward into later requests' scope:
83
+
84
+ ```console
85
+ $ sackville api run-collection examples/api/jsonplaceholder get-user list-posts --env Public
86
+ get-user 200 PASS
87
+ list-posts 200 PASS
88
+ captured: userName
89
+ ```
90
+
91
+ ### Mutation safety (deny-by-default)
92
+
93
+ `GET`/`HEAD`/`OPTIONS` run freely. Mutating methods (`POST`/`PUT`/`PATCH`/`DELETE`)
94
+ **dry-run** by default — Sackville resolves and shows what *would* be sent, but
95
+ does not fire — and require an explicit unlock: `--unsafe` **plus** a host
96
+ allowlist.
97
+
98
+ ```console
99
+ $ sackville api run examples/api/jsonplaceholder create-post --env Public
100
+ POST https://jsonplaceholder.typicode.com/posts
101
+ dry-run (not sent): POST is a mutating method; dry-run only (pass allowUnsafe to send)
102
+ # exit 1 — nothing was verified
103
+
104
+ $ sackville api run examples/api/jsonplaceholder create-post --env Public \
105
+ --unsafe --allow-host jsonplaceholder.typicode.com
106
+ POST https://jsonplaceholder.typicode.com/posts
107
+ sent
108
+ status 201 …
109
+ PASS status equals
110
+ PASS jsonpath exists $.id
111
+ ```
112
+
113
+ ### Secrets
114
+
115
+ Reference secrets in a `.bru` as `{{secret:NAME}}` (never inline the value).
116
+ Today they resolve from the environment as `SACKVILLE_SECRET_<NAME>`; a missing
117
+ secret **fails closed**, and resolved values are redacted from every result
118
+ (request, headers, body) — including base64/url encodings. (Keyring-backed
119
+ storage is a scheduled opt-in.)
120
+
121
+ ```bash
122
+ SACKVILLE_SECRET_API_TOKEN=… sackville api run mycollection authed-request --env Public
123
+ ```
124
+
125
+ ### Contract validation
126
+
127
+ ```bash
128
+ # Validate a live exchange against an OpenAPI 3.1 spec in one shot — BOTH the
129
+ # response AND the sent request's body/params (the request check runs even on a
130
+ # withheld dry-run):
131
+ sackville api run mycollection get-user --env Public --openapi openapi.json
132
+
133
+ # Validate a live GraphQL run's query + variables against the SDL:
134
+ sackville api run mycollection gql-search --env Public --graphql schema.graphql
135
+
136
+ # Offline GraphQL drift check (no request sent): does a saved query still
137
+ # conform to the current schema? With --variables, also type-check the variables.
138
+ sackville api validate --graphql schema.graphql --query query.graphql --variables '{"id":5}'
139
+
140
+ # Preflight a REQUEST (body + params) against an OpenAPI 3.1 operation, no send:
141
+ # (scalar; array params [query form/space/pipe + path/header]; object params
142
+ # [deepObject + form/explode=false]; ambiguous serializations skip-not-fail — ADR 0016)
143
+ sackville api validate-request --openapi openapi.json --method POST --path /widgets \
144
+ --body new-widget.json --query limit=10
145
+
146
+ # Validate the traffic in a captured HAR against a contract (no request re-run):
147
+ sackville api validate-capture run.har.zip --openapi openapi.json
148
+ ```
149
+
150
+ ### Command reference
151
+
152
+ ```
153
+ sackville api list <dir>
154
+ sackville api get <dir> <name>
155
+ sackville api run <dir> <name> [--var k=v]… [--env <e>] [--unsafe] [--allow-host <h>]… [--openapi <spec.json>] [--graphql <schema>] [--json]
156
+ sackville api run-collection <dir> <name>… [--var k=v]… [--env <e>] [--unsafe] [--allow-host <h>]… [--stop-on-failure] [--json]
157
+ sackville api validate --graphql <schema> --query <query> [--variables <json|file>] [--json]
158
+ sackville api validate-request --openapi <spec.json> --method <M> --path </p> [--body <file>] [--query k=v]… [--header n:v]… [--json]
159
+ sackville api validate-capture <har.zip> [--openapi <spec.json>] [--graphql <schema>] [--graphql-endpoint </p>] [--json]
160
+ ```
161
+
162
+ `<name>` is the `.bru` file stem (e.g. `get-user` for `get-user.bru`).
163
+
164
+ ---
165
+
166
+ ## Browser testing
167
+
168
+ Single-shot page inspection over a real headless Chromium. Each command navigates
169
+ once and reads, then tears the browser down — so it's a quick human probe, not the
170
+ stateful agent surface (that's `sackville-browser-mcp`). Every request is fronted by
171
+ a **mandatory DNS-pinning SSRF proxy**; navigation is allowed only to the host you
172
+ typed (auto-allowed as explicit operator intent) plus any `--allow-host`.
173
+
174
+ ```bash
175
+ # The ARIA snapshot (with [ref=…] ids) of a page:
176
+ $ sackville browser snapshot https://example.com
177
+
178
+ # Accessibility audit — prints a summary + the full report path; exits 1 if any
179
+ # violations (usable as a CI gate):
180
+ $ sackville browser audit https://example.com
181
+
182
+ # Save a PNG screenshot:
183
+ $ sackville browser screenshot https://example.com --out shot.png
184
+
185
+ # Inspecting a local dev server (loopback) needs --allow-private; sandboxed
186
+ # environments may need --no-sandbox:
187
+ $ sackville browser snapshot http://127.0.0.1:3000 --allow-private --no-sandbox
188
+ ```
189
+
190
+ ### Replaying a persisted flow
191
+
192
+ A **flow** is a Bruno-openable `<name>.bru` (meta) + a `<name>.sackville.yml`
193
+ sidecar holding ordered `steps` keyed by semantic locators (role + accessible
194
+ name), not ephemeral snapshot refs — so it replays stably. See
195
+ [`examples/browser/login`](../../examples/browser/login). The flow drives its own
196
+ navigations, so allowlist each target host with `--allow-host`; mutations
197
+ (`click`/`fill`/…) **dry-run** unless `--unsafe`. `{{var}}` comes from `--var`;
198
+ `{{secret:NAME}}` from `SACKVILLE_BROWSER_SECRET_<NAME>` (redacted from output).
199
+ Exits non-zero on any step error or failed assertion (a CI gate).
200
+
201
+ ```bash
202
+ $ SACKVILLE_BROWSER_SECRET_PASSWORD=hunter2 \
203
+ sackville browser run examples/browser/login/login.bru \
204
+ --var baseUrl=https://app.example.com --var username=alice \
205
+ --allow-host app.example.com --unsafe
206
+ ```
207
+
208
+ ### Command reference
209
+
210
+ ```
211
+ sackville browser snapshot <url> [--allow-host <h>]… [--allow-private] [--no-sandbox] [--headed] [--json]
212
+ sackville browser audit <url> [same flags] # exit 1 on a11y violations
213
+ sackville browser screenshot <url> [--out <file>] [--full-page] [same flags]
214
+ sackville browser run <flow.bru> [--var k=v]… [--unsafe] [--allow-host <h>]… [same flags] # exit 1 on failure
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Verification (Phase-4 pillars)
220
+
221
+ Thin human wrappers over the cross-cutting verification engines. You are the
222
+ operator, so the run/write gates are straight-through flags (`--allow-run`,
223
+ `--allow-quarantine`) — a denied run never spawns. `audit`/`uncovered-in-diff`
224
+ exit non-zero on a finding, so they double as CI gates.
225
+
226
+ ```bash
227
+ # Mutation testing — view a report, or run Stryker (gated):
228
+ sackville mutate summarize reports/mutation/mutation.json
229
+ sackville mutate summarize results.txt --format mutmut
230
+ sackville mutate run . --allow-run --file src/changed.ts --incremental
231
+
232
+ # Coverage — the forgotten-assertion catch (exit 1 when a new line is uncovered):
233
+ sackville coverage uncovered-in-diff --diff changes.diff --coverage coverage-final.json --project-root .
234
+ sackville coverage run-scoped . --changed-file src/changed.ts --diff changes.diff --allow-run
235
+
236
+ # Flaky-test detection over a run-history DB (--db / SACKVILLE_FLAKE_DB):
237
+ sackville flake ingest report.json --db flake.db --format vitest
238
+ sackville flake status --db flake.db
239
+ sackville flake candidates --db flake.db
240
+ sackville flake run . --db flake.db --repeat 10 --allow-run
241
+ sackville flake quarantine 'src/x.test.ts > flaky case' --db flake.db \
242
+ --reason 'intermittent timeout' --expires-at 2026-07-01T00:00:00Z \
243
+ --allow-quarantine --max-expiry-ms 2592000000
244
+
245
+ # Dependency intelligence for the INSTALLED version (exit 1 on a finding):
246
+ sackville deps audit . lodash --osv-db /var/lib/sackville/osv
247
+ sackville deps audit-project . --osv-db /var/lib/sackville/osv
248
+ sackville deps changelog lodash --project . --to 4.17.21
249
+
250
+ # Semantic code navigation via a real Language Server (single-shot; gated).
251
+ # --servers (or SACKVILLE_LSP_SERVERS) binds the operator language→server registry;
252
+ # navigation needs --allow-run, rename writes only with --allow-write (else dry-run):
253
+ export SACKVILLE_LSP_SERVERS='{"typescript":{"command":"typescript-language-server","args":["--stdio"]}}'
254
+ sackville lsp languages
255
+ sackville lsp definition typescript src/app.ts 42 8 --project . --allow-run
256
+ sackville lsp references typescript src/app.ts 42 8 --project . --allow-run
257
+ sackville lsp symbols typescript src/app.ts --project . --allow-run
258
+ sackville lsp workspace-symbols typescript MyClass src/app.ts --project . --allow-run # project-wide search; trailing file anchors the project (tsserver needs it)
259
+ sackville lsp diagnostics typescript src/app.ts --project . --allow-run # errors/warnings (push model; empty = clean; exit 2 = still indexing)
260
+ sackville lsp definition typescript packages/a/src/x.ts 4 14 --project packages/a --workspace-root packages/b --allow-run # multi-root: bind both packages on one server
261
+ sackville lsp rename typescript src/app.ts 42 8 newName --project . --allow-run # dry-run preview
262
+ sackville lsp rename typescript src/app.ts 42 8 newName --project . --allow-run --allow-write # writes to disk
263
+ ```
264
+
265
+ `lsp` exit codes: `0` the query ran, `1` denied/refused/error, `2` the server is
266
+ still indexing (retry). A result `status` is tri-state (`ok`/`not_ready`/`no_result`);
267
+ `rename` is dry-run unless `--allow-write`, and `applied` in the result says whether
268
+ the edit was written.
269
+
270
+ `audit`/`audit-project` report `osvSnapshotLoaded` — without an operator OSV
271
+ snapshot, "no known vulnerabilities" is unknown, not clean. The deps CLI fetches
272
+ package metadata behind the same DNS-pinning SSRF pre-flight the bins use (private
273
+ registries gated by `--allow-private`).
274
+
275
+ ---
276
+
277
+ ## Docs search
278
+
279
+ ```bash
280
+ sackville search <query…> [-l <lib>] [--version <v>] [--installed <v>] [-p <dir>] [--ecosystem <e>] [--type <t>] [--limit <n>] [--json]
281
+ sackville get <id> [--json]
282
+ sackville versions <library>
283
+ sackville detect <project> <library> [--ecosystem <node|python|ruby>]
284
+
285
+ # Global: -i/--index <file> (or set SACKVILLE_INDEX) — the SQLite index to query.
286
+ ```
287
+
288
+ See [`packages/mcp`](../mcp) for building an index and the agent-facing MCP servers.
package/dist/bin.d.mts ADDED
@@ -0,0 +1 @@
1
+ export { };
package/dist/bin.mjs ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ import { t as run } from "./src-DM4aqvlX.mjs";
3
+ import { QueryEmbedder } from "@sackville-mcp/embed";
4
+ //#region src/bin.ts
5
+ const code = await run(process.argv.slice(2), {
6
+ out: (s) => process.stdout.write(s),
7
+ err: (s) => process.stderr.write(s),
8
+ embedder: new QueryEmbedder(),
9
+ env: process.env
10
+ });
11
+ process.exit(code);
12
+ //#endregion
13
+ export {};
14
+
15
+ //# sourceMappingURL=bin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.mjs","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { QueryEmbedder } from '@sackville-mcp/embed'\nimport { run } from './index.js'\n\nconst code = await run(process.argv.slice(2), {\n out: (s) => process.stdout.write(s),\n err: (s) => process.stderr.write(s),\n embedder: new QueryEmbedder(),\n env: process.env,\n})\nprocess.exit(code)\n"],"mappings":";;;;AAIA,MAAM,OAAO,MAAM,IAAI,QAAQ,KAAK,MAAM,CAAC,GAAG;CAC5C,MAAM,MAAM,QAAQ,OAAO,MAAM,CAAC;CAClC,MAAM,MAAM,QAAQ,OAAO,MAAM,CAAC;CAClC,UAAU,IAAI,cAAc;CAC5B,KAAK,QAAQ;AACf,CAAC;AACD,QAAQ,KAAK,IAAI"}
@@ -0,0 +1,15 @@
1
+ import { Embedder } from "@sackville-mcp/embed";
2
+
3
+ //#region src/index.d.ts
4
+ /** Output sinks and dependencies injected into `run` (so it is testable). */
5
+ interface CliIO {
6
+ out: (text: string) => void;
7
+ err: (text: string) => void;
8
+ /** When present, queries are embedded for hybrid search. */
9
+ embedder?: Embedder;
10
+ env?: Record<string, string | undefined>;
11
+ }
12
+ declare function run(argv: string[], io: CliIO): Promise<number>;
13
+ //#endregion
14
+ export { CliIO, run };
15
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;UAsBiB,KAAA;EACf,GAAA,GAAM,IAAA;EACN,GAAA,GAAM,IAAA;;EAEN,QAAA,GAAW,QAAA;EACX,GAAA,GAAM,MAAM;AAAA;AAAA,iBA0DQ,GAAA,CAAI,IAAA,YAAgB,EAAA,EAAI,KAAA,GAAQ,OAAO"}
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { t as run } from "./src-DM4aqvlX.mjs";
2
+ export { run };