@mondoohq/xgrep 0.1.1 → 0.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.
Files changed (3) hide show
  1. package/README.md +35 -41
  2. package/index.js +1 -1
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -1,63 +1,57 @@
1
- # xgrep
1
+ # @mondoohq/xgrep
2
2
 
3
3
  A fast, Semgrep-compatible code scanner written in Go.
4
4
 
5
- xgrep scans codebases using Semgrep YAML rule syntax and tree-sitter for language-aware,
6
- AST-based pattern matching. It optimizes for **accuracy** — when it reports a
7
- vulnerability, it should be real and exploitable — and adds code-intelligence and
8
- AI-agent features on top of scanning. See the
9
- [design goals](docs/01-getting-started/index.md#design-goals).
5
+ xgrep scans codebases using Semgrep YAML rule syntax and tree-sitter for
6
+ language-aware, AST-based pattern matching. It optimizes for **accuracy** — when
7
+ it reports a vulnerability, it should be real and exploitable — and adds
8
+ code-intelligence and AI-agent features on top of scanning.
10
9
 
11
- ## Installation
10
+ This npm package ships prebuilt `xgrep` binaries for Linux and Windows
11
+ (amd64 and arm64).
12
12
 
13
- ```bash
14
- go install go.mondoo.com/xgrep/cmd/xgrep@latest
15
- ```
13
+ ## Quick start
16
14
 
17
- Or build from source:
15
+ xgrep ships with a built-in rule corpus, so no rules file is needed to get
16
+ started — run it straight from npx:
18
17
 
19
18
  ```bash
20
- git clone https://github.com/mondoohq/xgrep.git
21
- cd xgrep
22
- go build -o xgrep ./cmd/xgrep
19
+ # Scan the current directory with the built-in rules (defaults to security)
20
+ npx @mondoohq/xgrep scan .
23
21
  ```
24
22
 
25
- ## Quick start
26
-
27
23
  ```bash
28
- # Scan a directory with a rule file (or a directory of rules)
29
- xgrep -f rules.yaml src/
24
+ # Choose a category (default: security)
25
+ npx @mondoohq/xgrep scan --category correctness .
30
26
 
31
27
  # Machine-readable output
32
- xgrep -f rules.yaml --json src/
33
- xgrep -f rules.yaml --sarif src/ # GitHub Code Scanning
34
- xgrep -f rules.yaml --gitlab -o gl-sast-report.json src/ # GitLab SAST
28
+ npx @mondoohq/xgrep scan --json .
29
+ npx @mondoohq/xgrep scan --sarif . # GitHub Code Scanning
30
+ npx @mondoohq/xgrep scan --gitlab -o gl-sast-report.json . # GitLab SAST
31
+
32
+ # Bring your own rules: point -f at a rule file or a directory of rules
33
+ npx @mondoohq/xgrep scan -f rules.yaml src/
35
34
  ```
36
35
 
37
- A scan target can also be a **remote git repository** — xgrep clones it (shallow,
38
- default branch) into a temp directory and scans it, no manual clone needed:
36
+ A scan target can also be a **remote git repository** — xgrep clones it
37
+ (shallow, default branch) into a temp directory and scans it, no manual clone
38
+ needed:
39
39
 
40
40
  ```bash
41
- xgrep scan github.com/mondoohq/xgrep # host/owner/repo shorthand
42
- xgrep scan https://github.com/mondoohq/xgrep # or a full HTTPS/SSH URL
43
- xgrep scan github.com/mondoohq/xgrep --ref v1.2.0 # a branch, tag, or commit
41
+ npx @mondoohq/xgrep scan github.com/mondoohq/xgrep # host/owner/repo shorthand
42
+ npx @mondoohq/xgrep scan https://github.com/mondoohq/xgrep # or a full HTTPS/SSH URL
43
+ npx @mondoohq/xgrep scan github.com/mondoohq/xgrep --ref v1.2.0 # a branch, tag, or commit
44
44
  ```
45
45
 
46
- See the [remote-repository section](docs/02-scanning/cli-reference.md#scanning-a-remote-repository)
47
- for `--ref`, `--depth`, and `--full-clone`.
48
-
49
- ## Documentation
46
+ ## Install
50
47
 
51
- Full documentation lives in [`docs/`](docs/README.md):
48
+ To add the `xgrep` command to your `PATH` instead of using npx:
52
49
 
53
- - **[Getting started](docs/01-getting-started/index.md)** — install and run your first scan.
54
- - **[Scanning](docs/02-scanning/index.md)** — CLI reference, output formats, supported
55
- languages, file filtering, and Semgrep compatibility.
56
- - **[Rules](docs/03-rules/index.md)** — writing, syntax, taint analysis, and testing rules.
57
- - **[Code intelligence](docs/04-code-intelligence/index.md)** — `xgrep inspect` and the code graph.
58
- - **[Integrations](docs/05-integrations/index.md)** — MCP, LSP, and CI.
59
- - **[AI agents](docs/06-ai-agents/index.md)** — using xgrep as an agent backend (see also
60
- [`AGENTS.md`](AGENTS.md)).
50
+ ```bash
51
+ # Global install
52
+ npm install -g @mondoohq/xgrep
53
+ xgrep scan .
61
54
 
62
- Contributors: see [`CLAUDE.md`](CLAUDE.md) and the
63
- [architecture decision records](docs/adr).
55
+ # Or as a project dev dependency
56
+ npm install --save-dev @mondoohq/xgrep
57
+ ```
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  const path = require('path');
3
3
  const child_process = require('child_process');
4
- const mapping = { win32_x64: { name: [ '@mondoohq', 'xgrep_windows_amd64' ], bin: 'xgrep.exe' }, win32_arm64: { name: [ '@mondoohq', 'xgrep_windows_arm64' ], bin: 'xgrep.exe' }, linux_arm64: { name: [ '@mondoohq', 'xgrep_linux_arm64' ], bin: 'xgrep' }, linux_x64: { name: [ '@mondoohq', 'xgrep_linux_amd64' ], bin: 'xgrep' } };
4
+ const mapping = { win32_x64: { name: [ '@mondoohq', 'xgrep_windows_amd64' ], bin: 'xgrep.exe' }, win32_arm64: { name: [ '@mondoohq', 'xgrep_windows_arm64' ], bin: 'xgrep.exe' }, linux_x64: { name: [ '@mondoohq', 'xgrep_linux_amd64' ], bin: 'xgrep' }, linux_arm64: { name: [ '@mondoohq', 'xgrep_linux_arm64' ], bin: 'xgrep' } };
5
5
  const definition = mapping[process.platform + '_' + process.arch];
6
6
  const packageJsonPath = require.resolve(path.join(...definition.name, 'package.json'));
7
7
  const packagePath = path.join(path.dirname(packageJsonPath), definition.bin);
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@mondoohq/xgrep",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "bin": {
5
5
  "xgrep": "index.js"
6
6
  },
7
7
  "optionalDependencies": {
8
- "@mondoohq/xgrep_windows_amd64": "0.1.1",
9
- "@mondoohq/xgrep_windows_arm64": "0.1.1",
10
- "@mondoohq/xgrep_linux_arm64": "0.1.1",
11
- "@mondoohq/xgrep_linux_amd64": "0.1.1"
8
+ "@mondoohq/xgrep_windows_amd64": "0.2.0",
9
+ "@mondoohq/xgrep_windows_arm64": "0.2.0",
10
+ "@mondoohq/xgrep_linux_amd64": "0.2.0",
11
+ "@mondoohq/xgrep_linux_arm64": "0.2.0"
12
12
  },
13
13
  "os": [
14
14
  "win32",