Skip to main content

dev_prune/
help.rs

1// Copyright 2026 VKrishna04
2// SPDX-License-Identifier: Apache-2.0
3
4// The long-form help text: what `devp <command> --help` prints.
5//
6// `-h` stays short — one line per flag, no scrolling. `--help` (and `devp help
7// <command>`) gets these: the full description, the behaviour that is not obvious from
8// the flag list, and worked examples for every command and subcommand. The text is
9// kept in one file rather than inline in the derive so the CLI definition in `lib.rs`
10// stays readable, and because these paragraphs are documentation first — they carry
11// the same facts as `docs/CLI_REFERENCE.md`, and changing one means changing both.
12
13pub const INIT_LONG: &str = "\
14Crawl the given directory trees for Git repositories and register every one found, up \
15to 8 levels deep. Registration is one entry in dev-prune's own registry file — nothing \
16in the repository is created, changed or deleted.
17
18After registering, it runs the same integration pass as `devp setup` (installing \
19whatever is missing, reporting whatever it skipped) and the same quiet release check \
20as `devp update`.
21
22Registration is what makes a repository visible to `devp run`, `devp status` and the \
23background pass. Repositories are never auto-discovered at prune time: what dev-prune \
24touches is exactly what you registered.";
25
26pub const INIT_EXAMPLES: &str = "\
27EXAMPLES:
28  devp init                       Register repositories under the current directory
29  devp init ~/Code                Register everything under ~/Code
30  devp init ~/Code ~/Work/oss     Multiple trees in one pass
31  devp scan ~/Code                Same command — `scan` and `onboard` are aliases
32  DEV_PRUNE_NO_AUTO_SETUP=1 devp init ~/Code
33                                  Register repositories, install nothing
34
35UNDO:
36  devp undo                       Reverts the most recent init or link";
37
38pub const LINK_LONG: &str = "\
39Register one Git repository for pruning. The path defaults to `.`, so inside a \
40repository `devp link` is the whole command. Registration writes one entry to \
41dev-prune's registry; the repository itself is untouched.
42
43`--quiet` is the form the global Git hook invokes: it prints nothing (a hook fires \
44inside someone's commit, whose terminal is not dev-prune's to write to) and it skips \
45repositories whose `.devprune.json` sets `disable_hooks`, so a workspace that opted \
46out of auto-registration stays out.";
47
48pub const LINK_EXAMPLES: &str = "\
49EXAMPLES:
50  devp link                       Register the current directory
51  devp link ~/Code/my-app         Register a repository by path
52  devp link . --quiet             What the Git hook runs; silent, honours opt-outs
53
54UNDO:
55  devp undo                       Reverts the most recent init or link
56  devp unlink                     Unregister (keeps every file on disk)";
57
58pub const UNLINK_LONG: &str = "\
59Remove a repository from dev-prune's registry. This deletes the registry entry and \
60nothing else — no workspace file is touched, and the repository's `.devprune.json`, \
61if it has one, stays where it is.
62
63`--missing` removes every registered path whose directory no longer exists, instead \
64of one named repository. Deleted clones, reformatted drives and moved workspaces all \
65leave dead entries behind; `devp doctor` counts them in one warning and points here \
66rather than printing one `devp unlink` line per dead path.";
67
68pub const UNLINK_EXAMPLES: &str = "\
69EXAMPLES:
70  devp unlink                     Unregister the current directory
71  devp unlink ~/Code/old-app      Unregister a repository by path
72  devp unlink --missing           Drop every entry whose path no longer exists";
73
74pub const UNDO_LONG: &str = "\
75Revert the most recent `devp init` or `devp link`: whatever repositories that one \
76action registered are unregistered again. Only registration is undone — `undo` never \
77deletes files, and it is not the undo for a prune (that is `devp restore --last-run`).";
78
79pub const UNDO_EXAMPLES: &str = "\
80EXAMPLES:
81  devp undo                       Unregister whatever the last init/link registered
82
83RELATED:
84  devp restore --last-run         The undo for a prune pass — reinstalls what it deleted";
85
86pub const RUN_LONG: &str = "\
87Execute a prune pass: across every registered repository with no path, or on one \
88repository with `devp run <path>`. Each repository goes through the same gauntlet, \
89and a directory is deleted only when every check passes:
90
91  1. `ignore.devprune.json` in the root, or `\"ignore\": true` — skipped instantly.
92  2. Idle check: last commit and newest source mtime, against `idle_days` (15 by
93     default). `--ignore-idle` lifts this one check and nothing else.
94  3. Project discovery: the root and up to `scan_depth` levels below it (6 by
95     default), so a monorepo's every package is found.
96  4. The package manager's own binary must be present — a directory whose manager
97     is missing cannot be verified, so it is not touched.
98  5. Lockfile verification: the manager itself confirms the lockfile can rebuild
99     the directory. No flag bypasses this, and none ever will.
100  6. Size floor (`min_size_mb` / `--min-size`), symlink refusal, nested-repository
101     refusal.
102
103Interactively, a selection TUI shows what would be deleted before anything is; `-y` \
104skips the confirmation, and `--dry-run` reports what a pass would do without deleting \
105anything at all. Adapter names for `--only`/`--skip` are: npm, pnpm, yarn, bun, uv, \
106venv, poetry, pdm, pipenv, cargo, go, composer, bundler, cocoapods, mix, gradle, \
107maven, swift — an unknown name is an error listing the valid ones, not a silently \
108empty pass. cargo, gradle, maven and swift are opt-in (`devp config set \
109enable_cargo true`) and idle-gated separately by `build_idle_days`, because a \
110build directory takes far longer to get back than a dependency directory. \
111`devp config wizard` switches them on by language, and can give any one adapter \
112its own idle window.
113
114`--except` is the safe spelling of \"clean up but keep the API project\": the named \
115repositories are never verified, never deleted and never restored, which beats \
116pruning them and downloading everything back. Entries match by full path or by \
117directory name, case-insensitively, `~` expanded.
118
119`--explain` answers \"why was that repository not pruned?\": every repository and \
120directory is listed with its verdict, including the states a normal pass keeps quiet \
121about — still active (with the actual age), opted out, under the size floor. It is \
122read-only and cannot be combined with `--json`.";
123
124pub const RUN_EXAMPLES: &str = "\
125EXAMPLES:
126  devp run --dry-run              What would be pruned, and why the rest would not
127  devp run                        Prune across all registered repositories (asks first)
128  devp run -y                     Same, no confirmation prompt
129  devp run .                      Prune only the current repository
130  devp run ~/Code/my-app --ignore-idle -y
131                                  Prune it even though it was touched recently
132  devp run --except api-service,~/Code/playground
133                                  Everything except the ones you name
134  devp run --only cargo,uv --dry-run
135                                  Only these package managers
136  devp run --skip venv --min-size 50
137                                  Skip venvs; ignore directories under 50 MiB
138  devp run --json --dry-run       One JSON document on stdout (schema in CLI_REFERENCE)
139  devp run --explain              Why each repository would or would not be pruned
140
141Run interactively with a terminal, `--json` also copies the document to the clipboard.
142A run in which any repository failed exits 1, even if others succeeded.";
143
144pub const STATUS_LONG: &str = "\
145The dashboard: every registered repository with its state (Candidate, Active, \
146Ignored, No Bloat, Path Missing, or an unreadable `.devprune.json`), its reclaimable \
147space, and its last activity. In a terminal this is an interactive TUI; piped or \
148redirected it prints a plain table; `--json` replaces either with one document and \
149changes nothing at all.
150
151Sizes are what deleting the directory actually gives back: bytes hardlinked into a \
152pnpm or bun store are measured per file and excluded, because the store keeps them.
153
154TUI KEYS:
155  Up/Down, j/k      Move           PgUp/PgDn        Jump ten rows
156  Home/End, g/G     First/last     p                Prune-select mode (candidates pre-selected)
157  Space             Toggle row     a                Toggle all candidates
158  Enter             Prune the selection             i    Toggle ignore in .devprune.json
159  Esc               Leave mode / exit               q, Ctrl-C   Exit
160
161SHORTCUTS:
162  devp status daemon              = devp config daemon status
163  devp status . hook              = devp config hook . status";
164
165pub const STATUS_EXAMPLES: &str = "\
166EXAMPLES:
167  devp status                     The dashboard (TUI in a terminal, table when piped)
168  devp status --top 10            Only the ten biggest repositories; totals unaffected
169  devp status --drift             What would a prune refuse on, and how to record it
170  devp status --json | jq '.totals.reclaimable_bytes'
171                                  Machine-readable; stdout carries the document only
172  devp status --top 5 --json      The trim is reported as a top-level \"top\" field
173
174Run interactively with a terminal, `--json` also copies the document to the clipboard.";
175
176pub const STATS_LONG: &str = "\
177What dev-prune has already done, as opposed to what it could do next: lifetime space \
178reclaimed, how many prune passes there have been, the most recent pass and how to \
179undo it, the last passes, and the repositories that have given back the most. \
180Read-only — it reads the registry and touches nothing.";
181
182pub const STATS_EXAMPLES: &str = "\
183EXAMPLES:
184  devp stats                      The report
185  devp stats --json | jq '.lifetime.bytes_freed'
186                                  Lifetime bytes as a number
187
188Run interactively with a terminal, `--json` also copies the document to the clipboard.";
189
190pub const MAN_LONG: &str = "Render the manual, from the same clap definitions `--help` prints, so the manual cannot describe a flag the program does not have.
191
192`devp man` at a terminal prints the contents page: every command grouped by what it is for, one line each, plus the flags that go before the command and the exit codes. `devp man <command>` prints that one command's page — the same text `devp <command> --help` prints, because they are the same definition.
193
194The roff source is something `man` formats, not something a person reads, and on Windows there is no `man` to hand it to, so it appears only where something can use it: redirect or pipe the output and it is roff again, so `devp man > devp.1` and `devp man | man -l -` are unchanged. `--roff` forces roff at a terminal too.
195
196`--dir` writes the full set (`devp.1`, `dev-prune.1`, and one `devp-<command>.1` per subcommand) into a directory, ready to copy onto `manpath`.";
197
198pub const MAN_EXAMPLES: &str = "EXAMPLES:
199  devp man                        The contents page, on any platform
200  devp man run                    One command's page
201  devp man | man -l -             Read it formatted by man (Linux/macOS)
202  devp man --roff > devp.1        Save the roff source
203  devp man run --roff > devp-run.1   Save one page's roff source
204  devp man --dir ./man            Write the full set into ./man
205  sudo cp man/*.1 /usr/local/share/man/man1/   Install them system-wide";
206
207pub const COMPLETIONS_LONG: &str = "\
208Print a shell completion script to stdout — the script and nothing else, because the \
209output is meant to be redirected or eval'd and anything extra becomes a shell error \
210on every new terminal.
211
212The script is generated from the same argument definition the binary parses with, so \
213a flag cannot exist in one and be missing from the other. It completes whichever name \
214invoked it: `devp completions bash` completes `devp`, `dev-prune completions bash` \
215completes `dev-prune` — generate one for each name you actually type.";
216
217pub const COMPLETIONS_EXAMPLES: &str = "\
218EXAMPLES:
219  source <(devp completions bash)                       Bash, current shell
220  devp completions bash > ~/.local/share/bash-completion/completions/devp
221  devp completions zsh  > ~/.zfunc/_devp                Zsh (a directory on $fpath)
222  devp completions fish > ~/.config/fish/completions/devp.fish
223  devp completions powershell | Out-File -Append -Encoding utf8 $PROFILE
224                                                        PowerShell, permanently";
225
226pub const CACHES_LONG: &str = "\
227Find every package-manager cache and store on the machine, size each one, and print \
228the command that clears it — largest first, with a total. On its own it deletes \
229nothing, and nothing that runs on a schedule ever will: a cache is shared by every \
230repository, so no single lockfile can prove its contents recoverable, which is the \
231bar every dev-prune deletion has to clear. Clearing one also turns the next `devp \
232restore` into a download.
233
234`devp caches clear <manager>` runs the command this table prints, after showing you \
235what goes and asking.
236
237Covered: npm, pnpm, yarn, bun, uv, pip, cargo, go, maven, gradle, nuget, vcpkg and \
238conan. Each manager is asked where its cache is (`npm config get cache`, `go env \
239GOMODCACHE`, …) rather than assumed, with read-only queries run from your home \
240directory; a manager that is not installed falls back to the conventional location, \
241because a cache left behind by an uninstalled manager is exactly the multi-gigabyte \
242directory nobody remembers.";
243
244pub const CACHES_EXAMPLES: &str = "\
245EXAMPLES:
246  devp caches                     The table, largest first, with clear commands
247  devp caches --json | jq '.summary.total_bytes'
248                                  Machine-readable
249  devp caches clear npm           Empty one, after asking
250  devp caches clear all --dry-run What would go, and nothing touched
251
252Run interactively with a terminal, `--json` also copies the document to the clipboard.";
253
254pub const CACHES_CLEAR_LONG: &str = "\
255Empty one manager's cache, or every one of them. What is about to go is listed and \
256sized first, and unless `--yes` answers for you, it asks.
257
258This is a convenience, not automation. No scheduler, no Git hook and no `devp run` \
259will ever clear a cache — this only runs when you type it.
260
261Wherever the manager ships its own subcommand, that is what runs: `npm cache clean \
262--force`, `pnpm store prune`, `go clean -modcache`. The manager knows what is still \
263referenced, which a directory delete cannot work out, and its own bookkeeping stays \
264consistent. cargo, maven, gradle and vcpkg ship nothing equivalent, so those are \
265cleared by removing the directory this command resolved and sized — never a string \
266handed to a shell.
267
268Nothing in a cache is lost; every manager re-downloads what it needs. What it costs \
269is time, in every project on the machine, on the next install and the next `devp \
270restore`. The freed size reported afterwards is measured rather than assumed, because \
271a `prune` keeps what is still in use.";
272
273pub const CACHES_CLEAR_EXAMPLES: &str = "\
274EXAMPLES:
275  devp caches clear npm           One manager, after confirming
276  devp caches clear cargo         Both cargo rows: the registry cache and its sources
277  devp caches clear all --dry-run Everything that would go, and nothing touched
278  devp caches clear all --yes     No prompt, for a script
279  devp caches clear go --json --yes
280                                  Machine-readable (`--json` requires `--yes`)
281
282Exit code 1 if any cache could not be cleared; the rows are printed either way.";
283
284pub const TRUST_LONG: &str = "\
285What dev-prune is allowed to do on this machine, on one screen. Read-only — it reads \
286the registry and the OS and changes nothing.
287
288Two sections, and the split is the point. The first is guaranteed by the code: the \
289seven safety invariants plus the two questions asked as often as any of them — there \
290is no telemetry endpoint, and build output is never deleted. Those rows read the same \
291on every machine and have no setting and no flag behind them. The second is read live \
292off this machine: whether the scheduler is installed, whether the Git hooks register \
293repositories on their own, how many repositories are registered, and the settings that \
294widen what may happen without you asking for it.
295
296There is no letter grade. A report that says `trust level: MEDIUM` tells you nothing \
297you can act on, so the widened settings are named instead — `devp config show` has \
298every one of them, and `devp config set <key> <value>` puts one back.
299
300The long form of the guarantees is docs/SAFETY_INVARIANTS.md.";
301
302pub const TRUST_EXAMPLES: &str = "\
303EXAMPLES:
304  devp trust                      The report
305  devp trust --json | jq '.summary.widened'
306                                  Just the settings that widen what may happen
307  devp trust --json | jq -e '.summary.widened_count == 0'
308                                  Exit 1 from jq if this machine has widened anything
309
310Run interactively with a terminal, `--json` also copies the document to the clipboard.";
311
312pub const CONFIG_LONG: &str = "\
313Everything configurable lives under here: global settings (get/set/show/wizard), the \
314per-repository `.devprune.json` (project), the OS background scheduler (daemon), the \
315global Git auto-registration hooks (hook), and the file-manager icon registration \
316(icon).
317
318SHORTHANDS — `daemon`, `hook` and `icon` work without the leading `config`, and the \
319action words people reach for are accepted:
320  devp hook install       = devp config hook enable
321  devp hook uninstall     = devp config hook disable
322  devp daemon on / off    = devp config daemon enable / disable
323  devp icon               = devp config icon
324Accepted action words: enable/install/on, disable/uninstall/remove/off, status/show. \
325Anything else is rejected — a mistyped action never silently degrades into a status \
326report.";
327
328pub const CONFIG_EXAMPLES: &str = "\
329EXAMPLES:
330  devp config show                Every global setting and its value
331  devp config get idle_days       One setting
332  devp config set idle_days 30    Change it (rejects out-of-range values)
333  devp config wizard              Walk through every setting, Enter keeps the current
334  devp config project .           Inspect or create this repo's .devprune.json
335  devp config daemon status       Is the background pass scheduled?
336  devp config . daemon disable    Opt this repository out of the background pass
337  devp config hook enable --chain Take core.hooksPath, forwarding to the tool holding it
338  devp config icon                Register the .devprune.json icon and schema";
339
340pub const CONFIG_GET_LONG: &str = "\
341Print one global setting's current value. The keys, defaults and meanings:
342
343  idle_days                  15     Days untouched before a repo is a candidate
344  min_size_mb                0      Smallest directory worth deleting (0 = no floor)
345  scan_depth                 6      Directory levels below a repo root discovery descends (1-32)
346  require_confirmation       true   Whether a prune pass asks before deleting
347  allow_manifest_rewrite     false  Whether verification may repair a drifted lockfile
348  command_timeout_secs       600    Ceiling on any one package-manager command
349  auto_setup                 true   Whether the integration pass may run unattended
350  auto_daemon                true   …and may register the OS scheduler
351  check_interval_days        2      How often the scheduler runs a pass
352  auto_hooks                 true   …and may install the global Git hooks
353  auto_hooks_chain           false  …and may chain onto another tool's core.hooksPath
354  update_check               true   Whether the periodic release check runs
355  update_check_interval_days 7      Minimum gap between two release checks
356  update_check_timeout_secs  5      How long that one request may hang
357
358Three have a per-repository override in `.devprune.json`, where they win for that \
359tree only: `idle_days` (spelled `override_idle_days` there), `min_size_mb` and \
360`scan_depth`. The rest are deliberately global — a committed `.devprune.json` must \
361not be able to grant a repository `allow_manifest_rewrite` over its own manifests.";
362
363pub const CONFIG_GET_EXAMPLES: &str = "\
364EXAMPLES:
365  devp config get idle_days
366  devp config get update_check";
367
368pub const CONFIG_SET_LONG: &str = "\
369Change one global setting. A value outside the accepted range is rejected with the \
370range in the message, never silently clamped — `scan_depth 0` and `scan_depth 40` are \
371both refused outright. Keys are the same list `devp config get --help` shows.";
372
373pub const CONFIG_SET_EXAMPLES: &str = "\
374EXAMPLES:
375  devp config set idle_days 30
376  devp config set min_size_mb 50
377  devp config set command_timeout_secs 1200
378  devp config set update_check false    Turn the release check off for good";
379
380pub const CONFIG_SHOW_LONG: &str = "\
381Print every global setting with its current value. With `--update`, also run a sync \
382pass across all registered repositories, refreshing each one's `.devprune.json` \
383scaffolding without touching values you have changed.";
384
385pub const CONFIG_SHOW_EXAMPLES: &str = "\
386EXAMPLES:
387  devp config show
388  devp config show --update";
389
390pub const CONFIG_PROJECT_LONG: &str = "\
391Inspect a repository's `.devprune.json`, or create it when missing. The file holds \
392the per-repository overrides — `override_idle_days`, `min_size_mb`, `scan_depth`, \
393`ignore`, `disable_daemon`, `disable_hooks` — and carries a `$schema` line so any \
394editor with JSON Schema support validates and completes it.
395
396`--update` refreshes the file's scaffolding (schema pointer, missing keys) while \
397keeping every value you have set. A file that does not parse is refused, not reset — \
398fix it, or pass `--update` deliberately.
399
400Writing the file also records it in the repository's `.git/info/exclude`, so the \
401config — one machine's preference, not part of the project — never shows up in \
402`git status`. The shared, tracked `.gitignore` is never modified.";
403
404pub const CONFIG_PROJECT_EXAMPLES: &str = "\
405EXAMPLES:
406  devp config project .           Show (or create) this repository's config
407  devp config project ~/Code/api
408  devp config project . --update  Refresh scaffolding, keep your values";
409
410pub const CONFIG_DAEMON_LONG: &str = "\
411The OS background scheduler — Task Scheduler on Windows, launchd on macOS, systemd \
412timers on Linux — which runs `devp run --daemon` every `check_interval_days` days.
413
414Globally: `enable` registers the schedule, `disable` removes it, `status` reports \
415it. With a path first, the same words act on one repository via `disable_daemon` in \
416its `.devprune.json`: the machine-wide pass keeps running, that repository sits it \
417out.";
418
419pub const CONFIG_DAEMON_EXAMPLES: &str = "\
420EXAMPLES:
421  devp daemon status              Machine-wide scheduler state
422  devp daemon enable              Register the schedule (also: install, on)
423  devp daemon disable             Remove it (also: uninstall, remove, off)
424  devp config . daemon disable    This repository opts out of the background pass
425  devp config ~/Code/api daemon enable";
426
427pub const CONFIG_HOOK_LONG: &str = "\
428The global Git hooks (via `core.hooksPath`) that auto-register any repository you \
429commit in — `devp link --quiet`, silent, honouring opt-outs. `enable` installs them, \
430`disable` removes them (restoring what was there), `status` reports them. With a \
431path first, the same words act on one repository via `disable_hooks`.
432
433Git has exactly one global `core.hooksPath` and no way to chain two, so a tool that \
434holds it (husky, pre-commit, lefthook) shuts every other one out. `--chain` is the \
435way through: dev-prune takes the slot and writes, per hook, a shim that does its own \
436work and then execs the same-named hook in the displaced directory — their hooks \
437keep firing, their exit codes still block commits. `devp hook uninstall` puts the \
438original back. The chain snapshots the other tool's hooks at install time; `devp \
439hook status` reports any that have drifted, and `devp hook install --chain` rebuilds.";
440
441pub const CONFIG_HOOK_EXAMPLES: &str = "\
442EXAMPLES:
443  devp hook status                Installed? Chained? Drifted?
444  devp hook install               Take the free core.hooksPath slot
445  devp hook install --chain       Take a slot husky/pre-commit/lefthook holds, forwarding
446  devp hook uninstall             Restore the previous core.hooksPath
447  devp config . hook disable      This repository opts out of auto-registration";
448
449pub const CONFIG_ICON_LONG: &str = "\
450Register `*.devprune.json` with the OS file manager and write the icon files and the \
451JSON Schema into the config directory. On Linux this is a complete registration \
452(shared-mime-info plus hicolor icons — Nautilus, Dolphin, Thunar, Nemo, PCManFM). On \
453Windows, Explorer resolves icons by last extension only, so the config folder gets \
454its own icon instead of hijacking every `.json` on the machine. On macOS a UTI must \
455come from an application bundle, which a single binary is not.
456
457It also prints an editor snippet to paste yourself — it never edits your editor \
458settings, your PATH, or your shell startup files.";
459
460pub const CONFIG_ICON_EXAMPLES: &str = "\
461EXAMPLES:
462  devp icon                       Same command, without the leading `config`";
463
464pub const CONFIG_WIZARD_LONG: &str = "\
465Open every global setting in a full-screen configurator, with the `devp trust` \
466declaration in front of it: what this tool is allowed to do is on screen before any \
467of it is configurable.
468
469Arrows move; Space changes the highlighted setting — a toggle flips, a number opens \
470a field, `disabled_adapters` opens the adapter checklist; `r` puts one back; `y` \
471accepts everything as shown. The last screen lists exactly what will be written, \
472before it is written. `q` leaves without saving anything.
473
474It runs itself once on a first install — so the defaults are something you agreed \
475to, not something you inherited — and again after an upgrade adds a setting this \
476machine has never been shown, which it marks NEW and opens on. Settings you have \
477already confirmed are never re-asked.
478
479It never runs unattended: no TTY means skipped, not guessed at. `--no-tui`, and the \
480DEV_PRUNE_NO_TUI environment variable, ask one question per line instead — for \
481terminals the full-screen view cannot drive, and for agents, which hold a real \
482terminal and will never press a key. To configure this tool from a script, use \
483`devp config set <key> <value>`, which needs no terminal at all.";
484
485pub const CONFIG_WIZARD_EXAMPLES: &str = "\
486EXAMPLES:
487  devp config wizard
488  devp config wizard --no-tui              One question per line
489  devp config set disabled_adapters go     Leave Go projects alone entirely
490  devp config set disabled_adapters -      Every adapter active again";
491
492pub const RESTORE_LONG: &str = "\
493Put dependencies back: detect each project's lockfile and run its manager's install \
494(`npm ci`, `pnpm install`, `uv sync`, `cargo fetch`, …). Mirrors pruning — every \
495project in the tree is restored, each by its own manager, so a monorepo comes back \
496whole.
497
498`--last-run` restores exactly what the most recent prune pass deleted, across every \
499repository it touched, and nothing else: the undo for a `devp run`. Each prune \
500records what it removed (a dry run records nothing), and the flag fails cleanly if \
501no pass has been recorded yet. It cannot be combined with a path — silently ignoring \
502the path would restore the wrong thing.";
503
504pub const RESTORE_EXAMPLES: &str = "\
505EXAMPLES:
506  devp restore                    Restore the current directory's projects
507  devp restore ~/Code/my-app
508  devp restore --last-run         Undo the last prune pass, everywhere it acted";
509
510pub const UPDATE_LONG: &str = "\
511Print the installed version, ask GitHub's public API for the latest release, and \
512show the upgrade command for how this copy was installed. `--install` runs the upgrade through the \
513package manager that owns this copy (cargo, npm, uv, pipx, or the installer \
514script). `auto_update` is on by default and does the verified-download half by \
515itself at the end of a prune pass when a newer release is known — never the \
516package-manager half, and nothing at all on WinGet, Scoop and Homebrew, where the \
517manager owns the upgrade; `devp config set auto_update false` stops it. An upgrade never interrupts the \
518scheduler: the scheduled pass runs a managed copy that refreshes itself from the \
519new binary on its next run.
520
521The same check also runs quietly from `devp run` and `devp status`, at most once \
522every `update_check_interval_days` (7 by default), printing one line only when a \
523newer version exists. It is the only thing in dev-prune that opens a network \
524connection, sends no body and no identifier, and `devp config set update_check \
525false` turns it off for good; `--offline` skips it for one run without changing the \
526setting.";
527
528pub const UPDATE_EXAMPLES: &str = "\
529EXAMPLES:
530  devp update                     Version, latest release, upgrade command
531  devp update --install           Upgrade now, through the owning channel
532  devp update --offline           No network this run";
533
534pub const INSTALL_LONG: &str = "\
535Move this installation from one package manager to another.
536
537`devp update` always upgrades the copy that is running, through whichever channel \
538installed it. This command changes *which* channel owns it: it installs through the \
539manager you name, then removes the old copy through the manager that put it there — in \
540that order, so a failed install leaves the working copy untouched.
541
542Removing the old copy through its own manager, rather than deleting the file, is the \
543point: uv, pipx, npm, cargo and the rest each keep a record of what they installed, and \
544a manager whose record still says dev-prune is there will put the old binary back.
545
546Nothing is migrated, because nothing needs to be. Settings, the repository registry and \
547the undo history live in the config directory, which no package manager owns.
548
549With no `--channel` it prints which manager installed this copy and what `--channel` \
550accepts. `--dry-run` prints the commands without running any of them.";
551
552pub const INSTALL_EXAMPLES: &str = "\
553EXAMPLES:
554  devp install                              Which channel owns this copy
555  devp install --channel winget --dry-run   Print the plan, change nothing
556  devp install --channel uv                 Move onto uv, and remove the old copy
557  devp install --channel cargo --yes        Skip the confirmation prompt";
558
559pub const SKILL_LONG: &str = "\
560Teach your AI assistant this tool. Exports SKILL.md — the full agent-facing manual: \
561every command, the JSON contracts, the safety invariants, the troubleshooting tree — \
562into the config directory, installs it into any detected agent skills directory \
563(`~/.claude/skills/dev-prune/`, the same install `devp setup` performs), and prints \
564ready-to-copy onboarding prompts for assistants without one (Gemini Antigravity, \
565Cursor, Windsurf, Copilot, OpenClaw).
566
567`--agent <EDITOR>` instead writes per-repository rules into the current repository, \
568in the file that editor's agent reads. Ten editors get a file of their own — cursor, \
569windsurf, antigravity, cline, roo, kilocode, continue, amazon-q, kiro, trae — and five \
570share a file with other tools, so dev-prune owns a marked block inside it: agents-md \
571(`AGENTS.md`, the cross-tool convention Codex, Jules, Amp and OpenCode read), copilot \
572(`.github/copilot-instructions.md`), gemini (`GEMINI.md`), junie \
573(`.junie/guidelines.md`) and zed (`.rules`). Every byte outside the markers is left as \
574found. `devp skill --help` lists each value with its exact path. \
575Claude Code needs no per-repository file — its skill installs globally.";
576
577pub const SKILL_EXAMPLES: &str = "\
578EXAMPLES:
579  devp skill                      Export SKILL.md, print onboarding prompts
580  devp skill --agent cursor       Write .cursor/rules/dev-prune.mdc here
581  devp skill --agent agents-md    Upsert the marked block in AGENTS.md";
582
583pub const SETUP_LONG: &str = "\
584Install whatever integration is missing and leave the rest alone: the `devp` alias, \
585the managed binary directory on your PATH (a user PATH entry on Windows, \
586`~/.local/bin` symlinks elsewhere — what keeps `devp` working after the venv or npx \
587cache it came from disappears), the exported SKILL.md and its agent-directory \
588install, the file-manager icon registration, the global Git hooks, and the OS \
589scheduler. Safe to run repeatedly: it is the same pass the install scripts run, the \
590same one `devp init` runs, and the same one that runs by itself on the first command \
591after an upgrade.
592
593It skips rather than forces: Git hooks when `git` is missing or another tool holds \
594`core.hooksPath` (take the slot with `devp hook install --chain`), the alias when \
595the running process is `devp` itself on Windows, and anything switched off by \
596`auto_setup`, `auto_hooks`, `auto_daemon` or `DEV_PRUNE_NO_AUTO_SETUP=1`.
597
598When a VS Code-family editor is on your PATH (VS Code, VSCodium, Cursor, Windsurf, \
599Positron, Kiro, or an Insiders build) and the dev-prune extension is not installed, \
600one run also asks — once ever, only at a terminal — whether to install it into each \
601editor found. Each editor installs from its own registry; when a fork's registry does \
602not carry the extension, the `.vsix` from the latest GitHub release is installed \
603instead. Decline and it never asks again; install it yourself later with \
604`code --install-extension VKrishna04.dev-prune`.";
605
606pub const SETUP_EXAMPLES: &str = "\
607EXAMPLES:
608  devp setup                      Install what is missing, report what was skipped
609  devp setup --status             Report only; change nothing
610  DEV_PRUNE_NO_AUTO_SETUP=1 devp init ~/Code
611                                  Register repositories, install nothing";
612
613pub const DOCTOR_LONG: &str = "\
614One read-only pass that answers \"why is this not doing what I expect\". Without a \
615path it checks the installation: binary and twin, PATH, registry health, every \
616stored setting revalidated, SKILL.md, icons, hooks, scheduler, the package-manager \
617binaries your repositories actually need, and the release-check state. With a path \
618it checks that repository and ends by naming the single reason a prune would or \
619would not touch it.
620
621`--fix` is diagnosis first, then treatment — and it mends installed-but-broken only: \
622a stale or missing `devp` twin, a missing SKILL.md export, hooks or a scheduler \
623whose recorded binary moved, a drifted hook chain, and registry entries whose \
624repository is gone. Each repair is the corresponding `devp setup` pass re-run, so a \
625repair can never do more than setup itself would. It never performs a first-time \
626install, and never touches an unreadable registry — a parse failure is for you to \
627look at, not for a tool to guess at.
628
629EXIT CODES: 0 when everything works, warnings included — a missing scheduler should \
630not fail a script. 1 only for genuine breakage: an unreadable registry, an \
631out-of-range setting, a dead registered path, a directory that is not a Git \
632repository. `--fix` exits 1 when any repair failed or was out of reach.";
633
634pub const DOCTOR_EXAMPLES: &str = "\
635EXAMPLES:
636  devp doctor                     Check the installation
637  devp doctor .                   Why would a prune touch (or skip) this repository?
638  devp doctor ~/Code/api
639  devp doctor --fix               Repair what the installation check finds broken";
640
641pub const UNINSTALL_LONG: &str = "\
642Remove dev-prune from the machine: the OS scheduler, the global Git hooks (only if \
643`core.hooksPath` still points at dev-prune), the file-type icons, the installed \
644agent skill, the PATH entry (or `~/.local/bin` symlinks), and the binaries — the \
645managed pair, the copy you invoked, and, with your confirmation, every other copy \
646found on PATH or in the well-known install directories (`~/.cargo/bin`, \
647`~/.local/bin`, npm's global directory, pip's Scripts directories). A copy owned by \
648a package manager is listed with its manager, and after removal the manager's own \
649uninstall command is printed so its records can be cleared too.
650
651On Windows, where a running executable cannot delete itself, a detached helper \
652removes the last files a few seconds after the command exits — no reboot, no closed \
653terminal.
654
655Without `--deep` the configuration survives, so a reinstall picks up where you left \
656off. With `--deep` the global config folder and every registered repository's \
657`.devprune.json` go too; that asks for confirmation, and refuses outright with no \
658terminal to ask on unless `-y` is passed. Exits 1 if anything could not be removed, \
659naming each leftover.";
660
661pub const UNINSTALL_EXAMPLES: &str = "\
662EXAMPLES:
663  devp uninstall                  Remove the program; keep config for a reinstall
664  devp uninstall --deep           Also wipe config and per-repo .devprune.json (asks)
665  devp uninstall --deep -y        Non-interactive; also confirms the stray-copy sweep";