@visulima/vis 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (147) hide show
  1. package/CHANGELOG.md +830 -14
  2. package/LICENSE.md +7667 -0
  3. package/README.md +322 -19
  4. package/dist/bin.js +1 -146
  5. package/dist/config/index.d.ts +2795 -0
  6. package/dist/config/index.js +1 -0
  7. package/dist/generate/index.d.ts +157 -0
  8. package/dist/generate/index.js +1 -0
  9. package/dist/packem_chunks/bin.js +1295 -0
  10. package/dist/packem_chunks/config.js +19 -0
  11. package/dist/packem_chunks/doctor-probe.js +2 -0
  12. package/dist/packem_chunks/fix.js +11 -0
  13. package/dist/packem_chunks/handler.js +1 -0
  14. package/dist/packem_chunks/handler10.js +1 -0
  15. package/dist/packem_chunks/handler11.js +5 -0
  16. package/dist/packem_chunks/handler12.js +1 -0
  17. package/dist/packem_chunks/handler13.js +27 -0
  18. package/dist/packem_chunks/handler14.js +5 -0
  19. package/dist/packem_chunks/handler15.js +1 -0
  20. package/dist/packem_chunks/handler16.js +1 -0
  21. package/dist/packem_chunks/handler17.js +1 -0
  22. package/dist/packem_chunks/handler18.js +1 -0
  23. package/dist/packem_chunks/handler19.js +1 -0
  24. package/dist/packem_chunks/handler2.js +2 -0
  25. package/dist/packem_chunks/handler20.js +5 -0
  26. package/dist/packem_chunks/handler21.js +2 -0
  27. package/dist/packem_chunks/handler22.js +2 -0
  28. package/dist/packem_chunks/handler23.js +18 -0
  29. package/dist/packem_chunks/handler24.js +1 -0
  30. package/dist/packem_chunks/handler25.js +1 -0
  31. package/dist/packem_chunks/handler26.js +5 -0
  32. package/dist/packem_chunks/handler27.js +1 -0
  33. package/dist/packem_chunks/handler28.js +3 -0
  34. package/dist/packem_chunks/handler29.js +1 -0
  35. package/dist/packem_chunks/handler3.js +4 -0
  36. package/dist/packem_chunks/handler30.js +7 -0
  37. package/dist/packem_chunks/handler31.js +33 -0
  38. package/dist/packem_chunks/handler32.js +3 -0
  39. package/dist/packem_chunks/handler33.js +1 -0
  40. package/dist/packem_chunks/handler34.js +26 -0
  41. package/dist/packem_chunks/handler35.js +3 -0
  42. package/dist/packem_chunks/handler36.js +7 -0
  43. package/dist/packem_chunks/handler37.js +22 -0
  44. package/dist/packem_chunks/handler38.js +428 -0
  45. package/dist/packem_chunks/handler39.js +6 -0
  46. package/dist/packem_chunks/handler4.js +8 -0
  47. package/dist/packem_chunks/handler40.js +24 -0
  48. package/dist/packem_chunks/handler41.js +10 -0
  49. package/dist/packem_chunks/handler42.js +153 -0
  50. package/dist/packem_chunks/handler43.js +25 -0
  51. package/dist/packem_chunks/handler44.js +24 -0
  52. package/dist/packem_chunks/handler45.js +213 -0
  53. package/dist/packem_chunks/handler46.js +3 -0
  54. package/dist/packem_chunks/handler47.js +27 -0
  55. package/dist/packem_chunks/handler48.js +167 -0
  56. package/dist/packem_chunks/handler49.js +34 -0
  57. package/dist/packem_chunks/handler5.js +1 -0
  58. package/dist/packem_chunks/handler6.js +1 -0
  59. package/dist/packem_chunks/handler7.js +1 -0
  60. package/dist/packem_chunks/handler8.js +1 -0
  61. package/dist/packem_chunks/handler9.js +2 -0
  62. package/dist/packem_chunks/heal-accept.js +10 -0
  63. package/dist/packem_chunks/heal.js +14 -0
  64. package/dist/packem_chunks/help-command.js +18 -0
  65. package/dist/packem_chunks/index.js +7 -0
  66. package/dist/packem_chunks/keys-refresh.js +4 -0
  67. package/dist/packem_chunks/list.js +3 -0
  68. package/dist/packem_chunks/loader.js +1 -0
  69. package/dist/packem_chunks/prune.js +3 -0
  70. package/dist/packem_chunks/run.js +1 -0
  71. package/dist/packem_chunks/status.js +2 -0
  72. package/dist/packem_chunks/sync.js +2 -0
  73. package/dist/packem_chunks/sync2.js +2 -0
  74. package/dist/packem_chunks/tar.js +3 -0
  75. package/dist/packem_chunks/tripwire.js +2 -0
  76. package/dist/packem_shared/advisories-DsynpacV.js +1 -0
  77. package/dist/packem_shared/ai-analysis-uYuTIIXi.js +68 -0
  78. package/dist/packem_shared/ai-cache-DuwHYx2O.js +1 -0
  79. package/dist/packem_shared/ai-fix-DzrA-dVz.js +43 -0
  80. package/dist/packem_shared/applyDefaults-BOVDw1jD.js +1 -0
  81. package/dist/packem_shared/build-scripts-DsWMSWDs.js +1 -0
  82. package/dist/packem_shared/cache-directory-DQak1Vjc.js +1 -0
  83. package/dist/packem_shared/cyclonedx-CiHXuG8M.js +4 -0
  84. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  85. package/dist/packem_shared/dependency-scan-DC3nAFHS.js +1 -0
  86. package/dist/packem_shared/docker-B-CIN_nj.js +60 -0
  87. package/dist/packem_shared/failure-log-C3LEMmkq.js +2 -0
  88. package/dist/packem_shared/flakiness-Dq6K4ymq.js +1 -0
  89. package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
  90. package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +1 -0
  91. package/dist/packem_shared/index-DH-5hsrC.js +1 -0
  92. package/dist/packem_shared/lifecycle-Dv3nAtoD.js +2 -0
  93. package/dist/packem_shared/lockfile-C5DYMHVq.js +1 -0
  94. package/dist/packem_shared/manifests-B0fMp872.js +1 -0
  95. package/dist/packem_shared/min-release-age-BFozFonQ.js +34 -0
  96. package/dist/packem_shared/native-config-sync-Dvi1g2nQ.js +21 -0
  97. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  98. package/dist/packem_shared/registry-keys-CewRFW0e.js +1 -0
  99. package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +5 -0
  100. package/dist/packem_shared/run-summary-utils-BaBGP3bo.js +1 -0
  101. package/dist/packem_shared/runtime-check-BusAwPb2.js +1 -0
  102. package/dist/packem_shared/scan-progress-CMynp3eA.js +2 -0
  103. package/dist/packem_shared/selectors-B2ISH581.js +3 -0
  104. package/dist/packem_shared/signatures-5ZdjJ2Pu.js +2 -0
  105. package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
  106. package/dist/packem_shared/toolchain-Cc3cwyLP.js +5 -0
  107. package/dist/packem_shared/typosquats-BCeR-sLf.js +1 -0
  108. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
  109. package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
  110. package/dist/packem_shared/verify-07kUNTuP.js +1 -0
  111. package/dist/packem_shared/vis-update-app-CFrlJ3mW.js +1 -0
  112. package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
  113. package/index.d.ts +358 -0
  114. package/index.js +609 -0
  115. package/package.json +57 -22
  116. package/schemas/project.schema.json +872 -0
  117. package/schemas/vis-config.schema.json +4306 -0
  118. package/skills/vis/SKILL.md +96 -0
  119. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  120. package/templates/buildkite-ci/template.yml +20 -0
  121. package/dist/ai-analysis.d.ts +0 -40
  122. package/dist/ai-cache.d.ts +0 -21
  123. package/dist/bin.d.ts +0 -1
  124. package/dist/catalog.d.ts +0 -110
  125. package/dist/commands/affected.d.ts +0 -3
  126. package/dist/commands/ai.d.ts +0 -3
  127. package/dist/commands/analyze.d.ts +0 -3
  128. package/dist/commands/check.d.ts +0 -3
  129. package/dist/commands/graph.d.ts +0 -3
  130. package/dist/commands/hook/constants.d.ts +0 -8
  131. package/dist/commands/hook/index.d.ts +0 -3
  132. package/dist/commands/hook/install.d.ts +0 -7
  133. package/dist/commands/hook/migrate.d.ts +0 -27
  134. package/dist/commands/hook/uninstall.d.ts +0 -3
  135. package/dist/commands/migrate/constants.d.ts +0 -12
  136. package/dist/commands/migrate/deps.d.ts +0 -32
  137. package/dist/commands/migrate/index.d.ts +0 -3
  138. package/dist/commands/migrate/json.d.ts +0 -20
  139. package/dist/commands/migrate/lint-staged.d.ts +0 -62
  140. package/dist/commands/migrate/types.d.ts +0 -20
  141. package/dist/commands/run.d.ts +0 -3
  142. package/dist/commands/staged.d.ts +0 -3
  143. package/dist/commands/update.d.ts +0 -3
  144. package/dist/config.d.ts +0 -40
  145. package/dist/config.js +0 -1
  146. package/dist/package-manager.d.ts +0 -23
  147. package/dist/workspace.d.ts +0 -58
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  </a>
8
8
 
