ccperm 1.0.0 → 1.1.1
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/dist/cli.js +10 -14
- package/dist/scanner.js +10 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -14,13 +14,13 @@ const interactive_js_1 = require("./interactive.js");
|
|
|
14
14
|
const HELP = `${colors_js_1.CYAN}ccperm${colors_js_1.NC} — Audit Claude Code permissions across projects
|
|
15
15
|
|
|
16
16
|
${colors_js_1.YELLOW}Usage:${colors_js_1.NC}
|
|
17
|
-
ccperm Audit
|
|
18
|
-
ccperm --
|
|
17
|
+
ccperm Audit all projects under ~
|
|
18
|
+
ccperm --cwd Audit current directory only
|
|
19
19
|
|
|
20
20
|
${colors_js_1.YELLOW}Options:${colors_js_1.NC}
|
|
21
|
-
--
|
|
22
|
-
--verbose Show all permissions per project
|
|
23
|
-
|
|
21
|
+
--cwd Scan current directory only (default: all)
|
|
22
|
+
--verbose Show all permissions per project (static)
|
|
23
|
+
--static Force static output (default in non-TTY)
|
|
24
24
|
--help, -h Show this help
|
|
25
25
|
--version, -v Show version
|
|
26
26
|
|
|
@@ -37,13 +37,13 @@ async function main() {
|
|
|
37
37
|
console.log((0, updater_js_1.getVersion)());
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const isCwd = args.includes('--cwd');
|
|
41
41
|
const isFix = args.includes('--fix');
|
|
42
42
|
const isVerbose = args.includes('--verbose');
|
|
43
|
-
const
|
|
43
|
+
const isStatic = args.includes('--static') || !process.stdout.isTTY;
|
|
44
44
|
console.log(`\n ${colors_js_1.CYAN}${colors_js_1.BOLD}ccperm${colors_js_1.NC} ${colors_js_1.DIM}v${(0, updater_js_1.getVersion)()}${colors_js_1.NC} — Claude Code Permission Audit\n`);
|
|
45
|
-
const searchDir =
|
|
46
|
-
console.log(` Scope: ${colors_js_1.YELLOW}${
|
|
45
|
+
const searchDir = isCwd ? process.cwd() : node_os_1.default.homedir();
|
|
46
|
+
console.log(` Scope: ${colors_js_1.YELLOW}${isCwd ? searchDir : '~ (all projects)'}${colors_js_1.NC}`);
|
|
47
47
|
const files = (0, scanner_js_1.findSettingsFiles)(searchDir);
|
|
48
48
|
if (files.length === 0) {
|
|
49
49
|
console.log(` ${colors_js_1.GREEN}✔ No settings files found.${colors_js_1.NC}\n`);
|
|
@@ -53,11 +53,7 @@ async function main() {
|
|
|
53
53
|
const results = files.map(scanner_js_1.scanFile).filter((r) => r !== null);
|
|
54
54
|
const merged = (0, aggregator_js_1.mergeByProject)(results);
|
|
55
55
|
const summary = (0, aggregator_js_1.summarize)(results);
|
|
56
|
-
if (
|
|
57
|
-
if (!process.stdin.isTTY) {
|
|
58
|
-
console.error(` ${colors_js_1.RED}Error: --interactive requires a TTY terminal.${colors_js_1.NC}\n`);
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
56
|
+
if (!isStatic && !isFix) {
|
|
61
57
|
await (0, interactive_js_1.startInteractive)(merged, results);
|
|
62
58
|
return;
|
|
63
59
|
}
|
package/dist/scanner.js
CHANGED
|
@@ -13,11 +13,20 @@ const PERM_RE = /"(Bash|Write|Edit|Read|Glob|Grep|WebSearch|WebFetch|mcp_)[^"]*"
|
|
|
13
13
|
const DEPRECATED_RE = /:\*\)|:\*"/g;
|
|
14
14
|
exports.DEPRECATED_PERM_RE = /:\*$|:\*\)/;
|
|
15
15
|
function findSettingsFiles(searchDir) {
|
|
16
|
+
const prune = ['node_modules', '.git', '.cache', '.local', '.npm', '.nvm', '.bun',
|
|
17
|
+
'snap', '.vscode', '.docker', '.cargo', '.rustup', 'go', '.gradle', '.m2',
|
|
18
|
+
'Library', '.Trash', 'Pictures', 'Music', 'Videos', 'Downloads'];
|
|
19
|
+
const pruneArgs = prune.flatMap((d) => ['-name', d, '-o']).slice(0, -1);
|
|
16
20
|
let lines;
|
|
17
21
|
try {
|
|
18
|
-
const out = (0, node_child_process_1.execFileSync)('find', [
|
|
22
|
+
const out = (0, node_child_process_1.execFileSync)('find', [
|
|
23
|
+
searchDir,
|
|
24
|
+
'(', ...pruneArgs, ')', '-prune',
|
|
25
|
+
'-o', '-path', '*/.claude/settings*.json', '-type', 'f', '-print',
|
|
26
|
+
], {
|
|
19
27
|
encoding: 'utf8',
|
|
20
28
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
29
|
+
timeout: 10000,
|
|
21
30
|
});
|
|
22
31
|
lines = out.trim().split('\n').filter(Boolean);
|
|
23
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccperm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Audit Claude Code permissions across all your projects",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ccperm": "bin/ccperm.js"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"cli",
|
|
17
17
|
"fixer"
|
|
18
18
|
],
|
|
19
|
-
"author": "Dongkeon Kim",
|
|
19
|
+
"author": "Dongkeon Kim <amos@shallwefootball.com>",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=18"
|