@kaynooo/cli-doctor 0.3.0 → 0.5.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 +27 -1
- package/dist/cli-bin.js +398 -114
- package/dist/cli.js +431 -118
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
# doctor
|
|
2
2
|
|
|
3
|
-
`doctor` checks a host's @kaynooo/cli-* install in one call: one line per check, the command that fixes a failing one beside it.
|
|
3
|
+
`doctor` checks a host's @kaynooo/cli-* install in one call: one line per check, the command that fixes a failing one beside it. The package also ships a second bin, `cli` (`cli stats`, `cli list`, below), which is not `doctor`.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
6
|
bun install -g @kaynooo/cli-doctor
|
|
7
7
|
doctor # one line per check
|
|
8
8
|
doctor --json # [{check, ok, detail, fix?}]
|
|
9
|
+
doctor -q # only the failing checks, nothing when all pass
|
|
10
|
+
doctor --only tea --only bun # just these checks (a package such as cli-forgejo, tea, hooks, bun, completions)
|
|
11
|
+
doctor --fix --dry-run # what --fix would run
|
|
12
|
+
doctor --fix # run the fixes, then check again
|
|
9
13
|
```
|
|
10
14
|
|
|
11
15
|
| Check | Passes when | Fix |
|
|
@@ -17,6 +21,28 @@ doctor --json # [{check, ok, detail, fix?}]
|
|
|
17
21
|
|
|
18
22
|
A registry that does not answer leaves a package passing, with a note. Exit codes: 0 every check passed, 1 one failed, 2 a usage error.
|
|
19
23
|
|
|
24
|
+
## --fix
|
|
25
|
+
|
|
26
|
+
`--fix` runs the `fix:` lines it may: the `bun install -g` ones (joined into one call), `cli completions fish --install`, and `claude plugin install` or `disable`. It then checks again, prints the checks as they stand and exits on those. Nothing that installs a system package is run, and a line that only describes a step (`tea` from its releases page, adding a folder to the PATH, `bun upgrade`, which replaces Bun itself) is printed as `not run`. `--dry-run` prints each line as `would` and runs nothing (alone it implies `--fix`).
|
|
27
|
+
`--json` keeps its shape and prints the checks after the fixes, the fixes going to stderr; `--quiet` filters it to the failing ones.
|
|
28
|
+
|
|
29
|
+
## cli completions
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
cli completions fish --install # one file per installed bin in ~/.cache/fish/kaynooo-cli
|
|
33
|
+
source <(cli completions bash) # in ~/.bashrc
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Each bin completes itself through `<bin> __complete`. fish gets a file per bin (put the folder first in `fish_complete_path`), bash one script sourced from `~/.bashrc`. zsh has no script of its own: load `compinit` and `bashcompinit` in `~/.zshrc`, then the bash line above (not tested, zsh is not installed on the machine this was written on). The fish files are checked by `doctor`.
|
|
37
|
+
|
|
38
|
+
## cli stats
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
cli stats [--since 7d] [--json] # runs per bin, failures, and the options usage errors did not know
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Every bin records each run in `~/.local/state/kaynooo-cli/usage.jsonl`: the bin, its command, the flag names it saw (never values or arguments), the exit code and, on a usage error, the unknown option. `KAYNOOO_CLI_NO_USAGE=1` turns it off; `guard` never records.
|
|
45
|
+
|
|
20
46
|
## cli list
|
|
21
47
|
|
|
22
48
|
```sh
|