9
- <h3 align="center">A CLI task runner for monorepo workspaces</h3>
9
+ <h3 align="center">A monorepo dev toolkit — task runner, remote caching, security scanning, git hooks, and AI agent integrations — powered by @visulima/task-runner</h3>
10
10
 
11
11
  <!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
12
12
 
@@ -36,16 +36,59 @@
36
36
 
37
37
  ## Features
38
38
 
39
- - **Workspace-aware**: Automatically discovers projects from `pnpm-workspace.yaml` or `package.json` workspaces
40
- - **Task caching**: Powered by `@visulima/task-runner` with local and remote caching support
41
- - **Dependency-aware scheduling**: Runs tasks in topological order with configurable parallelism
42
- - **Affected detection**: Only runs tasks for projects changed since a given git ref
43
- - **Catalog management**: Check and update dependencies in pnpm/bun workspace catalogs
44
- - **Security scanning**: Check for known vulnerabilities via OSV.dev
45
- - **Graph visualization**: View your project dependency graph in ASCII, DOT, JSON, or HTML
46
- - **Git hooks**: Install, manage, and migrate git hooks (husky migration supported)
47
- - **Configurable**: `vis.json` for target defaults, cache settings, and task runner options
48
- - **Built on Cerebro**: Uses `@visulima/cerebro` for a robust CLI experience with built-in help, version, and completion
39
+ ### Built for AI agents
40
+
41
+ - **MCP server** — `@visulima/vis-mcp` exposes 8 read-only introspection tools to Claude / Cursor / Copilot (project graph, target list, run logs, cache-why, template schema), plus a paired Claude Skill that documents optimal usage
42
+ - **`vis ai heal`** reads failing tasks, asks the configured AI provider for a structured patch, validates by re-running, posts a markdown comment to the PR/MR. `/vis heal accept` from an allow-listed maintainer lands the fix as a signed commit (GitHub Actions, GitLab CI, Buildkite)
43
+ - **Worktree-aware shared cache** N parallel agents in N sibling git worktrees automatically share one cache instead of rebuilding the same hash N times
44
+
45
+ ### Production-grade caching
46
+
47
+ - **REAPI gRPC + HTTP backends** — drop-in support for [bazel-remote](https://github.com/buchgr/bazel-remote), BuildBuddy, BuildBarn, EngFlow alongside Turbo-compatible HTTP. `vis cache doctor` probes reachability, capabilities, and latency for CI gating
48
+ - **`vis cache why <task>`** — diff hash buckets (`command`, `nodes`, `runtime`, `implicitDeps`) against the previous run to pinpoint exactly what rotated the hash
49
+ - **HMAC-SHA256 signed artifacts** — `verifyOnDownload` locks production caches against tampering with constant-time comparison
50
+ - **Cache restoration fidelity** — preserves mtime + permission bits + colorized output; `vis cache verify <task>` flags drift between cached archive and live workspace
51
+ - **Retention controls** — `vis cache prune --keep-last/--max-age-days/--max-size`
52
+
53
+ ### Cross-invocation devloop
54
+
55
+ - **`vis service start|stop|list`** — long-lived DB / mock / devserver lifecycle that survives across `vis run` calls within a shell session; auto-attached when targets declare `service:` in their config (no more "I keep restarting Postgres between every test run")
56
+ - **`vis run --watch`** — Vitest-style keybinds (`r/Enter/a/p/q/Ctrl+C/h/?`), Windows-clean SIGINT
57
+ - **`vis run --output-style=quiet`** — swallow stdout from successful and cached tasks, keep failures fully visible
58
+
59
+ ### Workspace orchestration
60
+
61
+ - **Workspace-aware** — discovers projects from `pnpm-workspace.yaml`, `package.json` workspaces, and bun
62
+ - **Topological scheduling** with configurable parallelism and runner-tag filtering
63
+ - **Affected detection** — `vis affected <target>`, plus `${affected.files}` / `$AFFECTED_FILES` token forwarding to the underlying script
64
+ - **Conditional + finally tasks** — `when:` (os/env/branch/ci) and top-level `always: true`
65
+ - **Per-package overlay + extends chain** — root `vis-config.ts` + per-project `vis.task.ts`, with bare-specifier preset resolution
66
+ - **Inferred targets** (Project Crystal-style) — optional synthesis of `build`/`test`/`dev`/`lint`/`format` from 36 tools (Vite, Vitest, Next, Nuxt, packem, ESLint, Biome, Prisma, …). Opt in with `inferTargets: true`; explicit scripts and `project.json`/`vis.task.ts` overrides always win
67
+ - **URI-based input format** — `inputs` accepts `file://`, `glob://`, `env://`, `func://`, `dep://` strings as forward-compat sugar
68
+ - **Plugin / fingerprint hooks** — 14 typed hooks via `definePlugin` (lifecycle, streaming, retry, fingerprint, services), built on `hookable`
69
+ - **Strict env mode** — `--strict-env` extracts `${VAR}` references from each command and fails the task if any are unset
70
+ - **Lockfile preflight** — warns in TTY, hard-fails in CI when the lockfile is newer than the install marker
71
+ - **Project graph** — view dependencies in ASCII, DOT, JSON, or HTML
72
+
73
+ ### Adjacent tooling that ships in-box
74
+
75
+ - **`vis catalog check / update`** — pnpm + bun workspace catalog management
76
+ - **`vis secrets`** — Rust-native secret scanning (gitleaks detection engine)
77
+ - **`vis audit`** — OSV.dev vulnerability scanning
78
+ - **`vis docker scaffold`** — lockfile pruning for pnpm / npm / yarn classic + berry / bun, matching turbo's killer Docker-cache feature
79
+ - **`vis hook install / migrate`** — git hooks (husky migration supported)
80
+ - **`vis staged`** — built-in `lint-staged` replacement, no peer dependency
81
+ - **`vis migrate gitleaks|secretlint`** — incremental migration paths
82
+ - **`vis replay <runId>`** — re-render any past run summary without re-execution
83
+
84
+ ### Toolchain & runtime
85
+
86
+ - **Pluggable installer** — defaults to the lockfile-detected PM (pnpm/npm/yarn/bun); auto-uses [aube](https://github.com/endevco/aube) when on `PATH`, with a single switch (`install.backend` / `--installer` / `--no-aube`) to pin or bypass it
87
+ - **Cold-start one-liner** — `curl -fsSL https://visulima.com/install.sh | bash` (Linux/macOS/WSL) or PowerShell equivalent installs a version manager, Node LTS, and `vis`
88
+ - **`vis toolchain`** — delegates to proto / mise / fnm / volta
89
+ - **Built on Cerebro** — robust CLI with built-in help, version, and shell completion
90
+
91
+ > **New to vis?** See [Why vis vs. Vite Task / Turbo / Nx / moon](./docs/guides/why-vis.mdx) for the side-by-side capability matrix.
49
92
 
50
93
  ## Install
51
94
 
@@ -61,6 +104,24 @@ yarn add @visulima/vis
61
104
  pnpm add @visulima/vis
62
105
  ```
63
106
 
107
+ ### Cold start (no Node? no manager?)
108
+
109
+ One-liner bootstrap that installs a version manager, Node LTS, and `vis` in one go.
110
+
111
+ **Linux / macOS / WSL** (bash):
112
+
113
+ ```sh
114
+ curl -fsSL https://visulima.com/install.sh | bash
115
+ ```
116
+
117
+ **Windows** (PowerShell 5.1+):
118
+
119
+ ```powershell
120
+ irm https://visulima.com/install.ps1 | iex
121
+ ```
122
+
123
+ Pass `--yes --manager=proto` (POSIX) or `-Yes -Manager proto` (PowerShell) for non-interactive / CI usage. See [`vis toolchain` docs](./docs/commands/toolchain.mdx#cold-start--no-node-no-manager) for details.
124
+
64
125
  ## Quick Start
65
126
 
66
127
  ```bash
@@ -86,16 +147,240 @@ vis update --interactive
86
147
  vis hook install
87
148
  ```
88
149
 
150
+ ## Installer backend (aube)
151
+
152
+ `vis install`, `vis add`, `vis remove`, `vis update`, `vis dlx`, `vis exec`, `vis link`, `vis unlink`, `vis dedupe`, `vis why`, `vis outdated`, `vis info`, and `vis pm` honor [aube](https://github.com/endevco/aube) — a Rust-native package manager that reads and writes pnpm/npm/yarn/bun lockfiles in place — as a drop-in installer. Aube also supports the pnpm `catalog:` and `catalog:<name>` protocol from `pnpm-workspace.yaml`, including walk-up resolution from subpackages.
153
+
154
+ `vis` does not bundle aube. Install it once via your tool of choice and `vis` will auto-detect it on `PATH`:
155
+
156
+ ```bash
157
+ npm install -g @endevco/aube # or
158
+ mise use -g aube # or
159
+ brew install endevco/tap/aube
160
+ ```
161
+
162
+ Resolution precedence (highest first):
163
+
164
+ 1. `--installer <name>` CLI flag — `auto`, `aube`, `pnpm`, `npm`, `yarn`, or `bun` (or `--no-aube` to force the lockfile-detected PM for a single run; `--no-aube` wins over every other source).
165
+ 2. `VIS_INSTALLER` environment variable — same accepted values as the flag.
166
+ 3. `install.backend` in `vis.config.ts` — same accepted values; the team-wide pin.
167
+ 4. Auto-detect — `aube` when it's on `PATH`, otherwise the lockfile-detected PM (`pnpm-lock.yaml` → pnpm, `package-lock.json` → npm, `yarn.lock` → yarn, `bun.lockb` → bun).
168
+
169
+ Each step is consulted in order; the first one that resolves to a concrete backend wins. Picking an explicit value (`pnpm`, `npm`, …) at any level always beats the auto-detect step below it, so you can override the team default for a single shell session via `VIS_INSTALLER=pnpm vis install` without touching the config file.
170
+
171
+ ```ts
172
+ // vis.config.ts — pin the installer for the team
173
+ import { defineConfig } from "@visulima/vis/config";
174
+
175
+ export default defineConfig({
176
+ install: { backend: "aube" }, // "auto" | "aube" | "pnpm" | "npm" | "yarn" | "bun"
177
+ });
178
+ ```
179
+
180
+ ### Lockfile drift
181
+
182
+ Aube reuses pnpm/npm/yarn/bun lockfile formats but its serialized output isn't byte-identical to the original tool's. The first install on a workspace whose lockfile was written by another PM produces a one-time churn diff; teams that mix tools on the same lockfile see ongoing drift. `vis install` warns when this is about to happen — pin `install.backend` to keep the team consistent.
183
+
184
+ ### Lifecycle scripts
185
+
186
+ Aube already skips dependency lifecycle scripts by default. `--ignore-scripts` is a no-op under aube (`vis install` warns when you pass it). To opt specific packages back in, run `aube approve-builds` — the inverse direction from the pnpm/npm `--ignore-scripts` model.
187
+
89
188
  ## Commands
90
189
 
91
- | Command | Alias | Description |
92
- | ----------------------- | ----- | ----------------------------------------------------- |
93
- | `vis run <target>` | | Run a target across workspace projects with caching |
94
- | `vis affected <target>` | | Run tasks only on projects affected by git changes |
95
- | `vis graph` | | Visualize the project dependency graph |
96
- | `vis check [packages]` | `c` | Check for outdated dependencies in workspace catalogs |
97
- | `vis update [packages]` | `up` | Update packages to their latest versions |
98
- | `vis hook <action>` | | Manage git hooks (install, uninstall, migrate) |
190
+ | Command | Alias | Description |
191
+ | ----------------------- | ------ | -------------------------------------------------------------------- |
192
+ | `vis create [template]` | | Scaffold a new project from templates, npm packages, or git repos |
193
+ | `vis generate [name]` | | Scaffold files from an in-repo template (native TS or moon-format) |
194
+ | `vis init` | | Initialize vis.config.ts with security defaults |
195
+ | `vis run <target>` | | Run a target across workspace projects with caching |
196
+ | `vis affected <target>` | | Run tasks only on projects affected by git changes |
197
+ | `vis ignore <project>` | | CI build gating for Vercel / Netlify "Ignored Build Step" |
198
+ | `vis graph` | | Visualize the project dependency graph |
199
+ | `vis check [packages]` | `c` | Check for outdated dependencies in workspace catalogs |
200
+ | `vis update [packages]` | `up` | Update packages to their latest versions |
201
+ | `vis install` | `i` | Install dependencies via the detected package manager |
202
+ | `vis info <package>` | `view` | Show npm registry metadata for a package (wraps `npm view` et al.) |
203
+ | `vis dlx <package>` | | Execute a remote package without permanent installation |
204
+ | `vis audit` | | Audit dependencies for security vulnerabilities |
205
+ | `vis clean` | | Remove build artifacts, caches, and node_modules |
206
+ | `vis cache <action>` | | Inspect cache (`list`, `size`, `hash`, `why`), or `prune` / `clean` |
207
+ | `vis hook <action>` | | Manage git hooks (install, uninstall, migrate) |
208
+ | `vis secrets [paths]` | | Scan for hardcoded secrets / credentials (Rust-native) |
209
+ | `vis toolchain <cmd>` | | Inspect / delegate to the version manager (proto, mise, fnm, volta…) |
210
+ | `vis staged` | | Run tasks on staged files (built-in `lint-staged` replacement) |
211
+ | `vis migrate <type>` | | Migrate from other tools — now including `gitleaks` and `secretlint` |
212
+
213
+ For `vis ignore`, see the [command reference](./docs/commands/ignore.mdx) and the [deployment build gating section](./docs/guides/ci-cd.mdx#deployment-build-gating) of the CI/CD guide.
214
+
215
+ ### Diagnosing cache misses
216
+
217
+ When a task you expected to be cached re-ran, ask vis what changed:
218
+
219
+ ```sh
220
+ vis cache why @myorg/app:build # human-friendly diff vs. previous run
221
+ vis cache why @myorg/app:build --json # stable shape for CI
222
+ vis cache hash @myorg/app:build # just print the hash + per-bucket inputs
223
+ ```
224
+
225
+ `vis cache why` reads `.task-runner/last-summary.json` and diffs the task's `hashDetails` (`command`, `nodes`, `runtime`, `implicitDeps`) against the previous run, so you can pinpoint exactly which bucket rotated. Past runs only land in `.task-runner/runs/` when you pass `--summarize`, so use `vis run :build --summarize` (or set it as a default in CI) for diffs you'll want to inspect later.
226
+
227
+ ### Cache retention
228
+
229
+ `vis cache prune` evicts entries by any combination of age, total size, and count:
230
+
231
+ ```sh
232
+ vis cache prune --max-age-days=7 # drop entries older than a week
233
+ vis cache prune --max-size=2GB # evict oldest until under 2 GB
234
+ vis cache prune --keep-last=30 # keep only the 30 newest entries
235
+ vis cache prune --keep-last=30 --max-age-days=14 # combine: 30-newest floor, then age cap
236
+ ```
237
+
238
+ `--keep-last` enforces a count floor first (newest-first by mtime), then `--max-age-days` and `--max-size` apply.
239
+
240
+ ### Sharing the cache across git worktrees
241
+
242
+ When the workspace is a linked worktree (created with `git worktree add`), vis stores the cache at `<mainWorktreeRoot>/.task-runner-cache` so sibling worktrees driven by parallel agents share one cache instead of rebuilding the same hash N times. Set `sharedWorktreeCache: false` in `vis.config.ts` to opt out, or use `--scope=worktree|shared|all` on `vis cache list/size/prune` to inspect or operate on a specific store.
243
+
244
+ ### Quieting successful runs
245
+
246
+ `--output-style=quiet` skips stdout/stderr from successful and cached tasks while keeping failures fully visible. Pair it with per-target `options.outputStyle` to mute a single noisy task — or to keep one critical task verbose under a global quiet flag:
247
+
248
+ ```sh
249
+ vis run :build --output-style=quiet # only failures print
250
+ ```
251
+
252
+ ```json
253
+ {
254
+ "targets": {
255
+ "lint": { "options": { "outputStyle": "quiet" } },
256
+ "migrate": { "options": { "outputStyle": "normal" } }
257
+ }
258
+ }
259
+ ```
260
+
261
+ See the [`vis cache`](./docs/commands/cache.mdx) and [`vis run`](./docs/commands/run.mdx) command references for the full surface.
262
+
263
+ ### Scanning for secrets
264
+
265
+ `vis secrets` wraps [`@visulima/secret-scanner`](../secret-scanner) — a Rust port of the gitleaks detection engine — with ergonomic flags for the common workflows.
266
+
267
+ ```sh
268
+ vis secrets # scan the workspace (grouped, colourised output)
269
+ vis secrets --staged # pre-commit mode: scan staged files only
270
+ vis secrets --since main # scan files changed since the `main` branch
271
+ vis secrets --affected # scan only files affected by the current branch
272
+ vis secrets --init # scaffold an initial .secrets-baseline.json
273
+ vis secrets --list-rules # print all bundled detection rules
274
+ vis secrets --enable-rule tag:preset:weak-passwords # enable an opt-in rule group additively
275
+ vis secrets --exclude 'dist/**' --exclude-from .secretsignore # extra walker exclusions
276
+ vis secrets --include-rule stripe-access-token # check a single rule
277
+ vis secrets --exclude-rule generic-api-key # drop a noisy rule
278
+ vis secrets --baseline .secrets-baseline.json # suppress triaged findings; print diff
279
+ vis secrets --update-baseline # merge current findings into the baseline
280
+ vis secrets --format sarif > report.sarif # SARIF for GitHub code-scanning
281
+ ```
282
+
283
+ **Suppression** — inline (`// gitleaks:allow`), block (`gitleaks:allow-start` … `gitleaks:allow-end`), or a baseline JSON (sole fingerprint store). See the [secret-scanner README](../secret-scanner/README.md#suppression) for details.
284
+
285
+ **CI example** (GitHub Actions, SARIF upload):
286
+
287
+ ```yaml
288
+ name: Secrets
289
+ on: [push, pull_request]
290
+ jobs:
291
+ scan:
292
+ runs-on: ubuntu-latest
293
+ permissions: { security-events: write, contents: read }
294
+ steps:
295
+ - uses: actions/checkout@v4
296
+ - uses: pnpm/action-setup@v4
297
+ - run: pnpm install
298
+ - run: pnpm vis secrets --format sarif > report.sarif
299
+ continue-on-error: true
300
+ - uses: github/codeql-action/upload-sarif@v3
301
+ with: { sarif_file: report.sarif }
302
+ ```
303
+
304
+ ### Migrations
305
+
306
+ `vis migrate` now speaks two security tools:
307
+
308
+ ```sh
309
+ vis migrate gitleaks # keeps gitleaks.toml, rewrites scripts/hooks to `vis secrets`
310
+ vis migrate secretlint # removes @secretlint/*, rewrites scripts/hooks, notes active rules
311
+ ```
312
+
313
+ Every destructive step writes a `.bak` sidecar first and prompts for confirmation (skip with `-y`). Dry-run previews are available via `--dry-run`.
314
+
315
+ ### Running tasks on staged files
316
+
317
+ `vis staged` is a built-in replacement for `lint-staged` — the same config shape, no peer dependency, and an integrated task renderer. Requires Git ≥ 2.32.
318
+
319
+ Declare the patterns and tasks under `staged` in `vis.config.ts`:
320
+
321
+ ```ts
322
+ // vis.config.ts
323
+ import { defineConfig } from "@visulima/vis/config";
324
+
325
+ export default defineConfig({
326
+ staged: {
327
+ "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
328
+ "*.md": "prettier --write",
329
+ "package.json": (files) => `sort-package-json ${files.join(" ")}`,
330
+ },
331
+ });
332
+ ```
333
+
334
+ Each key is a glob (basename or path-style — path-style matches resolve relative to `cwd`). Each value is one of:
335
+
336
+ - a command string — split into argv, invoked with matched files appended;
337
+ - a `string[]` array — commands run serially for that pattern;
338
+ - a function `(files) => string | string[] | {title, task}` — generate dynamic commands or a custom task;
339
+ - a `{ title, task }` object — runs `task(files)` with no argv construction, useful for in-process side effects.
340
+
341
+ `vis.config.ts` is the single source of truth — no standalone `.lintstagedrc*` or `.vis-staged.*` files are read at runtime. Migrating from lint-staged or nano-staged? Run `vis migrate lint-staged` (or `vis migrate nano-staged`) to move the config in and remove the legacy files.
342
+
343
+ #### Command-line flags
344
+
345
+ ```sh
346
+ vis staged # run tasks on the current staged set
347
+ vis staged --verbose # show stdout/stderr on success as well as failure
348
+ vis staged --no-stash # skip the backup stash (faster, but no recovery on failure)
349
+ vis staged --diff HEAD~1 # operate on a range instead of `--staged`
350
+ vis staged --diff-filter=ACM # override the default ACMR filter
351
+ vis staged --concurrent 4 # cap parallel pattern execution
352
+ vis staged --continue-on-error # don't short-circuit on the first failure
353
+ vis staged --fail-on-changes # non-zero exit if tasks modified staged content
354
+ vis staged --hide-unstaged # hide all unstaged edits on tracked files
355
+ vis staged --hide-all # hide unstaged edits AND untracked files
356
+ vis staged --relative # pass paths relative to cwd to tasks
357
+ vis staged --revert # restore pre-task state on failure
358
+ vis staged --allow-empty # allow a commit when tasks revert everything
359
+ vis staged --auto-stage # auto-stage new files tasks create (codegen, lockfile regen, …)
360
+ vis staged --force-kill # kill in-flight tasks with SIGKILL on fast-fail (default: SIGTERM)
361
+ ```
362
+
363
+ #### Environment variables
364
+
365
+ | Variable | Description |
366
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
367
+ | `VIS_STAGED_CONCURRENT` | Concurrency fallback when `--concurrent` is not passed. Same value shape as the flag (`true`, `false`, or an integer). Useful in CI so you don't repeat the flag on every invocation. |
368
+
369
+ #### How it behaves
370
+
371
+ 1. A hidden backup stash is created (via `git stash create` + `git stash store`, so the working tree is untouched).
372
+ 2. For partially-staged files, the unstaged delta is captured as a patch and the working tree is reset to the staged content. `--hide-all` extends this to every unstaged change _and_ untracked files via a single `git stash push --include-untracked`.
373
+ 3. Tasks run — patterns in parallel (capped at `os.availableParallelism()` by default), commands within a pattern serially.
374
+ 4. Task-driven edits are re-staged with `git update-index --again` (with a `git add -u` fallback for deletions), so commits made via pathspec (`git commit -m "…" .`) keep working.
375
+ 5. The unstaged patch — or the hide-all stash — is re-applied and the backup stash is dropped on success. On failure without `--revert`, the backup stash is preserved and the recovery sha is surfaced to the user. Ctrl+C aborts in-flight commands and still runs the restore path; a second Ctrl+C exits immediately.
376
+
377
+ #### Migrating from lint-staged
378
+
379
+ ```sh
380
+ vis migrate lint-staged # moves the config into vis.config.ts and rewrites hooks
381
+ ```
382
+
383
+ The migrator detects `package.json` keys, `.lintstagedrc*` files, and `lint-staged.config.*`, prompts before rewriting husky/vis hooks to call `vis staged`, and removes `lint-staged` from the dependency list.
99
384
 
100
385
  ## Documentation
101
386
 
@@ -117,6 +402,24 @@ If you would like to help take a look at the [list of issues](https://github.com
117
402
  - [Daniel Bannert](https://github.com/prisis)
118
403
  - [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
119
404
 
405
+ ### Migration sources
406
+
407
+ `vis migrate` ports configuration, scripts, and hooks from the following projects. Huge thanks to their authors and maintainers for the prior art that shaped vis's surface area.
408
+
409
+ | Project | Migrates with | Replaces |
410
+ | ---------------------------------------------------------- | ------------------------- | --------------------------- |
411
+ | [Husky](https://github.com/typicode/husky) | `vis hook migrate` | Git hook manager |
412
+ | [lint-staged](https://github.com/lint-staged/lint-staged) | `vis migrate lint-staged` | Pre-commit task runner |
413
+ | [nano-staged](https://github.com/usmanyunusov/nano-staged) | `vis migrate nano-staged` | Pre-commit task runner |
414
+ | [Turborepo](https://github.com/vercel/turborepo) | `vis migrate turborepo` | Monorepo task runner |
415
+ | [Nx](https://github.com/nrwl/nx) | `vis migrate nx` | Monorepo task runner |
416
+ | [Moon](https://github.com/moonrepo/moon) | `vis migrate moon` | Monorepo task runner |
417
+ | [Gitleaks](https://github.com/gitleaks/gitleaks) | `vis migrate gitleaks` | Secret scanner |
418
+ | [Kingfisher](https://github.com/mongodb/kingfisher) | `vis migrate kingfisher` | Secret scanner (MongoDB) |
419
+ | [Secretlint](https://github.com/secretlint/secretlint) | `vis migrate secretlint` | Secret linter |
420
+ | [Syncpack](https://github.com/JamieMason/syncpack) | `vis migrate syncpack` | Workspace dependency policy |
421
+ | [Sherif](https://github.com/QuiiBz/sherif) | `vis migrate sherif` | Monorepo linter |
422
+
120
423
  ## Made with ❤️ at Anolilab
121
424
 
122
425
  This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!