fundamentum-cli 0.1.5 → 0.2.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.
Files changed (4) hide show
  1. package/README.md +15 -1
  2. package/install.js +11 -3
  3. package/package.json +6 -6
  4. package/run.js +24 -0
package/README.md CHANGED
@@ -27,6 +27,13 @@ npx fundamentum-cli apply OWNER/REPO
27
27
 
28
28
  Works on **macOS** and **Linux** (`x64` and `arm64`) and **Windows** (`x64`). Postinstall downloads the matching prebuilt binary from GitHub Releases with embedded SHA-256 verification.
29
29
 
30
+ A git checkout keeps `package.json` at `0.0.0` and will not download a binary. Build it locally instead:
31
+
32
+ ```bash
33
+ go build -o npm/bin/fundamentum .
34
+ # Windows: go build -o npm/bin/fundamentum.exe .
35
+ ```
36
+
30
37
  > **npm 9+ / Ubuntu 26+ note:** npm's `allow-scripts` security policy may block the postinstall
31
38
  > script, so the binary won't be downloaded at install time. No worries — if `fundamentum` is invoked
32
39
  > without a binary present it detects this and downloads automatically. You can also trigger it
@@ -79,10 +86,17 @@ Built for solo devs and small teams who want their repos to feel like they were
79
86
  |---------|---------|
80
87
  | `apply OWNER/REPO` | Harden an existing repo |
81
88
  | `init OWNER/REPO` | Create a new repo, then harden it |
89
+ | `audit OWNER/REPO` | Verify the repo matches the harden baseline |
90
+ | `export` | Write a portable JSON baseline (`-o` for a file) |
82
91
  | `--dry-run` | Preview the full plan without applying |
83
- | `--pr` | Batch file changes into a pull request |
92
+ | `--pr` | Batch file changes into a PR; settings/security/protection still apply live |
84
93
  | `--no-overwrite` | Only add missing files, never touch existing ones |
85
94
  | `--advanced-security` | Enable GHAS (secret scanning, push protection) on private/internal repos (paid) |
95
+ | `--strict` | Fail the run when any core harden step fails, including optional tag/security items |
96
+ | `--require-checks` | Required status-check contexts for protect-main (comma-separated; default: jobs for the resolved `--ci` pack) |
97
+ | `--ci` | CI pack: `auto` (detect go/node/python/rust, else generic), `go`, `node`, `python`, `rust`, `generic`, or `none` |
98
+ | `--preset` | Named baseline: `oss` (no prompts), `private` (solo, no GHAS prompt), `strict` (`--strict` + GHAS) |
99
+ | `--from` | Load a portable JSON baseline from `export` |
86
100
 
87
101
  ## Prerequisites
88
102
 
package/install.js CHANGED
@@ -18,6 +18,8 @@ const RELEASE_HOSTS = new Set([
18
18
  "github-releases.githubusercontent.com",
19
19
  ]);
20
20
 
