cc-safe-setup 17.2.0 → 17.3.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 +1 -1
- package/index.mjs +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**One command to make Claude Code safe for autonomous operation.** [日本語](docs/README.ja.md)
|
|
8
8
|
|
|
9
|
-
8 built-in + 124 examples = **164 hooks**.
|
|
9
|
+
8 built-in + 124 examples = **164 hooks**. 45 CLI commands. 561 tests. 5 languages. [**Hub**](https://yurukusa.github.io/cc-safe-setup/hub.html) · [Wizard](https://yurukusa.github.io/cc-safe-setup/wizard.html) · [Cheat Sheet](https://yurukusa.github.io/cc-safe-setup/hooks-cheatsheet.html) · [Builder](https://yurukusa.github.io/cc-safe-setup/builder.html) · [FAQ](https://yurukusa.github.io/cc-safe-setup/faq.html) · [Examples](https://yurukusa.github.io/cc-safe-setup/by-example.html) · [Matrix](https://yurukusa.github.io/cc-safe-setup/matrix.html) · [Playground](https://yurukusa.github.io/cc-hook-registry/playground.html)
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npx cc-safe-setup
|
package/index.mjs
CHANGED
|
@@ -113,6 +113,7 @@ const CREATE_DESC = CREATE_IDX !== -1 ? process.argv.slice(CREATE_IDX + 1).join(
|
|
|
113
113
|
const SUGGEST = process.argv.includes('--suggest');
|
|
114
114
|
const INIT_PROJECT = process.argv.includes('--init-project');
|
|
115
115
|
const SCORE_ONLY = process.argv.includes('--score');
|
|
116
|
+
const CHANGELOG_CMD = process.argv.includes('--changelog');
|
|
116
117
|
const TEST_HOOK_IDX = process.argv.findIndex(a => a === '--test-hook');
|
|
117
118
|
const TEST_HOOK = TEST_HOOK_IDX !== -1 ? process.argv[TEST_HOOK_IDX + 1] : null;
|
|
118
119
|
const WHY_IDX = process.argv.findIndex(a => a === '--why');
|
|
@@ -150,6 +151,7 @@ if (HELP) {
|
|
|
150
151
|
npx cc-safe-setup --create "<desc>" Generate a custom hook from description
|
|
151
152
|
npx cc-safe-setup --test-hook <name> Test a specific hook with sample inputs
|
|
152
153
|
npx cc-safe-setup --save-profile <name> Save current hooks as a named profile
|
|
154
|
+
npx cc-safe-setup --changelog Show what changed in recent versions
|
|
153
155
|
npx cc-safe-setup --score Print safety score (0-100) and exit
|
|
154
156
|
npx cc-safe-setup --init-project Complete project setup (CLAUDE.md + hooks + CI + .gitignore)
|
|
155
157
|
npx cc-safe-setup --suggest Analyze project and predict risks → suggest hooks
|
|
@@ -1094,6 +1096,28 @@ async function saveProfile(name) {
|
|
|
1094
1096
|
console.log();
|
|
1095
1097
|
}
|
|
1096
1098
|
|
|
1099
|
+
function changelogCmd() {
|
|
1100
|
+
const clPath = join(__dirname, 'CHANGELOG.md');
|
|
1101
|
+
if (!existsSync(clPath)) {
|
|
1102
|
+
console.log(c.dim + ' No CHANGELOG.md found.' + c.reset);
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
const content = readFileSync(clPath, 'utf-8');
|
|
1106
|
+
const versions = content.split(/^## /m).filter(s => s.trim()).slice(0, 5);
|
|
1107
|
+
console.log();
|
|
1108
|
+
console.log(c.bold + ' Recent Changes' + c.reset);
|
|
1109
|
+
console.log();
|
|
1110
|
+
for (const v of versions) {
|
|
1111
|
+
const lines = v.split('\n');
|
|
1112
|
+
const header = lines[0].trim();
|
|
1113
|
+
console.log(c.bold + ' ' + header + c.reset);
|
|
1114
|
+
for (const line of lines.slice(1).filter(l => l.startsWith('- ')).slice(0, 3)) {
|
|
1115
|
+
console.log(c.dim + ' ' + line + c.reset);
|
|
1116
|
+
}
|
|
1117
|
+
console.log();
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1097
1121
|
async function scoreOnly() {
|
|
1098
1122
|
const { readdirSync } = await import('fs');
|
|
1099
1123
|
let score = 0;
|
|
@@ -4558,6 +4582,7 @@ async function main() {
|
|
|
4558
4582
|
if (WATCH) return watch();
|
|
4559
4583
|
if (TEST_HOOK_IDX !== -1) return testHook(TEST_HOOK);
|
|
4560
4584
|
if (SAVE_PROFILE_IDX !== -1) return saveProfile(SAVE_PROFILE);
|
|
4585
|
+
if (CHANGELOG_CMD) return changelogCmd();
|
|
4561
4586
|
if (SCORE_ONLY) return scoreOnly();
|
|
4562
4587
|
if (INIT_PROJECT) return initProject();
|
|
4563
4588
|
if (SUGGEST) return suggest();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-safe-setup",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.3.0",
|
|
4
4
|
"description": "One command to make Claude Code safe. 59 hooks (8 built-in + 51 examples). 26 CLI commands: dashboard, create, audit, lint, diff, migrate, compare, generate-ci. 284 tests.",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"bin": {
|