Skip to content

Commit 6fa4156

Browse files
fix: add install-time quick-start guidance
1 parent 5f9ccdc commit 6fa4156

6 files changed

Lines changed: 46 additions & 7 deletions

File tree

.memory/project-memory.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ Build an open-source deterministic security scanner that helps repository owners
1919
- npm manifest normalization now uses a valid `bin` path and passes `npm publish --dry-run`.
2020
- The public GitHub repository now exists at `https://github.com/ExceptionRegret/security-first-aid`.
2121
- The initial `main` branch commit has been pushed to GitHub.
22-
- The package is now published to npm as `security-first-aid@0.1.1`.
22+
- The package is now published to npm as `security-first-aid@0.1.2`.
2323
- Public execution through `npx security-first-aid@latest ...` has been verified, including the no-argument quick-start guide.
24+
- Global npm installs now print a post-install quick-start guide.
2425
- Release hardening now includes a Keep a Changelog file, release validation scripts, and a tag-driven GitHub Actions release workflow.
2526
- CLI no-argument and help-flag behavior now shows a real quick-start guide for npm and npx users.
2627
- Additional implemented rules now cover `pull_request_target` workflows and wildcard CORS in JSON config.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
66

77
## [Unreleased]
88

9+
## [0.1.2] - 2026-03-11
10+
11+
### Added
12+
13+
- Global npm installs now print a short post-install quick-start guide so users immediately see how to run the CLI.
14+
915
## [0.1.1] - 2026-03-11
1016

1117
### Added

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ npm install -g security-first-aid
102102
sfa scan . --format terminal
103103
```
104104

105+
Global npm installs now print a short quick-start message after installation.
106+
105107
If you just want the built-in guide:
106108

107109
```bash
@@ -198,7 +200,7 @@ npm pack
198200
Install that tarball globally:
199201

200202
```bash
201-
npm install -g ./security-first-aid-0.1.0.tgz
203+
npm install -g ./security-first-aid-0.1.2.tgz
202204
```
203205

204206
Then run:
@@ -227,7 +229,7 @@ Automated release path:
227229
1. update `package.json` to the target version
228230
2. add the matching release section to `CHANGELOG.md`
229231
3. commit the release changes
230-
4. push a tag like `v0.1.1`
232+
4. push a tag like `v0.1.2`
231233

232234
The `Release` workflow will:
233235

@@ -287,7 +289,7 @@ npx @your-org/security-first-aid@latest scan . --format terminal
287289

288290
Current published version:
289291

290-
- `security-first-aid@0.1.1`
292+
- `security-first-aid@0.1.2`
291293

292294
## Usage
293295

@@ -511,7 +513,7 @@ npm link
511513
Or reinstall the tarball/global package:
512514

513515
```bash
514-
npm install -g ./security-first-aid-0.1.0.tgz
516+
npm install -g ./security-first-aid-0.1.2.tgz
515517
```
516518

517519
### PowerShell blocks `sfa.ps1`
@@ -534,7 +536,7 @@ That only works after the package is published to npm. Before publishing, use on
534536

535537
- `node ./src/cli/index.js ...`
536538
- `npm link` then `sfa ...`
537-
- `npm pack` then `npm install -g ./security-first-aid-0.1.0.tgz`
539+
- `npm pack` then `npm install -g ./security-first-aid-0.1.2.tgz`
538540

539541
## License
540542

docs/reference/cli.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ sfa
1616

1717
If you run `sfa` with no arguments, the CLI now prints a built-in quick-start guide instead of a minimal usage block.
1818

19+
If you install the package globally from npm, the installer also prints a short post-install quick-start message.
20+
1921
PowerShell note:
2022

2123
- If PowerShell prefers a blocked `sfa.ps1` shim, run `sfa.cmd ...` or `cmd /c sfa ...`.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "security-first-aid",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Deterministic, local-first security scanner for repositories and CI/CD configuration.",
55
"homepage": "https://github.com/ExceptionRegret/security-first-aid#readme",
66
"type": "module",
@@ -17,6 +17,7 @@
1717
},
1818
"files": [
1919
"src",
20+
"scripts/postinstall.mjs",
2021
"CHANGELOG.md",
2122
"README.md",
2223
"LICENSE"
@@ -25,6 +26,7 @@
2526
"sfa": "src/cli/index.js"
2627
},
2728
"scripts": {
29+
"postinstall": "node scripts/postinstall.mjs",
2830
"test": "node --test --experimental-test-isolation=none",
2931
"check": "node --test --experimental-test-isolation=none && node scripts/smoke.mjs",
3032
"scan:fixture": "node ./src/cli/index.js scan ./tests/fixtures/insecure-service --format markdown",

scripts/postinstall.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const isGlobalInstall = process.env.npm_config_global === "true";
2+
const isCi = process.env.CI === "true";
3+
4+
if (!isGlobalInstall || isCi) {
5+
process.exit(0);
6+
}
7+
8+
const lines = [
9+
"",
10+
"Security First Aid installed.",
11+
"",
12+
"Start here:",
13+
" sfa",
14+
" sfa scan . --format terminal",
15+
" sfa rules list --format json",
16+
"",
17+
"PowerShell note:",
18+
" If `sfa` is blocked by execution policy, use `sfa.cmd` or `cmd /c sfa`.",
19+
"",
20+
"Docs:",
21+
" README: https://github.com/ExceptionRegret/security-first-aid#readme",
22+
" npm: https://www.npmjs.com/package/security-first-aid",
23+
""
24+
];
25+
26+
process.stdout.write(`${lines.join("\n")}\n`);

0 commit comments

Comments
 (0)