lockpicks 0.3.0 → 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.
Files changed (3) hide show
  1. package/README.md +47 -10
  2. package/dist/lockpick.mjs +17942 -13430
  3. package/package.json +4 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # lockpicks
2
2
 
3
- Read your Lockpick results from the terminal, and give coding agents the same access over MCP: sites, scans, findings, repair briefs and recheck comparisons. If you allow it, the CLI and agents can also run a free quick check, add a site, start a Pulse check, check a DNS finding again and prepare a Deep scan that you approve in Lockpick. Pentests only start in the Lockpick web app, and the CLI never cancels or deletes anything.
3
+ Read your Lockpick results from the terminal, and give coding agents the same access over MCP: sites, scans, findings, repair briefs and recheck comparisons. If you allow it, the CLI and agents can also run a free quick check, add a site, start a Pulse scan, check a DNS finding again and prepare a Deep scan that you approve in Lockpick. Master Key scans only start in the Lockpick web app, and the CLI never cancels or deletes anything.
4
4
 
5
5
  ## Sign in
6
6
 
@@ -8,7 +8,7 @@ Read your Lockpick results from the terminal, and give coding agents the same ac
8
8
  npx lockpicks login --host https://<your-lockpick>
9
9
  ```
10
10
 
11
- The browser opens a device page. Confirm the code, pick a workspace and approve. To let the key start Pulse checks, tick **Start Pulse checks** under **Extra permissions**; that box is your statement that you own the workspace's sites or may test them, and each Pulse started with the key is recorded under your name. Without it the key only reads. **Add sites and switch your free site** lets the key add sites (`lockpick sites add`). **Start Deep scans after you prove you own the site and approve each one** lets the key prepare Deep scans (`lockpick deep`); each still needs a verified ownership proof and your approval of that exact scan in Lockpick. `lockpick login --pulse --sites --deep` marks what the terminal asks for, but the browser never ticks anything for you and the key gets exactly what you tick. `lockpick whoami` shows what the key can do. The terminal receives a key bound to that workspace, stored in your OS keychain (or `~/.config/lockpick/config.json`, mode 0600, when no keychain is available). Each use extends the key; an idle key expires after the workspace's lifetime (30 days by default). Revoke it with `lockpick logout` or in the web app under **Workspace settings → CLI & agent access**.
11
+ The browser opens a device page. Confirm the code, pick a workspace and approve. To let the key start Pulse scans, tick **Start Pulse scans on sites I own or may test** under **Also allow**; that box is your statement that you own the workspace's sites or may test them, and each Pulse started with the key is recorded under your name. Without it the key only reads. **Add and switch sites** lets the key add sites (`lockpick sites add`) and switch your free site. **Prepare Deep scans I approve** lets the key prepare Deep scans (`lockpick deep`); each still needs a verified ownership proof and your approval of that exact scan in Lockpick. `lockpick login --pulse --sites --deep` marks what the terminal asks for, but the browser never ticks anything for you and the key gets exactly what you tick. `lockpick whoami` shows what the key can do. The terminal receives a key bound to that workspace, stored in your OS keychain (or `~/.config/lockpick/config.json`, mode 0600, when no keychain is available). Each use extends the key; an idle key expires after the workspace's lifetime (30 days by default). Revoke it with `lockpick logout` or in the web app under **Workspace settings → CLI & agent access**.
12
12
 
13
13
  After an `npx` login, the CLI offers to install itself so you can type `lockpick` (or `lockpicks`) instead of `npx lockpicks`. To do it yourself:
14
14
 
@@ -18,7 +18,7 @@ npm install -g lockpicks
18
18
 
19
19
  With it installed, `lockpick mcp config` points agents at `lockpick mcp`; without it, at `npx -y lockpicks mcp`.
20
20
 
21
- Use HTTPS for a remote Lockpick host. HTTP is accepted for local network and Tailscale development hosts. The CLI refuses redirects during API calls so a saved key stays on its selected host. `--host` takes precedence over `LOCKPICK_HOST`, which takes precedence over the last login. Each host has its own saved profile; `lockpick logout --host <url>` revokes and removes only that host's key. When the OS keychain is unavailable, the CLI writes the config through a private temporary file and replaces the old file only after the new one is complete. If the config is damaged, repair it before logging in again; the CLI will not silently discard saved profiles.
21
+ Use HTTPS for a remote Lockpick host; a host without a scheme (`lockpick.app`) means HTTPS, and a local one (`studio-mac:3000`) means HTTP. HTTP is accepted for local network and Tailscale development hosts. The CLI never follows redirects during API calls, so a saved key stays on its selected host: when a host only moves to its canonical address (`lockpick.app` to `www.lockpick.app`), `login`, which sends no key, signs in there and saves that address, and every other command names the address to use. `--host` takes precedence over `LOCKPICK_HOST`, which takes precedence over the last login. Each host has its own saved profile; `lockpick logout --host <url>` revokes and removes only that host's key. When the OS keychain is unavailable, the CLI writes the config through a private temporary file and replaces the old file only after the new one is complete. If the config is damaged, repair it before logging in again; the CLI will not silently discard saved profiles.
22
22
 
23
23
  ## Commands
24
24
 
@@ -26,24 +26,24 @@ Use HTTPS for a remote Lockpick host. HTTP is accepted for local network and Tai
26
26
  | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
27
27
  | `lockpick whoami` | The user, workspace and key this terminal uses |
28
28
  | `lockpick doctor` | Checks Node.js, the selected host, connection, key, workspace and agent API without starting a scan |
29
- | `lockpick projects` | Projects with their latest Pulse and pentest |
29
+ | `lockpick projects` | Projects with their latest Pulse and box |
30
30
  | `lockpick status [project]` | One project's report, or an overview of all of them |
31
- | `lockpick runs` | Pulse assessments and pentests, newest first |
31
+ | `lockpick runs` | Pulse assessments and boxs, newest first |
32
32
  | `lockpick run <runId>` | One run: status, open findings, coverage and limits |
33
33
  | `lockpick watch <runId>` | Follows a run until it finishes |
34
34
  | `lockpick check <url>` | A free quick check of a website's homepage and public DNS; needs no site (key allowed to start Pulses) |
35
- | `lockpick sites` | Sites with their latest Pulse and pentest |
35
+ | `lockpick sites` | Sites with their latest Pulse and box |
36
36
  | `lockpick sites add <url>` | Adds a site you own or may test (key allowed to add sites); adding does not scan it |
37
37
  | `lockpick sites switch <site> --yes` | Removes the site holding this month's free Pulse so another site can use it (key allowed to add sites and start Pulses); `--check <id>` also starts a Pulse on that quick check's site |
38
38
  | `lockpick pulse <project>` | Starts a Pulse (a recheck of the latest one when possible) and waits for the result |
39
- | `lockpick recheck <site>` | A full recheck: a new Pulse that uses one free Pulse or 1 credit, then waits for it |
39
+ | `lockpick recheck <site>` | A full recheck: a new Pulse that uses one Pulse scan from the allowance, then waits for it |
40
40
  | `lockpick recheck <runId> --dns <id>` | Free: reads the public DNS records behind one DNS finding again; never contacts the site and never changes the grade |
41
41
  | `lockpick deps <site>` | Sends this folder's package names and exact versions (never code) to a site and lists the advisories that affect them (key allowed to add sites); `--dry-run` shows what would be sent, `--forget` removes the list |
42
42
  | `lockpick verify <site>` | Verifies you own a site once: the site's value and where to publish it (`--method dns`, `file` or `meta`); `--wait` looks for it for about five minutes |
43
43
  | `lockpick deep verify <site>` | The same proof, under `deep` |
44
44
  | `lockpick deep check <site> <id>` | Looks once for the published proof; each check uses one of its attempts |
45
45
  | `lockpick deep prepare <site> <id>` | Prepares a Deep scan with a verified proof and opens its approval page; nothing starts until you approve |
46
- | `lockpick deep start <operationId>` | Starts the Deep scan you approved (one free Deep scan or 10 credits) and waits for it |
46
+ | `lockpick deep start <operationId>` | Starts the Deep scan you approved (one Deep scan from the allowance) and waits for it |
47
47
  | `lockpick findings <runId>` | Findings that need attention (`--all` for informational ones) |
48
48
  | `lockpick finding <runId> <findingId>` | One finding with its evidence |
49
49
  | `lockpick brief <runId>` | One brief that fixes everything needing attention (`--finding <id>` for one finding, `--agent <name>` to tailor it, `--out brief.md` to save it) |
@@ -51,16 +51,22 @@ Use HTTPS for a remote Lockpick host. HTTP is accepted for local network and Tai
51
51
  | `lockpick compare <runId>` | What a Pulse recheck changed against its baseline |
52
52
  | `lockpick open <id>` | Opens a run or project in the browser |
53
53
  | `lockpick skills` | Adds the Lockpick skills to your coding agent (`npx skills add`) |
54
+ | `lockpick docs [words]` | Searches the Lockpick docs from the terminal, or lists the CLI guides (`--open` opens the best match) |
55
+ | `lockpick ci init <site>` | Writes `.github/workflows/lockpick.yml`: a Pulse on each published release and on demand that fails on `--fail-on` findings (default `high`); `--dry-run` prints it, `--action` uses the Lockpick GitHub Action |
54
56
 
55
57
  Every command takes `--host` and `--json`. With `--json`, errors are printed to stderr as `{ "error": "…", "code": "…" }`, plus `nextStep`, `retryAfterSeconds`, `webUrl` and `requestId` for the agent commands.
56
58
 
57
- Exit codes: `0` success; `1` network or other error; `2` authentication; `3` a watched result failed, was cancelled or did not finish before the wait limit; `4` permission or allowance; `5` invalid input; `6` rate limit; `7` provider capacity or service failure. JSON results go to stdout, with errors and human progress on stderr. `--json` never adds terminal colors.
59
+ Exit codes: `0` success; `1` network, not found or other error; `2` authentication; `3` a watched result failed, was cancelled or did not finish before the wait limit; `4` permission (key scope or project role) or allowance; `5` invalid input; `6` rate limit; `7` provider capacity or service failure; `8` open findings reached `--fail-on`. JSON results go to stdout, with errors and human progress on stderr. Text errors end with a `Help:` link to the docs page on your Lockpick host that explains them (`docsUrl` in JSON errors). `--json` never adds terminal colors; `NO_COLOR` turns them off and `FORCE_COLOR=1` turns them on for a CI log. While a scan runs, a terminal shows one live progress line; a pipe or CI (`CI` set) gets one line per change.
60
+
61
+ `--fail-on critical|high|medium|low` on `pulse`, `recheck`, `watch`, `deep start` and `findings` exits `8` when open findings are that severe or worse, for CI. `lockpick ci init <site>` writes a GitHub Actions workflow that runs `npx -y lockpicks@<this version> pulse <site> --fail-on high` with the key from the `LOCKPICK_KEY` repository secret; it runs on published releases and by hand only, because each run uses a Pulse.
62
+
63
+ Text from scanned sites and saved briefs can carry terminal escape sequences. The CLI neutralizes every control character in API responses before printing them (an escape shows as `␛`), and keeps only its own colours on the way out, so a scanned page cannot clear your screen, write your clipboard or hide a link. Ids are checked before they go into a URL, and the key is never printed, even when a server error repeats it.
58
64
 
59
65
  `watch`, `pulse`, full `recheck` and `deep start` wait for at most 600 seconds by default. Use `--timeout <seconds>` (up to 3600) and `--interval <seconds>` (2–30), or `--no-wait` for a started scan id immediately. If a wait ends while the scan is running, the CLI prints its id and exits `3`; resume with `lockpick watch <scanId>`. Waiting never sends the start request again. A quick check waits up to 90 seconds and a DNS recheck up to 60 seconds by default.
60
66
 
61
67
  `pulse` and a full `recheck` started in a project folder with a lockfile ask once whether to send its package names and versions, and remember the answer for that folder (in the CLI's config folder, never in the project). `--lockfile` sends them for one run and `--no-lockfile` skips them; a script with no remembered answer never sends. Lockpick reads `package-lock.json`, `npm-shrinkwrap.json`, `pnpm-lock.yaml`, `yarn.lock`, `requirements.txt` (pinned lines only) and `poetry.lock` in the folder itself, not its subfolders.
62
68
 
63
- Each Pulse, and each full recheck, uses one of your account's runs, the same as starting it in the web app. A quick check and the DNS check again are free; quick checks are limited per account each hour and day.
69
+ Each Pulse, and each full recheck, uses one of your account's Pulse scans, the same as starting it in the web app. A quick check and the DNS check again are free; quick checks are limited per account each hour and day.
64
70
 
65
71
  ## Coding agents (MCP)
66
72
 
@@ -83,5 +89,36 @@ Agents set up for CLI 0.2.0 keep working: `lockpick_list_projects`, `lockpick_pr
83
89
  | `LOCKPICK_KEY` | A key to use without logging in (CI) |
