aislop 0.10.2 → 0.11.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/README.md CHANGED
@@ -2,30 +2,37 @@
2
2
 
3
3
  **Catch the slop AI coding agents leave in your code.**
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/aislop.svg)](https://www.npmjs.com/package/aislop)
6
- [![npm downloads](https://img.shields.io/npm/dm/aislop.svg)](https://www.npmjs.com/package/aislop)
7
- [![CI](https://github.com/scanaislop/aislop/actions/workflows/ci.yml/badge.svg)](https://github.com/scanaislop/aislop/actions/workflows/ci.yml)
8
- [![aislop score](https://badges.scanaislop.com/score/scanaislop/aislop.svg)](https://scanaislop.com/scanaislop/aislop)
9
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10
- [![Node >= 20](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
5
+ [![npm version](https://img.shields.io/npm/v/aislop.svg)](https://www.npmjs.com/package/aislop) [![npm downloads](https://img.shields.io/npm/dm/aislop.svg)](https://www.npmjs.com/package/aislop) [![PyPI downloads](https://img.shields.io/pepy/dt/aislop.svg?label=PyPI%20downloads)](https://pypi.org/project/aislop/) [![Homebrew tap](https://img.shields.io/badge/Homebrew-scanaislop%2Ftap-2f855a.svg)](https://github.com/scanaislop/homebrew-tap) [![CI](https://github.com/scanaislop/aislop/actions/workflows/ci.yml/badge.svg)](https://github.com/scanaislop/aislop/actions/workflows/ci.yml) [![aislop score](https://badges.scanaislop.com/score/scanaislop/aislop.svg)](https://scanaislop.com/scanaislop/aislop) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Node >= 20](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
11
6
 
12
7
  The patterns Claude Code, Cursor, Codex, and OpenCode leave behind: narrative comments above self-explanatory code, swallowed exceptions, `as any` casts, hallucinated imports, duplicated helpers, dead code, todo stubs, oversized functions. Tests pass. Lint passes. The code rots anyway.
13
8
 
14
- aislop catches them. 50+ rules across 7 languages (TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP). Scores every change 0–100. Sub-second. Deterministic — no LLM in the runtime path, same code in, same score out. MIT-licensed, free CLI.
9
+ aislop catches them. 50+ rules across 8 language targets (TypeScript, JavaScript, Expo / React Native, Python, Go, Rust, Ruby, PHP). Scores every change 0–100. Sub-second. Deterministic — no LLM in the runtime path, same code in, same score out. MIT-licensed, free CLI.
15
10
 
16
11
  ## Quick start
17
12
 
18
13
  ```bash
19
- npx aislop scan
14
+ npx aislop@latest scan
20
15
  ```
21
16
 
22
17
  No install needed. Works on any project. Get your score in seconds.
23
18
 
19
+ Also available on npm, Yarn, Bun, Homebrew, and PyPI:
20
+
21
+ ```bash
22
+ npm install -g aislop # npm
23
+ yarn dlx aislop scan # Yarn (no install)
24
+ bun add -g aislop # Bun
25
+ brew install scanaislop/tap/aislop # Homebrew
26
+ pipx install aislop # Python
27
+ ```
28
+
29
+ See [Installation](#installation) for every option.
30
+
24
31
  ```bash
25
- npx aislop fix # auto-fix issues
26
- npx aislop fix -f # aggressive fixes (deps, unused files)
27
- npx aislop ci # CI mode (JSON + gate)
28
- npx aislop hook install --claude # per-edit hook
32
+ aislop fix # auto-fix issues after installing
33
+ aislop fix -f # aggressive fixes (deps, unused files)
34
+ aislop ci # CI mode (JSON + gate)
35
+ aislop hook install --claude # per-edit hook
29
36
  ```
30
37
 
31
38
  **Public badge**: Show your score on your README
@@ -34,7 +41,7 @@ npx aislop hook install --claude # per-edit hook
34
41
  [![aislop](https://badges.scanaislop.com/score/<owner>/<repo>.svg)](https://scanaislop.com)
35
42
  ```
36
43
 
37
- Run `npx aislop badge` to auto-generate. Free at [scanaislop.com](https://scanaislop.com).
44
+ Run `npx aislop@latest badge` to auto-generate. Free at [scanaislop.com](https://scanaislop.com).
38
45
 
39
46
  ## See it in action
40
47
 
@@ -46,9 +53,13 @@ Run `npx aislop badge` to auto-generate. Free at [scanaislop.com](https://scanai
46
53
 
47
54
  ## Installation
48
55
 
56
+ The same CLI is published to npm, Homebrew, and PyPI. Pick whichever fits your stack.
57
+
58
+ **Node / npm**
59
+
49
60
  ```bash
50
61
  # Run without installing
51
- npx aislop scan
62
+ npx aislop@latest scan
52
63
 
53
64
  # npm
54
65
  npm install --save-dev aislop
@@ -59,25 +70,64 @@ yarn add --dev aislop
59
70
  # pnpm
60
71
  pnpm add -D aislop
61
72
 
73
+ # bun
74
+ bun add -d aislop
75
+
62
76
  # Global
63
77
  npm install -g aislop
64
78
  ```
65
79
 
66
80
  Also available as [`@scanaislop/aislop`](docs/installation.md) on GitHub Packages.
67
81
 
82
+ **Homebrew** (macOS / Linux)
83
+
84
+ ```bash
85
+ brew install scanaislop/tap/aislop
86
+ ```
87
+
88
+ Homebrew installs Node.js as a dependency if it isn't already present. Details: [homebrew-tap](https://github.com/scanaislop/homebrew-tap).
89
+
90
+ **Python / pipx**
91
+
92
+ ```bash
93
+ pipx install aislop
94
+ ```
95
+
96
+ `pipx` keeps `aislop` in its own isolated environment. Needs Node.js on `PATH`. Details: [PyPI package](https://pypi.org/project/aislop/).
97
+
98
+ Full reference for every channel, bundled tooling, and external tools: [docs/installation.md](docs/installation.md).
99
+
68
100
  ---
69
101
 
70
102
  ## Usage
71
103
 
104
+ Examples below use the installed `aislop` binary. For a one-off latest run, prefix the command with `npx aislop@latest`, for example `npx aislop@latest scan`.
105
+
106
+ ### Command reference
107
+
108
+ ```bash
109
+ aislop --help # clean overview
110
+ aislop commands # every public command and major flag
111
+ aislop <command> --help # detailed help for one command
112
+ aislop version # installed version
113
+ aislop -V # installed version
114
+ aislop update # current and latest npm versions
115
+ ```
116
+
72
117
  ### Scan
73
118
 
74
119
  ```bash
75
- npx aislop scan # current directory
76
- npx aislop scan ./src # specific directory
77
- npx aislop scan --changes # changed files from HEAD
78
- npx aislop scan --staged # staged files only
79
- npx aislop scan --json # JSON output
80
- npx aislop scan --sarif # SARIF 2.1.0 output (GitHub code scanning)
120
+ aislop scan # current directory
121
+ aislop scan ./src # specific directory
122
+ aislop scan --changes # changed files from HEAD
123
+ aislop scan --changes --base origin/main # changed vs a base branch (PRs)
124
+ aislop scan --staged # staged files only
125
+ aislop scan -d # verbose file/rule detail
126
+ aislop scan --json # JSON output
127
+ aislop scan --sarif # SARIF 2.1.0 output (GitHub code scanning)
128
+ aislop scan --format json # alternate JSON form
129
+ aislop scan --include "src/**" # only matching paths
130
+ aislop scan --exclude "dist,gen" # skip extra paths
81
131
  ```
82
132
 
83
133
  **Exclude files**: `node_modules`, `.git`, `dist`, `build`, `coverage` excluded by default. Add more in `.aislop/config.yml`:
@@ -88,9 +138,9 @@ exclude:
88
138
  - src/generated
89
139
  ```
90
140
 
91
- Or via CLI: `npx aislop scan --exclude "**/*.test.ts,dist"`
141
+ Or via CLI: `aislop scan --exclude "**/*.test.ts,dist"`
92
142
 
93
- **Unsupported languages**: aislop only analyses the 8 languages above. If a repo is mostly something else (C, C++, C#, Swift, Kotlin, …), scoring a handful of incidental files would misrepresent it, so aislop **withholds the score** and says so rather than printing a number off code it never read. `--json` returns `score: null`, `scoreable: false`, and a `coverage` breakdown.
143
+ **Unsupported languages**: aislop only analyses the 8 language targets above. If a repo is mostly something else (C, C++, C#, Swift, Kotlin, …), scoring a handful of incidental files would misrepresent it, so aislop **withholds the score** and says so rather than printing a number off code it never read. `--json` returns `score: null`, `scoreable: false`, and a `coverage` breakdown.
94
144
 
95
145
  **Per-rule severity**: Override the severity of any rule by id, or turn it off:
96
146
 
@@ -139,9 +189,11 @@ ci:
139
189
  Auto-fix what's mechanical (formatters, unused imports, dead code). For issues that need context, hand off to your agent with full diagnostic info.
140
190
 
141
191
  ```bash
142
- npx aislop fix # auto-fixes
143
- npx aislop fix --safe # only reversible fixes (imports, comment removal, formatting)
144
- npx aislop fix -f # aggressive: deps, unused files
192
+ aislop fix # auto-fixes
193
+ aislop fix -d # detailed fix progress
194
+ aislop fix --safe # only reversible fixes (imports, comment removal, formatting)
195
+ aislop fix -f # aggressive: deps, unused files
196
+ aislop fix -p # print an agent handoff prompt
145
197
  ```
146
198
 
147
199
  `--safe` restricts the run to fixes that cannot change behaviour — unused-import removal, import merging, narrative-comment removal, and formatting. Anything that deletes code or rewrites behaviour/attributes (console/dead-code removal, lint autofixes, unused-declaration and dependency pruning) is skipped, so a `--safe` run is genuinely "apply and commit".
@@ -151,37 +203,45 @@ npx aislop fix -f # aggressive: deps, unused files
151
203
  When auto-fix can't solve it, pass the remaining issues to your coding agent with full context:
152
204
 
153
205
  ```bash
154
- npx aislop fix --claude # Claude Code
155
- npx aislop fix --cursor # Cursor (copies to clipboard)
156
- npx aislop fix --gemini # Gemini CLI
157
- npx aislop fix --codex # Codex CLI
158
- # Also: --windsurf, --amp, --aider, --goose, --pi, --crush, --opencode, --warp, --kimi, --antigravity, --deep-agents, --vscode
159
- npx aislop fix --prompt # print prompt (agent-agnostic)
206
+ aislop fix --claude # Claude Code
207
+ aislop fix --codex # Codex CLI
208
+ aislop fix --cursor # Cursor (copies to clipboard)
209
+ aislop fix --gemini # Gemini CLI
210
+ aislop fix --prompt # print prompt (agent-agnostic)
160
211
  ```
161
212
 
213
+ Other fix handoff flags: `--windsurf`, `--vscode`, `--amp`, `--antigravity`, `--deep-agents`, `--kimi`, `--opencode`, `--warp`, `--aider`, `--goose`, `--pi`, `--crush`.
214
+
162
215
  ### Install hook
163
216
 
164
217
  Runs after every agent edit. Feedback flows back immediately.
165
218
 
166
219
  ```bash
167
- npx aislop hook install --claude # Claude Code
168
- npx aislop hook install --cursor # Cursor
169
- npx aislop hook install --gemini # Gemini CLI
170
- npx aislop hook install --pi # pi
171
- npx aislop hook install # all supported agents
172
- npx aislop hook install claude cursor # specific agents
220
+ aislop hook install --claude # Claude Code
221
+ aislop hook install --cursor # Cursor
222
+ aislop hook install --gemini # Gemini CLI
223
+ aislop hook install --pi # pi
224
+ aislop hook install # pick agents interactively
225
+ aislop hook install claude cursor # specific agents
226
+ aislop hook install --agent claude,pi # comma-separated agents
227
+ aislop install claude cursor # alias for hook install
228
+ aislop install hooks --claude # natural alias for hook install
173
229
  ```
174
230
 
175
231
  **Runtime adapters** (scan + feedback): `claude`, `cursor`, `gemini`, `pi`.
176
232
  **Rules-only** (agent reads rules): `codex`, `windsurf`, `cline`, `kilocode`, `antigravity`, `copilot`.
177
233
 
234
+ Hook install flags: `--agent <names>`, `-g, --global`, `--project`, `--dry-run`, `--yes`, `--quality-gate`, plus per-agent shortcuts `--claude`, `--cursor`, `--gemini`, `--pi`, `--codex`, `--windsurf`, `--cline`, `--kilocode`, `--antigravity`, `--copilot`.
235
+
178
236
  **Quality-gate mode**: Blocks if score regresses below baseline.
179
237
 
180
238
  ```bash
181
- npx aislop hook install --claude --quality-gate
182
- npx aislop hook baseline # re-capture baseline
183
- npx aislop hook status # list installed
184
- npx aislop hook uninstall --claude # remove
239
+ aislop hook install --claude --quality-gate
240
+ aislop hook baseline # re-capture baseline
241
+ aislop hook status # list installed
242
+ aislop hook uninstall --claude # remove
243
+ aislop uninstall claude # alias for hook uninstall
244
+ aislop uninstall hooks --claude # natural alias for hook uninstall
185
245
  ```
186
246
 
187
247
  Docs: [`/docs/hooks`](https://scanaislop.com/docs/hooks)
@@ -207,18 +267,30 @@ Expose aislop as MCP tools for Claude Desktop, Cursor, Codex:
207
267
  ### CI
208
268
 
209
269
  ```bash
210
- npx aislop ci # JSON output, exits 1 if score < threshold
270
+ aislop ci # JSON output, exits 1 if score < threshold
271
+ aislop ci --changes --base origin/main # gate only the files a PR changes
272
+ aislop ci --human # human-friendly CI output
273
+ aislop ci --sarif # SARIF output for code scanning
211
274
  ```
212
275
 
276
+ `ci` accepts the same `--changes` / `--staged` / `--base <ref>` scoping as `scan`. Use `--changes --base origin/<target>` to gate a pull request on only the files it touches; the score gate and exit code still apply.
277
+
213
278
  ### Other commands
214
279
 
215
280
  ```bash
216
- npx aislop init # create .aislop/config.yml
217
- npx aislop init --strict # enterprise-grade gate: all engines, typecheck, failBelow 85
218
- npx aislop rules # list rules
219
- npx aislop badge # print badge URL
220
- npx aislop trend # show score history over time
221
- npx aislop # interactive menu
281
+ aislop # interactive menu
282
+ aislop init # create .aislop/config.yml
283
+ aislop init --strict # enterprise-grade gate: all engines, typecheck, failBelow 85
284
+ aislop doctor # check which engines can run here
285
+ aislop rules # list rules
286
+ aislop rules --search # searchable rule explorer
287
+ aislop badge # print badge URL
288
+ aislop badge --owner o --repo r --json
289
+ aislop trend # show score history over time
290
+ aislop trend --limit 20
291
+ aislop update # show current and latest npm versions
292
+ aislop upgrade # alias for update
293
+ aislop commands # full command list
222
294
  ```
223
295
 
224
296
  **Score history**: a normal (full-project, interactive) `scan` appends a compact record to `.aislop/history.jsonl` (timestamp, score, error/warning counts, file count, CLI version). `aislop trend` reads it and prints a table plus an ASCII sparkline of recent scores. History is a local side effect only: it is never written for `--json`/`--sarif` output, in CI, or when `AISLOP_NO_HISTORY=1` is set, so machine output stays clean.
@@ -234,7 +306,7 @@ Docs: [commands](docs/commands.md)
234
306
  Run directly on staged files:
235
307
 
236
308
  ```bash
237
- npx aislop scan --staged
309
+ aislop scan --staged
238
310
  ```
239
311
 
240
312
  Or wire it into the [pre-commit](https://pre-commit.com) framework via the bundled hook:
@@ -243,14 +315,14 @@ Or wire it into the [pre-commit](https://pre-commit.com) framework via the bundl
243
315
  # .pre-commit-config.yaml
244
316
  repos:
245
317
  - repo: https://github.com/scanaislop/aislop
246
- rev: v0.10.2
318
+ rev: v1
247
319
  hooks:
248
320
  - id: aislop
249
321
  ```
250
322
 
251
323
  ### GitHub Actions
252
324
 
253
- Run `npx aislop init` and accept the workflow prompt, or add manually:
325
+ Run `aislop init` and accept the workflow prompt, or add manually. The self-contained form always runs the latest CLI, so there's nothing to bump:
254
326
 
255
327
  ```yaml
256
328
  name: aislop
@@ -265,30 +337,19 @@ jobs:
265
337
  runs-on: ubuntu-latest
266
338
  steps:
267
339
  - uses: actions/checkout@v4
268
-
269
- - uses: scanaislop/aislop@v0.10.2
340
+ - uses: actions/setup-node@v4
270
341
  with:
271
- version: latest
272
- ```
273
-
274
- `uses: scanaislop/aislop@v0.10.2` pins the GitHub Action wrapper. `version: latest` follows the latest npm CLI. For fully deterministic CI, set both to the same release:
275
-
276
- ```yaml
277
- - uses: actions/checkout@v4
278
-
279
- - uses: scanaislop/aislop@v0.10.2
280
- with:
281
- version: "0.10.2"
342
+ node-version: 24
343
+ - run: npx --yes aislop@latest ci
282
344
  ```
283
345
 
284
- Manual workflow without the Marketplace Action:
346
+ Prefer the Marketplace Action? `@v1` tracks the latest release and `version: latest` keeps the CLI current. Pin `@v0.10.2` and a `version` for reproducible builds:
285
347
 
286
348
  ```yaml
287
349
  - uses: actions/checkout@v4
288
- - uses: actions/setup-node@v4
350
+ - uses: scanaislop/aislop@v1
289
351
  with:
290
- node-version: 20
291
- - run: npx --yes aislop@latest ci .
352
+ version: latest
292
353
  ```
293
354
 
294
355
  **GitHub code scanning (SARIF)**: emit a SARIF 2.1.0 report and upload it so findings appear in the Security tab:
@@ -300,6 +361,27 @@ Manual workflow without the Marketplace Action:
300
361
  sarif_file: aislop.sarif
301
362
  ```
302
363
 
364
+ ### Bitbucket Pipelines
365
+
366
+ Bitbucket clones shallow by default, so fetch the PR target branch and gate on only the changed files with `ci --changes --base`:
367
+
368
+ ```yaml
369
+ # bitbucket-pipelines.yml
370
+ pipelines:
371
+ pull-requests:
372
+ "**":
373
+ - step:
374
+ name: aislop gate
375
+ image: node:24
376
+ clone:
377
+ depth: full # branch diffs need history
378
+ script:
379
+ - git fetch origin "$BITBUCKET_PR_DESTINATION_BRANCH"
380
+ - npx --yes aislop@latest ci --changes --base FETCH_HEAD
381
+ ```
382
+
383
+ `ci` applies the score gate and exit code, so no JSON parsing or hand-rolled threshold is needed. More providers: [CI/CD](docs/ci.md).
384
+
303
385
  ### Quality gate
304
386
 
305
387
  Set minimum score in `.aislop/config.yml`:
@@ -333,7 +415,7 @@ AI coding tools generate code that compiles and passes tests but ships with patt
333
415
  - **One score**: 0-100, enforced in CI. Weighted so sloppy patterns hit harder than style noise.
334
416
  - **Auto-fix first**: Clears formatters, unused imports, dead code mechanically. Hands off the rest to your agent with full context.
335
417
  - **Deterministic**: Regex + AST + standard tooling. No LLMs, no API calls. Same code in, same score out.
336
- - **Zero-config start**: `npx aislop scan` works on any repo. Add `.aislop/config.yml` to tune.
418
+ - **Zero-config start**: `npx aislop@latest scan` works on any repo. Add `.aislop/config.yml` to tune.
337
419
 
338
420
  ## What it catches
339
421