@alint-js/cli 0.5.0 → 0.6.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
@@ -14,11 +14,11 @@
14
14
 
15
15
  # `alint`
16
16
 
17
- [![npm version][npm-version-src]][npm-version-href]
18
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
17
+ [![npm version][npmx-version-src]][npmx-version-href]
18
+ [![npm downloads][npmx-downloads-src]][npmx-downloads-href]
19
19
  [![bundle][bundle-src]][bundle-href]
20
- [![JSDocs][jsdocs-src]][jsdocs-href]
21
20
  [![License][license-src]][license-href]
21
+ [![JSDocs][jsdocs-src]][jsdocs-href]
22
22
 
23
23
  ![Demo](./docs/assets/demo.gif)
24
24
 
@@ -50,7 +50,7 @@ You also need at least one OpenAI-compatible model provider. Local providers suc
50
50
 
51
51
  ### Install the CLI
52
52
 
53
- Download a standalone binary from the GitHub release assets when you want to use `alint` without a Node.js toolchain.
53
+ Download a standalone binary from the GitHub release assets if you want to use `alint` without a Node.js toolchain.
54
54
 
55
55
  Install globally if you want an `alint` command available everywhere:
56
56
 
@@ -161,12 +161,26 @@ alint demo.ts
161
161
  alint --format json demo.ts
162
162
  ```
163
163
 
164
+ #### --dirty
165
+
166
+ Use `--dirty` without file arguments to lint only existing files that differ from `HEAD`:
167
+
168
+ ```bash
169
+ alint --dirty
170
+ ```
171
+
172
+ This includes staged, unstaged, and untracked files from the Git repository root. Ignored and deleted files are excluded. Registered submodule worktrees are excluded. A clean repository exits successfully without producing lint output.
173
+
174
+ #### --model
175
+
164
176
  Override the matched model for a one-off run:
165
177
 
166
178
  ```bash
167
179
  alint --model qwen:8b demo.ts
168
180
  ```
169
181
 
182
+ #### --lang
183
+
170
184
  When the project-local setup does not configure any models, model calls without a rule-level or call-level selector use the `default` alias from the global setup. Rule selectors continue to use normal model matching. Configuring at least one model in `.alint/config.toml` restores project-first matching for unselected calls. An explicit `--model` override always takes precedence.
171
185
 
172
186
  Ask model-backed rules to write diagnostics in a specific language:
@@ -186,8 +200,6 @@ alint config inspect src/index.ts
186
200
  alint config providers list
187
201
  alint config providers show openrouter
188
202
  alint config models list
189
- alint config models list --with-speed
190
- alint config models list --with-speed --with-speed-concurrency openrouter=10 --with-speed-concurrency ollama=1
191
203
  alint config models show ollama/qwen
192
204
  alint config models probe --endpoint http://localhost:11434/v1
193
205
  alint config models rm qwen --provider ollama
@@ -198,8 +210,6 @@ When a model ID exists under multiple providers, qualify it as `<provider>/<mode
198
210
 
199
211
  `models rm` removes one exact configured model. `models prune` probes provider model endpoints and destructively removes configured IDs that are no longer reported. Interactive prune asks for confirmation; scripts must pass `-N --yes`.
200
212
 
201
- `models list --with-speed` sends live streamed requests to every configured model. It reports median repeat and non-repeat latency, non-repeat output throughput, and successful attempts. Each model receives one repeat warm-up, three measured repeat requests, and three non-repeat requests. Model jobs run concurrently within independent provider limits: OpenRouter defaults to 20, while CLIProxyAPI and other providers default to 2. Repeat `--with-speed-concurrency <provider-id>=<limit>` to override one or more configured providers. Requests within one model remain serial so its repeat and non-repeat cache measurements do not overlap. An unavailable model is shown as `errored` without preventing the remaining models from running. On a TTY, spinners and a refreshable table show active models, phases, and samples. Each request uses the configured runner timeout, or 60 seconds when none is configured. This command consumes provider tokens and may incur charges.
202
-
203
213
  Save machine-readable output and inspect it later without rerunning model calls:
204
214
 
205
215
  ```bash
@@ -244,6 +254,54 @@ It resolves the alint executable from the `alint.path` setting, then `node_modul
244
254
  the workspace folder, then `PATH`. The workspace install wins so that the server and the alint you
245
255
  run in a terminal share one cache.
246
256
 
