opencodecommit 1.0.4 → 1.1.4
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 +21 -1
- package/bin/occ +6 -7
- package/index.js +19 -2
- package/package.json +6 -6
- package/platforms/darwin-arm64/.gitkeep +0 -0
- package/platforms/darwin-arm64/occ +0 -0
- package/platforms/darwin-x64/.gitkeep +0 -0
- package/platforms/darwin-x64/occ +0 -0
- package/platforms/linux-arm64/.gitkeep +0 -0
- package/platforms/linux-arm64/occ +0 -0
- package/platforms/linux-x64/.gitkeep +0 -0
- package/platforms/linux-x64/occ +0 -0
- package/platforms/win32-x64/.gitkeep +0 -0
- package/platforms/win32-x64/occ.exe +0 -0
- package/scripts/postinstall.js +41 -0
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ Dropdown menu: mode-specific generation, refine, branch name generation, switch
|
|
|
33
33
|
## CLI Usage
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
+
occ tui # launch the minimal interactive TUI
|
|
36
37
|
occ commit # generate message + commit
|
|
37
38
|
occ commit --dry-run # preview only, don't commit
|
|
38
39
|
occ commit --language Suomi # generate in Finnish
|
|
@@ -46,13 +47,32 @@ occ commit --text
|
|
|
46
47
|
occ commit --allow-sensitive # skip secret scanning
|
|
47
48
|
```
|
|
48
49
|
|
|
50
|
+
`occ tui` is a small launcher over the existing commands, not a full git dashboard. It lets you generate, shorten, and commit messages, plus preview branch / PR / changelog output from one screen.
|
|
51
|
+
|
|
49
52
|
`occ` is the short form. `opencodecommit` also works if `occ` clashes with something on your system.
|
|
50
53
|
|
|
51
54
|
Exit codes: 0 success, 1 no changes, 2 backend error, 3 config error, 5 sensitive content detected
|
|
52
55
|
|
|
56
|
+
## Transparent Git Guard
|
|
57
|
+
|
|
58
|
+
Use OpenCodeCommit as a background safety layer for normal `git commit` usage:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
occ guard install --global # install a machine-wide commit guard
|
|
62
|
+
occ guard uninstall --global # remove the machine-wide guard
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This installs a managed global hooks directory via `core.hooksPath`. `pre-commit` scans the staged diff for sensitive content, and other hook names are chained through so existing repo hooks still run.
|
|
66
|
+
|
|
53
67
|
## Sensitive Content Detection
|
|
54
68
|
|
|
55
|
-
Diffs are scanned locally before being sent to any AI backend.
|
|
69
|
+
Diffs are scanned locally before being sent to any AI backend. `occ commit` blocks with exit code 5, and the global guard blocks normal `git commit` before the commit is created.
|
|
70
|
+
|
|
71
|
+
Guard warnings include the file, line number when available, rule, and a redacted snippet preview. If a hook-mode block is an intentional false positive, bypass only OpenCodeCommit for that one command:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
OCC_ALLOW_SENSITIVE=1 git commit ...
|
|
75
|
+
```
|
|
56
76
|
|
|
57
77
|
**Flagged file names:**
|
|
58
78
|
|
package/bin/occ
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const { execFileSync } = require("child_process")
|
|
3
|
-
const { getBinaryPath } = require("
|
|
4
|
-
|
|
2
|
+
const { execFileSync } = require("child_process");
|
|
3
|
+
const { getBinaryPath } = require("../index.js");
|
|
5
4
|
try {
|
|
6
|
-
execFileSync(getBinaryPath(), process.argv.slice(2), { stdio: "inherit" })
|
|
5
|
+
execFileSync(getBinaryPath(), process.argv.slice(2), { stdio: "inherit" });
|
|
7
6
|
} catch (err) {
|
|
8
|
-
if (err.status) process.exit(err.status)
|
|
9
|
-
console.error(err.message)
|
|
10
|
-
process.exit(1)
|
|
7
|
+
if (err.status) process.exit(err.status);
|
|
8
|
+
console.error(err.message);
|
|
9
|
+
process.exit(1);
|
|
11
10
|
}
|
package/index.js
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Resolves the correct platform binary and returns its path.
|
|
3
|
+
// Used by: require("opencodecommit") in programmatic contexts.
|
|
4
|
+
|
|
5
|
+
const path = require("path")
|
|
6
|
+
|
|
7
|
+
const SUPPORTED = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64"]
|
|
8
|
+
|
|
9
|
+
function getBinaryPath() {
|
|
10
|
+
const platform = `${process.platform}-${process.arch}`
|
|
11
|
+
if (!SUPPORTED.includes(platform)) {
|
|
12
|
+
throw new Error(`opencodecommit: unsupported platform ${platform}`)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const ext = process.platform === "win32" ? ".exe" : ""
|
|
16
|
+
return path.join(__dirname, "platforms", platform, `occ${ext}`)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = { getBinaryPath, SUPPORTED }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencodecommit",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "AI-powered git commit message generator that delegates to terminal AI agents",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"bin",
|
|
16
|
+
"scripts",
|
|
17
|
+
"platforms",
|
|
16
18
|
"index.js"
|
|
17
19
|
],
|
|
18
20
|
"scripts": {
|
|
19
|
-
"prepack": "cp ../../README.md . 2>/dev/null || true"
|
|
21
|
+
"prepack": "cp ../../README.md . 2>/dev/null || true",
|
|
22
|
+
"postinstall": "node scripts/postinstall.js"
|
|
20
23
|
},
|
|
21
24
|
"keywords": [
|
|
22
25
|
"git",
|
|
@@ -29,8 +32,5 @@
|
|
|
29
32
|
],
|
|
30
33
|
"engines": {
|
|
31
34
|
"node": ">=18"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@nevaberry/opencodecommit": "1.0.4"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Resolve the platform-specific binary and symlink it to bin/opencodecommit
|
|
3
|
+
|
|
4
|
+
const fs = require("fs")
|
|
5
|
+
const path = require("path")
|
|
6
|
+
|
|
7
|
+
const SUPPORTED = ["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64", "win32-x64"]
|
|
8
|
+
|
|
9
|
+
const platform = `${process.platform}-${process.arch}`
|
|
10
|
+
|
|
11
|
+
if (!SUPPORTED.includes(platform)) {
|
|
12
|
+
console.error(`opencodecommit: unsupported platform ${platform}`)
|
|
13
|
+
console.error(`Supported: ${SUPPORTED.join(", ")}`)
|
|
14
|
+
process.exit(0) // Don't fail install, just warn
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const ext = process.platform === "win32" ? ".exe" : ""
|
|
19
|
+
const binaryPath = path.join(__dirname, "..", "platforms", platform, `occ${ext}`)
|
|
20
|
+
const binTarget = path.join(__dirname, "..", "bin", `occ${ext}`)
|
|
21
|
+
|
|
22
|
+
if (!fs.existsSync(binaryPath)) {
|
|
23
|
+
console.error(`opencodecommit: binary not found at ${binaryPath}`)
|
|
24
|
+
process.exit(0)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Remove existing symlink/file
|
|
28
|
+
try { fs.unlinkSync(binTarget) } catch { /* ok */ }
|
|
29
|
+
|
|
30
|
+
// Create symlink (or copy on Windows)
|
|
31
|
+
if (process.platform === "win32") {
|
|
32
|
+
fs.copyFileSync(binaryPath, binTarget)
|
|
33
|
+
} else {
|
|
34
|
+
fs.symlinkSync(binaryPath, binTarget)
|
|
35
|
+
fs.chmodSync(binTarget, 0o755)
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error(`opencodecommit: failed to link binary for ${platform}`)
|
|
39
|
+
console.error(err.message)
|
|
40
|
+
process.exit(0) // Don't fail install
|
|
41
|
+
}
|