84
90
  | `LOCKPICK_CONFIG_DIR` | Where the config file lives (default `~/.config/lockpick`) |
85
91
  | `LOCKPICK_KEYCHAIN=0` | Skip the OS keychain and use the config file |
92
+ | `NO_COLOR` | Turn colour off |
93
+ | `FORCE_COLOR=1` | Colour even when output is not a terminal (CI logs) |
94
+ | `LOCKPICK_ACTION_REF` | The GitHub Action `ci init --action` refers to |
86
95
 
87
96
  Requires Node.js 20.9 or later.
97
+
98
+ ## Check an assessment during development
99
+
100
+ After deploying your repair and running an authorized scan, evaluate its exact run id:
101
+
102
+ ```bash
103
+ lockpick ci check run_123 --fail-on high --max-age-hours 24 --min-coverage 80 --json
104
+ lockpick report run_123 --out assessment.md
105
+ lockpick report run_123 --json --out assessment.json
106
+ ```
107
+
108
+ These commands read existing results and consume no scan allowance. `ci check` defaults to `--fail-on high`; freshness and coverage requirements are optional. It exits 3 for an unfinished/unsuccessful run or unmet freshness/coverage, 8 for findings at the severity threshold, and 0 when the selected policy passes. Missing or future completion timestamps fail a freshness requirement; unknown coverage fails any explicit coverage requirement, including zero. JSON includes the policy, reasons and public run data. This checks the recorded deployment, not your current local code or commit.
109
+
110
+ `report` exports all public findings, including passing and unknown checks, with coverage limitations. Markdown labels finding content as untrusted data; JSON contains the public run and finding projections. Active runs must finish before export; failed and incomplete reports retain their status. `--out` refuses existing paths and requests mode 0600 on Unix; Windows uses the destination folder’s inherited ACLs. Without it, the report goes to stdout. A successful export says nothing about whether the assessment passed a policy.
111
+
112
+ The same policy is available through local and hosted MCP as `lockpick_evaluate_scan`:
113
+
114
+ ```json
115
+ {
116
+ "scanId": "run_123",
117
+ "failOn": "high",
118
+ "maxAgeHours": 24,
119
+ "minCoverage": 80,
120
+ "format": "json"
121
+ }
122
+ ```
123
+
124
+ It uses read permission, reads the existing scan once, and returns `passed`, `exitCode`, `policy`, `reasons` and the public run in the standard `{ data, error }` envelope. Policy failures are normal results (`passed: false`), while authorization and transport failures remain errors. The evaluator is shared with `ci check`; no scans start and no scan allowance is consumed. For report content, read `lockpick://scans/{scanId}/report` and follow any findings pagination. Saving that content is the calling client's responsibility.