@cefense-npm/cefense-cli 1.0.0 → 1.2.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/dist/index.js CHANGED
@@ -12,7 +12,8 @@ import { statusCommand } from "./commands/status.js";
12
12
  import { scanCommand } from "./commands/scan.js";
13
13
  import { observedCommand, observedShow } from "./commands/observed.js";
14
14
  import { fixCommand } from "./commands/fix.js";
15
- import { fixGenerate, fixPublish, fixShow } from "./commands/fixcmds.js";
15
+ import { fixGenerate, fixMerge, fixPublish, fixShow } from "./commands/fixcmds.js";
16
+ import { skillInstall, skillList, skillShow, skillUninstall } from "./commands/skill.js";
16
17
  const program = new Command();
17
18
  function withGlobals(command) {
18
19
  return command
@@ -130,7 +131,11 @@ withGlobals(program.command("status"))
130
131
  withGlobals(program.command("scan"))
131
132
  .description("rescan a repository")
132
133
  .option("--no-watch", "queue the scan without following its progress")
133
- .action(run((globals, command) => scanCommand(globals, { watch: command.opts().watch !== false })));
134
+ .option("--wait", "block until the scan finishes")
135
+ .action(run((globals, command) => scanCommand(globals, {
136
+ watch: command.opts().watch !== false,
137
+ wait: Boolean(command.opts().wait),
138
+ })));
134
139
  function findingsOptions(command) {
135
140
  return withGlobals(command)
136
141
  .addOption(new Option("--severity <list>", "critical,high,watch,info (medium and low also accepted)"))
@@ -177,6 +182,43 @@ withGlobals(fix.command("publish"))
177
182
  .argument("<finding-id>", "the finding whose patch to open a pull request for")
178
183
  .description("open a pull request with a generated patch")
179
184
  .action(run((globals, command) => fixPublish(globals, command.args[0])));
185
+ withGlobals(fix.command("merge"))
186
+ .argument("[finding-id]", "the finding whose pull request to merge")
187
+ .description("merge the pull request and delete its branch")
188
+ .addOption(new Option("--method <method>", "merge, squash, or rebase").default("squash"))
189
+ .option("--no-delete-branch", "keep the branch after merging")
190
+ .action(run((globals, command) => fixMerge(globals, command.args[0], {
191
+ method: command.opts().method,
192
+ deleteBranch: command.opts().deleteBranch !== false,
193
+ })));
194
+ const skill = program
195
+ .command("skill")
196
+ .description("teach your coding agent to use Cefense");
197
+ withGlobals(skill.command("install", { isDefault: true }))
198
+ .argument("[agents...]", "claude, cursor, copilot, antigravity, windsurf, devin, cline, gemini, agents")
199
+ .description("write the Cefense skill into your coding agents")
200
+ .option("--all", "write it for every supported agent, detected or not")
201
+ .option("--global", "write it once for your user instead of this repository")
202
+ .action(run((globals, command) => skillInstall(globals, command.args, {
203
+ all: Boolean(command.opts().all),
204
+ global: Boolean(command.opts().global),
205
+ })));
206
+ withGlobals(skill.command("list"))
207
+ .description("show every supported agent, and what is installed here")
208
+ .action(run((globals) => skillList(globals)));
209
+ withGlobals(skill.command("show"))
210
+ .argument("[agent]", "render it the way one agent expects")
211
+ .description("print the skill without writing it anywhere")
212
+ .action(run((globals, command) => skillShow(globals, command.args[0])));
213
+ withGlobals(skill.command("uninstall"))
214
+ .argument("[agents...]", "leave empty to remove it everywhere")
215
+ .description("remove the Cefense skill")
216
+ .option("--all", "remove it for every supported agent")
217
+ .option("--global", "remove the user-wide copy instead")
218
+ .action(run((globals, command) => skillUninstall(globals, command.args, {
219
+ all: Boolean(command.opts().all),
220
+ global: Boolean(command.opts().global),
221
+ })));
180
222
  process.on("uncaughtException", (error) => {
181
223
  exitFullScreen();
182
224
  if (isAgentMode())
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,gBA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O,EAAE,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1E,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;KACpC,QAAQ,CAAC,aAAa,EAAE,qCAAqC,CAAC;KAC9D,WAAW,CAAC,0BAA0B,CAAC;KACvC,MAAM,CAAC,OAAO,EAAE,qCAAqC,CAAC;KACtD,MAAM,CAAC,UAAU,EAAE,mCAAmC,CAAC;KACvD,MAAM,CACL,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CACvB,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE;IACpC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC;IAChC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;CACvC,CAAC,CACH,CACF,CAAC;AAEJ,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;IACxC,cAAc,EAAE,CAAC;IACjB,IAAI,WAAW,EAAE;QAAE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;;QACpC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cefense-npm/cefense-cli",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "The command-line interface for Cefense.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,6 +24,7 @@
24
24
  },
25
25
  "files": [
26
26
  "dist",
27
+ "skills",
27
28
  "README.md"
28
29
  ],
29
30
  "scripts": {
@@ -0,0 +1,20 @@
1
+ ## Cefense
2
+
3
+ Cefense finds, explains, and patches security vulnerabilities in this repository. It is driven by the `cf` command.
4
+
5
+ Use it when asked to scan this repository for vulnerabilities or CVEs, triage or explain security findings, patch one, or open a pull request that fixes one. Do not use it as a linter on code being written right now: it reports on what was committed and scanned.
6
+
7
+ ```sh
8
+ cf scan --repo <owner/name> --wait --agent
9
+ cf observed --repo <owner/name> --severity critical,high --agent
10
+ cf observed show <finding-id> --repo <owner/name> --agent
11
+ cf fix generate <finding-id> --wait --agent
12
+ cf fix publish <finding-id> --yes --agent
13
+ cf fix merge <finding-id> --yes --agent
14
+ ```
15
+
16
+ Every command takes `--agent` and prints one line of JSON on stdout. Branch on `error.code`, never on `error.message`. `cf fix publish` opens a real pull request and `cf fix merge` lands it on the default branch, so ask the user before running either, and treat merging as a separate ask from opening.
17
+
18
+ Read `{{reference}}` before using any of this. It is the full guide: filters, the fix lifecycle, error codes, and how to read a finding.
19
+
20
+ Not set up yet? Follow https://cefense.com/skill.md
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: cefense
3
+ description: Find, understand, and fix security vulnerabilities in this repository using the Cefense CLI. Use when asked to run a security scan, check this repository for vulnerabilities or CVEs, triage or explain security findings, generate a patch for a vulnerability, or open a pull request that fixes one.
4
+ license: MIT
5
+ metadata:
6
+ version: 1
7
+ homepage: https://cefense.com
8
+ ---
9
+
10
+ # Cefense
11
+
12
+ Cefense scans this repository, reports the vulnerabilities in its code, joins each one to the public security research that explains it, writes a patch, and opens a pull request. You drive all of it with the `cf` command.
13
+
14
+ ## When to reach for it
15
+
16
+ Use Cefense when the question is about the security of this repository as it actually stands:
17
+
18
+ - "is this repo vulnerable", "run a security scan", "are there any CVEs here"
19
+ - "triage these findings", "what should I fix first"
20
+ - "why is this a vulnerability", "show me how it is reached"
21
+ - "fix that finding", "open a pull request for it"
22
+ - before a release, or when reviewing a dependency bump
23
+
24
+ Do not use it to grade code you are writing right now, and do not use it as a linter. It reports on what was committed and scanned, not on the working tree.
25
+
26
+ If `cf` is not installed or this repository is not connected, follow https://cefense.com/skill.md first.
27
+
28
+ ## The contract
29
+
30
+ Pass `--agent` to every command. It prints exactly one line of JSON to stdout, never opens the interactive view, and never asks a question.
31
+
32
+ ```json
33
+ {"schemaVersion":1,"ok":true,"command":"observed","data":{"...":"..."},"next":["cf fix generate <id> --wait --agent"]}
34
+ {"schemaVersion":1,"ok":false,"command":"fix publish","error":{"code":"confirmation_required","message":"...","remedy":"...","exitCode":2}}
35
+ ```
36
+
37
+ - Branch on `error.code`. Never match on `error.message`, which is written for people and will change.
38
+ - `next` names real commands that act on what was just returned. Prefer them over commands you compose.
39
+ - Pass `--repo owner/name` every time. `--agent` deliberately remembers no default for the working directory.
40
+ - Exit codes: `0` fine, `1` findings present under `--exit-code`, `2` usage, `3` not signed in, `4` API failure, `130` interrupted.
41
+
42
+ ## Vocabulary
43
+
44
+ **Observed** is something real in this repository's code. **Matched** is an Observed finding joined to the research that explains it. **Fix** is a patch for one finding, and the pull request that carries it.
45
+
46
+ Severities read as Critical, High, Watch, Info. On the wire they are `critical`, `high`, `medium`, `low`, and filters take either spelling. Findings carry both `severity` (the wire value) and `severityLabel` (what to tell a person).
47
+
48
+ ## The loop
49
+
50
+ ### List
51
+
52
+ ```sh
53
+ cf observed --repo acme/api --agent
54
+ cf observed --repo acme/api --severity critical,high --agent
55
+ cf matched --repo acme/api --agent
56
+ ```
57
+
58
+ `data.findings` arrives worst first. `data.counts` breaks the total down by wire severity. Each entry carries `id`, `severity`, `severityLabel`, `title`, `file`, `line`, `category`, `cve`, `cwe`, `description`, `guidance`, `matchedSources`, and the state of any `fix`.
59
+
60
+ Filters: `--severity critical,high,watch,info`, `--category code,dependency,secret,misconfig,os-package`, `--limit <n>` (1 to 1000), `--exit-code` to exit `1` when any Critical or High is present.
61
+
62
+ `cf matched` is the sharper list. Those findings have research behind them, so they are the ones you can explain rather than merely report.
63
+
64
+ ### Read one in full
65
+
66
+ ```sh
67
+ cf observed show <finding-id> --repo acme/api --agent
68
+ ```
69
+
70
+ Adds the vulnerable code, the data flow from source to sink, the research that matched with its rationale, the references, and the patch if one exists.
71
+
72
+ Read this before forming an opinion. The listing is a summary, not evidence. In particular, read `dataflow`: `source` and `sink` say how untrusted input reaches the dangerous call, `steps` walks the path, and `ineffectiveSanitizers` names guards that look protective but are not. That is what tells you whether a finding is reachable in practice.
73
+
74
+ ### Patch
75
+
76
+ ```sh
77
+ cf fix generate <finding-id> --wait --agent
78
+ cf fix show <finding-id> --agent
79
+ ```
80
+
81
+ `--wait` polls until settled, up to about three minutes. Without it you get `generating` back and poll `cf fix show` yourself. Statuses: `generating`, `ready`, `failed`, `skipped`, `publishing`, `opened`.
82
+
83
+ When `ready`, `data.fix.diff` holds the unified diff, `data.fix.explanation` says why, and `data.fix.file` names the one file it touches. Read the diff. A generated patch is a proposal. Saying it is wrong, incomplete, or fixes the symptom rather than the cause is a useful answer, and better than passing it along.
84
+
85
+ ### Publish, only when asked
86
+
87
+ ```sh
88
+ cf fix publish <finding-id> --yes --agent
89
+ ```
90
+
91
+ **This opens a real pull request on the user's GitHub repository.** Without `--yes` it refuses with `confirmation_required`, and that gate exists so an agent cannot open pull requests on its own initiative.
92
+
93
+ Ask the user in this conversation first, and show them the diff and the file. `--yes` is not a flag to add because a command failed. If a pull request is already open you get `{"alreadyOpen":true,...}` with the existing `prUrl`, not a duplicate.
94
+
95
+ ### Merge, only when asked
96
+
97
+ ```sh
98
+ cf fix merge <finding-id> --yes --agent
99
+ ```
100
+
101
+ Merges the pull request and deletes its branch. `--method merge|squash|rebase` picks the strategy, squash by default, and `--no-delete-branch` keeps the branch. Always pass the finding id under `--agent`: with none, and no terminal to prompt in, it fails with `usage_error`.
102
+
103
+ **This lands code on the default branch.** It carries the same `--yes` gate as publishing, for the same reason, and it is a larger step than opening a pull request. Ask separately: agreeing to open a pull request is not agreeing to merge it.
104
+
105
+ It refuses rather than forcing its way past anything: `pull_request_blocked` when a required review or status check is pending, `pull_request_conflicted` on conflicts, `pull_request_draft` on a draft, `pull_request_closed` if it was closed unmerged. Branch protection is respected, not bypassed. Report the code and stop.
106
+
107
+ ### Rescan
108
+
109
+ ```sh
110
+ cf scan --repo acme/api --wait --agent
111
+ ```
112
+
113
+ `--wait` blocks until the scan settles, up to about ten minutes, and returns `status`, `findings`, and `error`. Without it you get the `scanId` immediately and have to poll `cf status --agent` yourself.
114
+
115
+ Rescan after merging a fix, not before. Finding ids belong to a scan, so after a rescan list again rather than reusing old ids.
116
+
117
+ ## Closing the loop unattended
118
+
119
+ When the user has asked for the whole cycle rather than one finding, this is the shape. Cefense scans what is on the repository's **default branch** as GitHub has it, so your own code has to land first.
120
+
121
+ ```sh
122
+ cf scan --repo acme/api --wait --agent
123
+ cf observed --repo acme/api --severity critical,high --agent
124
+ cf observed show <finding-id> --repo acme/api --agent
125
+ cf fix generate <finding-id> --wait --agent
126
+ cf fix publish <finding-id> --yes --agent
127
+ cf fix merge <finding-id> --yes --agent
128
+ cf scan --repo acme/api --wait --agent
129
+ ```
130
+
131
+ The last scan is the point of the exercise: it is what proves the path no longer resolves. Compare its `counts` against the first one and say what actually closed.
132
+
133
+ Rules for running this unattended:
134
+
135
+ - **Get consent once, for the loop, and say what it includes.** "Fix and merge the critical findings in acme/api" is consent to merge. "Have a look at the findings" is not.
136
+ - **Still read every diff.** Speed is not permission to stop judging. A patch that narrows the input instead of fixing the sink should be reported, not merged.
137
+ - **One finding at a time.** Generate, publish, merge, and confirm before starting the next. Batching means a bad patch is discovered after five have landed.
138
+ - **Stop on the first refusal.** `pull_request_blocked` and `pull_request_conflicted` mean a human set a rule. Report and wait.
139
+
140
+ ## Working efficiently
141
+
142
+ - **Start narrow.** `--severity critical,high` on a large repository, then widen. Whole-repository listings are the biggest payload the CLI produces.
143
+ - **Do not re-list to refresh one row.** `cf observed show <id>` and `cf fix show <id>` are cheap and current.
144
+ - **Follow `next`.** It is computed from the state you just fetched, so it already knows whether a fix exists.
145
+ - **Batch the reading, serialise the writing.** Read as many findings as you need, then generate patches one at a time so the user can judge each.
146
+ - **Use `--exit-code` in CI**, never string matching on output.
147
+ - **Report `severityLabel`, filter on `severity`.** Telling a user something is "medium" when the product says Watch is wrong.
148
+
149
+ ## Error codes
150
+
151
+ | `error.code` | Exit | What to do |
152
+ | --- | --- | --- |
153
+ | `auth_required` | 3 | not signed in, see https://cefense.com/skill.md |
154
+ | `usage_error` | 2 | read `remedy`, it names the fix |
155
+ | `invalid_severity` | 2 | use critical, high, watch, or info |
156
+ | `invalid_category` | 2 | use code, dependency, secret, misconfig, or os-package |
157
+ | `finding_not_found` | 2 | the id is not in the latest scan, list again |
158
+ | `fix_not_found` | 2 | generate the patch first |
159
+ | `fix_not_ready` | 2 | the patch is not `ready`, check its status |
160
+ | `fix_not_published` | 2 | open the pull request before merging it |
161
+ | `invalid_merge_method` | 2 | use merge, squash, or rebase |
162
+ | `pull_request_blocked` | 4 | a required review or check is pending, stop |
163
+ | `pull_request_conflicted` | 4 | the branch conflicts with its base, stop |
164
+ | `pull_request_draft` | 4 | the pull request is still a draft |
165
+ | `pull_request_closed` | 4 | it was closed without merging |
166
+ | `fix_in_progress` | 2 | one is already generating, poll instead of starting another |
167
+ | `confirmation_required` | 2 | ask the user, then pass `--yes` |
168
+ | `feature_required` | 4 | the account does not include this, tell the user |
169
+ | `api_error` | 4 | the API failed, retry once, then report it |
170
+ | `internal_error` | 4 | report it, with the message |
171
+
172
+ ## Rules
173
+
174
+ - Never run `cf fix publish` or `cf fix merge` without the user agreeing to it in this conversation, and treat merging as a separate ask from opening.
175
+ - Never invent a finding id, a severity, a CVE, or an exploit path. All of it comes from the JSON.
176
+ - Never edit a file to silence a finding instead of fixing it, and never suppress or filter a finding away to make a report look better.
177
+ - Never ask for a token or write credentials to a file. The CLI keeps its token in the operating system keychain.
178
+ - If something is not in the JSON, say so instead of filling the gap.
179
+
180
+ Full documentation: https://cefense.com/docs