257
+ ### Codex stop-gate plugin (optional)
258
+
259
+ #### Install
260
+ The Codex plugin adds a Stop hook that runs `alint --dirty` before the agent ends a turn.
261
+
262
+ Run these commands to install the plugin from the repository's default branch. These commands do not select the latest release:
263
+
264
+ ```bash
265
+ codex plugin marketplace add moeru-ai/alint \
266
+ --sparse .agents/plugins \
267
+ --sparse plugins/codex-plugin-alint
268
+ codex plugin add alint@alint
269
+ ```
270
+
271
+ To install from a release, use its Git tag:
272
+
273
+ ```bash
274
+ codex plugin marketplace add moeru-ai/alint \
275
+ --ref vX.Y.Z \
276
+ --sparse .agents/plugins \
277
+ --sparse plugins/codex-plugin-alint
278
+ codex plugin add alint@alint
279
+ ```
280
+
281
+ Replace `vX.Y.Z` with the required release tag. Review and trust the Stop hook when Codex asks. The plugin stays inactive until a repository enables Stop Gate.
282
+
283
+ #### Configure
284
+
285
+ The codex plugin explicitly requires per-repo enable. Use this command to enable for current repository:
286
+
287
+ - .toml: run `alint config integrations stop-gate enable`
288
+ - .js/.ts:
289
+ ```typescript
290
+ export default defineConfig([
291
+ // ...
292
+ {
293
+ integrations: {
294
+ stopGate: {
295
+ enabled: true,
296
+ // target: 'dirty-files' | 'all'
297
+ // timeoutMs: 900000
298
+ },
299
+ },
300
+ },
301
+ // ...
302
+ ])
303
+ ```
304
+
247
305
  ## Concepts
248
306
 
249
307
  `alint` keeps the familiar lint shape: select targets, apply named rules, report diagnostics, and return an exit code that CI can understand. The difference is that a rule can reach its judgment through model calls or a tool-using agent when syntax-only checks are not enough.
@@ -281,7 +339,7 @@ thinking = { type = "disabled" }
281
339
 
282
340
  `default_params` is merged into every chat request for that model. Use it for provider-specific request fields that are not covered by the rest of the model entry.
283
341
 
284
- The CLI can also launch an ACP coding-agent command and expose it to rules as an ordinary model. Interactive `alint setup` provides presets for Claude Code, Codex, Gemini CLI, Kimi Code CLI, and OpenCode. Put a custom machine-specific command in the global setup config, or in `.alint/config.toml` when the repository standardizes the same command for every contributor:
342
+ The CLI can also launch an ACP coding-agent command and expose it to rules as an ordinary model. Interactive `alint setup` provides presets for Claude Code, Codex, Gemini CLI, Kimi Code CLI, and OpenCode:
285
343
 
286
344
  ```toml
287
345
  version = 1
@@ -300,15 +358,7 @@ args = []
300
358
  cwd = "."
301
359
  ```
302
360
 
303
- Then select it like any other model:
304
-
305
- ```bash
306
- alint --model acp/codex src
307
- ```
308
-
309
- `alint.config.ts` remains the shareable lint policy: it selects models, plugins, and rules but does not launch processes. The CLI merges global setup with `.alint/config.toml`, starts a loopback OpenAI-compatible adapter for the run, and shuts it down afterward. Each concurrent model request gets its own ACP process, so `--rule-concurrency` also bounds how many coding-agent processes a run can require.
310
-
311
- The command inherits the environment that launched `alint`. Optional `[providers.models.env]` entries override individual variables, but setup TOML does not interpolate variables. Do not commit credentials into the table. Request tools require the ACP agent to support MCP over HTTP.
361
+ Then run `alint --model acp/codex src`. The checked-in `alint.config.ts` remains lint policy; process commands come only from global setup or `.alint/config.toml`. The command inherits the environment that launched `alint`; optional model `env` entries are literal overrides and should not contain committed credentials. Each concurrent request starts one ACP process, and request tools require MCP-over-HTTP support from the agent.
312
362
 
313
363
  `alint` structured output forces a tool call (`tool_choice`). Some models, such as DeepSeek V4, reject that combination while thinking/reasoning is enabled. For those models, set `thinking = { type = "disabled" }` as above so structured output can run.
314
364
 
@@ -327,6 +377,19 @@ alint setup -N \
327
377
  - `--local` writes `.alint/config.toml` in the current project.
328
378
  - You can inspect configs using the `alint config` command group.
329
379
 
380
+ ##### Codex Stop Gate
381
+
382
+ Configure the optional Codex Stop Gate integration through the same project config system:
383
+
384
+ ```bash
385
+ alint config integrations stop-gate enable
386
+ alint config integrations stop-gate show
387
+ alint config integrations stop-gate set --target all --timeout-ms 1800000
388
+ alint config integrations stop-gate disable
389
+ ```
390
+
391
+ Stop Gate is disabled by default and runs only when the repository explicitly sets `integrations.stopGate.enabled = true`. The defaults after activation are `target = "dirty-files"` and `timeoutMs = 900000`; the maximum timeout is `86100000` (23 hours 55 minutes), leaving five minutes inside the plugin's 24-hour Codex hook limit for startup and persistence. The writer persists only non-default overrides and only extends the existing TOML write path; it does not extend the config writer to other formats. Read the [`plugins/codex-plugin-alint`](https://github.com/moeru-ai/alint/tree/main/plugins/codex-plugin-alint) documentation for complete runtime behavior.
392
+
330
393
  #### Using Rules & Plugins
