prereq-cli 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,177 @@
1
+ # prereq-cli
2
+
3
+ Colorful prerequisite auditor for large codebases.
4
+
5
+ Use it to define a curated list of CLIs/apps your project needs (Bun, Docker, mongosh, etc), then check whether a machine or remote agent has them installed and on the expected version.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ # npm
11
+ npm i -D prereq-cli
12
+
13
+ # bun
14
+ bun add -d prereq-cli
15
+ ```
16
+
17
+ ## Run
18
+
19
+ ```bash
20
+ # default check (discovers prereq.config.ts/json)
21
+ npx prereq
22
+
23
+ # bunx
24
+ bunx prereq
25
+
26
+ # explicit config path
27
+ npx prereq --config ./infra/prereq.config.ts
28
+
29
+ # strict mode: fail on required outdated/version_unknown too
30
+ npx prereq --strict
31
+
32
+ # verbose mode (show all details for every prerequisite)
33
+ npx prereq --verbose
34
+
35
+ # machine-readable output
36
+ npx prereq --json
37
+ ```
38
+
39
+ ## Commands
40
+
41
+ - `prereq` or `prereq check` - run prerequisite checks
42
+ - `prereq validate` - validate config only (no checks)
43
+ - `prereq init` - scaffold starter config
44
+ - `prereq list-examples` - show bundled config examples
45
+
46
+ ## Examples
47
+
48
+ See curated config sets in `examples/`:
49
+
50
+ - `examples/basic-ts/`
51
+ - `examples/basic-json/`
52
+ - `examples/monorepo-membrane-style/`
53
+ - `examples/remote-agent-ubuntu/`
54
+ - `examples/k8s-platform/`
55
+ - `examples/release-ops/`
56
+ - `examples/desktop-secrets-vpn/`
57
+
58
+ ## Check Options
59
+
60
+ - `-c, --config <path>` config file path
61
+ - `--json` output JSON
62
+ - `--verbose` show full details for all prerequisites
63
+ - `--strict` fail on required outdated/version_unknown
64
+ - `--required-only` only evaluate required prerequisites
65
+ - `--timeout <ms>` per-command timeout (default `4000`)
66
+ - `--concurrency <n>` max concurrent checks (default `8`)
67
+ - `--cwd <path>` working directory to resolve config path (default `.`)
68
+ - `--no-color` disable ANSI colors
69
+
70
+ ## Config File
71
+
72
+ Supported formats:
73
+
74
+ - `prereq.config.ts`
75
+ - `prereq.config.mts`
76
+ - `prereq.config.cts`
77
+ - `prereq.config.js`
78
+ - `prereq.config.mjs`
79
+ - `prereq.config.cjs`
80
+ - `prereq.config.json`
81
+
82
+ ### TypeScript config
83
+
84
+ ```ts
85
+ import { defineConfig } from 'prereq-cli'
86
+
87
+ export default defineConfig({
88
+ projectName: 'my-monorepo',
89
+ prerequisites: [
90
+ {
91
+ id: 'bun',
92
+ name: 'Bun',
93
+ tier: 'required',
94
+ detect: {
95
+ binaries: ['bun'],
96
+ },
97
+ version: {
98
+ command: 'bun --version',
99
+ range: '>=1.3.10',
100
+ },
101
+ docs: 'https://bun.com/docs/installation',
102
+ install: {
103
+ darwin: ['curl -fsSL https://bun.sh/install | bash'],
104
+ linux: ['curl -fsSL https://bun.sh/install | bash'],
105
+ },
106
+ },
107
+ {
108
+ id: 'docker',
109
+ tier: 'required',
110
+ detect: {
111
+ binaries: ['docker'],
112
+ commands: ['docker info >/dev/null 2>&1'],
113
+ },
114
+ docs: {
115
+ install: 'https://docs.docker.com/get-started/introduction/get-docker-desktop/',
116
+ },
117
+ install: 'brew install --cask docker',
118
+ },
119
+ ],
120
+ })
121
+ ```
122
+
123
+ ### JSON config
124
+
125
+ ```json
126
+ {
127
+ "projectName": "my-monorepo",
128
+ "prerequisites": [
129
+ {
130
+ "id": "node",
131
+ "tier": "required",
132
+ "detect": { "binaries": ["node"] },
133
+ "version": { "command": "node --version", "range": ">=20.0.0" }
134
+ }
135
+ ]
136
+ }
137
+ ```
138
+
139
+ ## Result Statuses
140
+
141
+ - `ok` - prerequisite detected (and version satisfied, if configured)
142
+ - `missing` - not detected
143
+ - `outdated` - detected but version does not satisfy range
144
+ - `version_unknown` - detected but version command output could not be evaluated
145
+
146
+ ## Programmatic Config Helper
147
+
148
+ ```ts
149
+ import { defineConfig } from 'prereq-cli/config'
150
+ ```
151
+
152
+ ## Development
153
+
154
+ ```bash
155
+ bun install
156
+ bun run build
157
+ bun run test
158
+ bun run check
159
+ ```
160
+
161
+ ## Publishing
162
+
163
+ ```bash
164
+ # 1) full quality gate + tarball preview
165
+ bun run pack:dry-run
166
+
167
+ # 2) full quality gate + npm publish dry-run
168
+ bun run publish:dry-run
169
+
170
+ # 3) publish publicly
171
+ bun run publish:public
172
+ ```
173
+
174
+ Notes:
175
+
176
+ - package name check: `bunx npm view prereq-cli version`
177
+ - login check: `bunx npm whoami`
@@ -0,0 +1,2 @@
1
+ import type { AuditReport, NormalizedConfig, RunOptions } from './types';
2
+ export declare function runAudit(config: NormalizedConfig, configPath: string, options: RunOptions): Promise<AuditReport>;
package/dist/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};