21
+ const binaryName = process.platform === "win32" ? "fundamentum.exe" : "fundamentum";
22
+
21
23
  const PLATFORM_MAP = {
22
24
  linux: "linux",
23
25
  darwin: "darwin",
@@ -171,8 +173,6 @@ function extract(buffer, archiveName, binDir) {
171
173
  spawnOrFail("tar", ["-xzf", archivePath, "-C", tmpDir], "tar");
172
174
  }
173
175
 
174
- // Find the binary in the extracted files
175
- const binaryName = process.platform === "win32" ? "fundamentum.exe" : "fundamentum";
176
176
  const extractedBinary = path.join(tmpDir, binaryName);
177
177
 
178
178
  if (!fs.existsSync(extractedBinary)) {
@@ -197,7 +197,15 @@ async function main() {
197
197
  );
198
198
  const version = getPackageVersion(pkg);
199
199
  if (version === "0.0.0") {
200
- console.error("fundamentum: skipping binary download for development version");
200
+ console.error(
201
+ "fundamentum: package version is 0.0.0 (git checkout / unpublished).\n" +
202
+ "The release installer will not download a binary from here.\n" +
203
+ "Build locally instead:\n" +
204
+ " go build -o npm/bin/" +
205
+ binaryName +
206
+ " .\n" +
207
+ "Or install a published release: npm install -g fundamentum-cli"
208
+ );
201
209
  return;
202
210
  }
203
211
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fundamentum-cli",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "Bootstrap and harden GitHub repos for OSS collaboration — community files, branch protection, security features, and starter workflows in one command.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -57,10 +57,10 @@
57
57
  "bin/"
58
58
  ],
59
59
  "binaryChecksums": {
60
- "fundamentum_0.1.5_darwin_amd64.tar.gz": "92f051cb4eaba47cd09b31a0011fc682f272488323c10e36ddaca5121fac24ea",
61
- "fundamentum_0.1.5_darwin_arm64.tar.gz": "c6d69c3c30195e74e834471c2eed8121fbd4b59a2f502e5831abc1933dd34e9f",
62
- "fundamentum_0.1.5_linux_amd64.tar.gz": "375d2578f4f9ef0c836bb86295dbc6976b27ff0608c3bd0ebdce5665e540dcf0",
63
- "fundamentum_0.1.5_linux_arm64.tar.gz": "404b56dc51a8209086b93f92d345026adf452f0460c67a1e701fcf3d728488e8",
64
- "fundamentum_0.1.5_windows_amd64.zip": "cd78b7916a5f7f2b1c48b922585d562b0bd593326802514f244221dced5168ad"
60
+ "fundamentum_0.2.0_darwin_amd64.tar.gz": "ac98ef35f9d9b98dee08bae90f183f01ce73b6df3bd96ac9b0247e1cd99bab12",
61
+ "fundamentum_0.2.0_darwin_arm64.tar.gz": "440abfc2188ad9f2c8446a33295607bf48d8600500f9d6495e96fd5a818c6d45",
62
+ "fundamentum_0.2.0_linux_amd64.tar.gz": "a95a08f3aa3fcc66ae16c70727715924c3954fc7135d1d708bdc50f9935ebdb2",
63
+ "fundamentum_0.2.0_linux_arm64.tar.gz": "b5b860ee8fb564e5fd504b29432aa993f982c0257697da7f308664aad6c8ca41",
64
+ "fundamentum_0.2.0_windows_amd64.zip": "6a77d313bdca82db855a8d611d962e8e86e6b97665fff7649baf1c6a69a33a02"
65
65
  }
66
66
  }
package/run.js CHANGED
@@ -37,10 +37,34 @@ function runBinary() {
37
37
  });
38
38
  }
39
39
 
40
+ function isDevCheckout() {
41
+ try {
42
+ const pkg = JSON.parse(
43
+ fs.readFileSync(path.join(__dirname, "package.json"), "utf8")
44
+ );
45
+ return pkg.version === "0.0.0";
46
+ } catch (_) {
47
+ return false;
48
+ }
49
+ }
50
+
40
51
  // If the binary is missing, postinstall was likely blocked by npm's allow-scripts
41
52
  // security policy. Attempt a lazy download, but the package dir may be root-owned
42
53
  // (e.g. sudo npm install -g). In that case, surface a clear recovery message.
43
54
  if (!fs.existsSync(binaryPath)) {
55
+ if (isDevCheckout()) {
56
+ console.error(
57
+ "fundamentum: binary not found and package version is 0.0.0 (git checkout).\n" +
58
+ "install.js will not download a release binary in this state.\n" +
59
+ "Build locally:\n" +
60
+ " go build -o npm/bin/" +
61
+ binaryName +
62
+ " .\n" +
63
+ "Or install a published release: npm install -g fundamentum-cli"
64
+ );
65
+ process.exit(1);
66
+ }
67
+
44
68
  const installScript = path.join(__dirname, "install.js");
45
69
 
46
70
  // Check if we can write to the package dir before attempting the download.