331
394
 
332
395
  Similar to `eslint`, use `alint.config.ts` for files, ignores, plugins, and rules:
@@ -462,6 +525,8 @@ export default defineConfig([
462
525
 
463
526
  `alint` caches rule target results by default in `.alintcache` to avoid repeating LLM calls for unchanged source targets.
464
527
 
528
+ After each cacheable rule job completes, `alint` writes a cache checkpoint before releasing that job's scheduler slot. Each checkpoint atomically replaces the complete cache file, so an interrupted run can reuse every result that had already become durable. Cache hits, skipped jobs, failed jobs, and rules that opt out of caching do not add checkpoint writes. Any checkpoint or final cache write error causes the run to fail.
529
+
465
530
  > [!NOTE]
466
531
  > `.alintcache` should not be committed to Git. Add it to `.gitignore` before running repeated local analysis.
467
532
 
@@ -593,6 +658,7 @@ defineRule({
593
658
  | [`@alint-js/core`](https://github.com/moeru-ai/alint/tree/main/packages/core) | SDK and run engine for plugins, rules, source runtime, model resolution, diagnostics, cache, and agent contracts. |
594
659
  | [`@alint-js/agent-apeira`](https://github.com/moeru-ai/alint/tree/main/packages/agent-apeira) | Apeira-backed `AgentAdapter`. |
595
660
  | [`@alint-js/agent-pi`](https://github.com/moeru-ai/alint/tree/main/packages/agent-pi) | Pi-backed `AgentAdapter`. |
661
+ | [`@alint-js/languages`](https://github.com/moeru-ai/alint/tree/main/packages/languages) | First-party language support beyond core's built-in JavaScript and TypeScript: Go, Python, and Rust. |
596
662
  | [`@alint-js/plugin-example`](https://github.com/moeru-ai/alint/tree/main/packages/plugin-example) | Example TypeScript/JavaScript model-backed rules. |
597
663
  | [`@alint-js/plugin-example-agent`](https://github.com/moeru-ai/alint/tree/main/packages/plugin-example-agent) | Example plugin for framework-agnostic agentic rules. |
598
664
  | [`@alint-js/plugin-example-go`](https://github.com/moeru-ai/alint/tree/main/packages/plugin-example-go) | Example semantic Go review plugin using `plaintext`. |
@@ -630,15 +696,16 @@ pnpm lint
630
696
 
631
697
  ## License
632
698
 
699
+
633
700
  MIT
634
701
 
635
- [npm-version-src]: https://img.shields.io/npm/v/@alint-js/cli?style=flat&colorA=080f12&colorB=1fa669
636
- [npm-version-href]: https://npmjs.com/package/@alint-js/cli
637
- [npm-downloads-src]: https://img.shields.io/npm/dm/@alint-js/core?style=flat&colorA=080f12&colorB=1fa669
638
- [npm-downloads-href]: https://npmjs.com/package/@alint-js/core
639
- [bundle-src]: https://img.shields.io/bundlephobia/minzip/@alint-js/cli?style=flat&colorA=080f12&colorB=1fa669&label=minzip
702
+ [npmx-version-src]: https://npmx.dev/api/registry/badge/version/@alint-js/cli
703
+ [npmx-version-href]: https://npmx.dev/@alint-js/cli
704
+ [npmx-downloads-src]: https://npmx.dev/api/registry/badge/downloads-month/@alint-js/cli
705
+ [npmx-downloads-href]: https://npmx.dev/@alint-js/cli
706
+ [bundle-src]: https://npmx.dev/api/registry/badge/size/@alint-js/cli
640
707
  [bundle-href]: https://bundlephobia.com/result?p=@alint-js/cli
641
- [license-src]: https://img.shields.io/github/license/moeru-ai/alint.svg?style=flat&colorA=080f12&colorB=1fa669
708
+ [license-src]: https://npmx.dev/api/registry/badge/license/@alint-js/cli
642
709
  [license-href]: https://github.com/moeru-ai/alint/blob/main/LICENSE
643
710
  [jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
644
711
  [jsdocs-href]: https://www.jsdocs.io/package/@alint-js/cli
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as executeCli } from "../cli-ChymU1Wr.mjs";
2
+ import { t as executeCli } from "../cli-cQihuHqx.mjs";
3
3
  import process from "node:process";
4
4
  //#region src/bin/index.ts
5
5
  executeCli(process.argv, {