opencodecommit 1.2.1 → 1.3.2

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 CHANGED
@@ -1,123 +1,93 @@
1
1
  # OpenCodeCommit
2
2
 
3
- AI commit messages via terminal AI agents. VSCodium / VS Code extension + standalone Rust / npm CLI.
3
+ AI commit, branch, PR, and changelog generation through terminal AI CLIs.
4
4
 
5
- **Security scanning built in** — diffs are scanned locally for secrets, source maps, and private keys before anything leaves your machine.
5
+ OpenCodeCommit works as:
6
+ - a Rust / npm CLI (`occ`)
7
+ - a terminal TUI
8
+ - a VS Code / VSCodium extension
6
9
 
7
- [VSCodium Open VSX registry](https://open-vsx.org/extension/Nevaberry/opencodecommit)<br>
8
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Nevaberry.opencodecommit) · [npm](https://www.npmjs.com/package/opencodecommit) · [scoped npm](https://www.npmjs.com/package/@nevaberry/opencodecommit) · [crates.io](https://crates.io/crates/opencodecommit) · [GitHub](https://github.com/Nevaberry/opencodecommit)
10
+ Before any prompt leaves your machine, OpenCodeCommit scans the diff locally for secrets, credential files, source maps, private keys, and other sensitive artifacts.
9
11
 
10
- ## Install
11
-
12
- **Extension:** Search "OpenCodeCommit" in VSCodium / VS Code, or `ext install Nevaberry.opencodecommit`
13
-
14
- **CLI:** `cargo install opencodecommit` or `npm i -g opencodecommit` (official unscoped alias: `@nevaberry/opencodecommit`)
15
-
16
- **Prerequisite:** At least one CLI backend:
17
-
18
- | Backend | Install |
19
- |---------|---------|
20
- | [Codex CLI](https://github.com/openai/codex) | `npm i -g @openai/codex` |
21
- | [OpenCode](https://github.com/nicepkg/opencode) | `npm i -g opencode` |
22
- | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm i -g @google/gemini-cli` |
23
- | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `npm i -g @anthropic-ai/claude-code` |
24
-
25
- ## VSCodium / VS Code Usage
12
+ [Open VSX](https://open-vsx.org/extension/Nevaberry/opencodecommit) · [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Nevaberry.opencodecommit) · [npm](https://www.npmjs.com/package/opencodecommit) · [scoped npm alias](https://www.npmjs.com/package/@nevaberry/opencodecommit) · [crates.io](https://crates.io/crates/opencodecommit) · [GitHub](https://github.com/Nevaberry/opencodecommit)
26
13
 
27
- 1. Stage changes (or leave unstaged — auto-detected)
28
- 2. Click the **sparkle button** in Source Control
29
- 3. Commit message appears in the input box
30
-
31
- Dropdown menu: mode-specific generation, refine, branch name generation, switch language, diagnose.
32
-
33
- ## CLI Usage
34
-
35
- ```bash
36
- occ tui # launch the minimal interactive TUI
37
- occ commit # generate message + commit
38
- occ commit --dry-run # preview only, don't commit
39
- occ commit --language Suomi # generate in Finnish
40
- occ branch # generate branch name + checkout
41
- occ branch --mode adaptive # match existing branch naming style
42
- occ pr # generate PR title + body
43
- occ changelog # generate changelog entry
44
-
45
- # JSON output (default), or --text for human readable plain text
46
- occ commit --text
47
- occ commit --allow-sensitive # skip secret scanning
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
-
52
- `occ` is the short form. `opencodecommit` also works if `occ` clashes with something on your system.
14
+ ## Install
53
15
 
54
- Exit codes: 0 success, 1 no changes, 2 backend error, 3 config error, 5 sensitive content detected
16
+ Extension:
17
+ - Search for `OpenCodeCommit` in VS Code or VSCodium
18
+ - Or run `ext install Nevaberry.opencodecommit`
55
19
 
56
- ## Transparent Git Guard
20
+ CLI:
21
+ - `cargo install opencodecommit`
22
+ - `npm i -g opencodecommit`
57
23
 
58
- Use OpenCodeCommit as a background safety layer for normal `git commit` usage:
24
+ Backends:
25
+ - `npm i -g @openai/codex`
26
+ - `npm i -g opencode`
27
+ - `npm i -g @anthropic-ai/claude-code`
28
+ - `npm i -g @google/gemini-cli`
59
29
 
60
- ```bash
61
- occ guard install --global # install a machine-wide commit guard
62
- occ guard uninstall --global # remove the machine-wide guard
63
- ```
30
+ ## Highlights
64
31
 
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.
32
+ - Backend fallback across Codex, OpenCode, Claude Code, and Gemini, plus one-shot backend picks in the TUI and extension.
33
+ - Commit, PR, branch, and changelog generation from the same config surface.
34
+ - Built-in languages: English, Finnish, Japanese, Chinese, Spanish, Portuguese, French, Korean, Russian, Vietnamese, and German.
35
+ - Terminal TUI with a file sidebar that merges staged, unstaged, and untracked files and lets you stage or unstage the selected file with `Space`.
36
+ - Transparent git guard for normal `git commit` flows.
66
37
 
67
- ## Sensitive Content Detection
38
+ ## Quick Start
68
39
 
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.
40
+ Extension:
41
+ 1. Open Source Control.
42
+ 2. Click the sparkle action.
43
+ 3. Use the dropdown for refine, branch, PR, language, backend, or diagnose actions.
70
44
 
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:
45
+ CLI:
72
46
 
73
47
  ```bash
74
- OCC_ALLOW_SENSITIVE=1 git commit ...
48
+ occ tui
49
+ occ commit
50
+ occ commit --backend gemini --dry-run --text
51
+ occ commit --language Japanese
52
+ occ branch --dry-run
53
+ occ pr --text
54
+ occ changelog --text
55
+ occ guard install --global
56
+ occ update
75
57
  ```
76
58
 
77
- **Flagged file names:**
59
+ ## Security Scanner
78
60
 
79
- | Category | Patterns |
80
- |----------|----------|
81
- | Environment / secrets | `.env*`, `credentials.json`, `secret.*`, `secrets.*`, `.netrc`, `service-account*.json` |
82
- | Source maps | `*.js.map`, `*.css.map`, `*.map` [can expose full source code](https://arstechnica.com/ai/2026/03/entire-claude-code-cli-source-code-leaks-thanks-to-exposed-map-file/) |
83
- | Private keys / certs | `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.keystore`, `*.jks` |
84
- | SSH keys | `id_rsa`, `id_ed25519`, `id_ecdsa`, `id_dsa`, `.ssh/*` |
85
- | Auth files | `.htpasswd` |
61
+ The local scanner now checks for:
62
+ - provider tokens and webhook URLs for OpenAI, Anthropic, GitHub, GitLab, AWS, Slack, Stripe, SendGrid, npm, PyPI, Docker, Vault, Discord, Teams, and more
63
+ - bearer tokens, JWTs, Docker auth blobs, kube auth fields, and credential-bearing connection strings
64
+ - `.env*`, `.npmrc`, `.git-credentials`, `.kube/config`, Terraform state and vars, service-account JSON, key stores, SSH keys, and private key material
65
+ - exposed source maps such as `*.js.map` and `*.css.map`
86
66
 
87
- | Category | Patterns |
88
- |----------|----------|
89
- | Generic secrets | `API_KEY`, `SECRET_KEY`, `ACCESS_TOKEN`, `AUTH_TOKEN`, `PRIVATE_KEY`, `PASSWORD`, `DB_PASSWORD`, `DATABASE_URL`, `CLIENT_SECRET`, `CREDENTIALS` |
90
- | Service-specific | `AWS_SECRET`, `GH_TOKEN`, `NPM_TOKEN`, `SLACK_TOKEN`, `STRIPE_SECRET`, `SENDGRID_KEY`, `TWILIO_AUTH` |
91
- | Token patterns | `Bearer <20+ chars>`, `sk-<20+ chars>`, `ghp_<20+ chars>`, `AKIA<12+ chars>` |
67
+ Enforcement modes:
68
+ - `warn`
69
+ - `block-high`
70
+ - `block-all`
71
+ - `strict-high`
72
+ - `strict-all`
92
73
 
93
- ## Configuration
74
+ Use `occ guard profile human` for warnings-first local use, or `occ guard profile strict-agent` when you want non-bypassable blocking behavior for autonomous tooling.
94
75
 
95
- All VSCodium / VS Code settings are prefixed with `opencodecommit.`. Key settings:
76
+ ## Config
96
77
 
97
- | Setting | Default | Description |
98
- |---------|---------|-------------|
99
- | `backendOrder` | `["codex","opencode","claude","gemini"]` | Backend fallback order |
100
- | `commitMode` | `adaptive` | `adaptive`, `adaptive-oneliner`, `conventional`, `conventional-oneliner` |
101
- | `branchMode` | `conventional` | `conventional` or `adaptive` (matches existing branch names) |
102
- | `diffSource` | `auto` | `auto`, `staged`, or `all` |
103
- | `languages` | English, Suomi | Array of language configs with custom prompt modules |
104
- | `commitTemplate` | `{{type}}: {{message}}` | Supports `{{type}}`, `{{emoji}}`, `{{message}}` |
78
+ VS Code / VSCodium settings live under `opencodecommit.*`.
105
79
 
106
- CLI config: `~/.config/opencodecommit/config.toml` (TOML with the same fields in kebab-case).
80
+ CLI config lives at `~/.config/opencodecommit/config.toml`.
81
+ On first CLI use, OpenCodeCommit writes the full default config there so the available settings are visible in one file.
107
82
 
108
- ## Languages
109
-
110
- Built-in: **English** (default), **Suomi** (Finnish), **Custom (example)** (template for your own).
111
-
112
- Each language defines full prompt modules (base, adaptive, conventional, length, sensitive note). Missing modules fall back to English. CLI: `--language Suomi`. Extension: dropdown menu or `opencodecommit.activeLanguage` setting.
113
-
114
- Add custom languages in config — only `label` and `instruction` are required:
115
-
116
- ```toml
117
- [[languages]]
118
- label = "Deutsch"
119
- instruction = "Schreibe die Commit-Nachricht auf Deutsch."
120
- ```
83
+ Useful settings:
84
+ - `backendOrder`
85
+ - `commitMode`
86
+ - `branchMode`
87
+ - `diffSource`
88
+ - `activeLanguage`
89
+ - `sensitive.enforcement`
90
+ - `sensitive.allowlist`
121
91
 
122
92
  ## License
123
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodecommit",
3
- "version": "1.2.1",
3
+ "version": "1.3.2",
4
4
  "description": "AI-powered git commit message generator that delegates to terminal AI agents",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,7 +18,8 @@
18
18
  "index.js"
19
19
  ],
20
20
  "scripts": {
21
- "prepack": "cp ../../README.md . 2>/dev/null || true",
21
+ "prepack": "node scripts/sync-readme.js materialize",
22
+ "postpack": "node scripts/sync-readme.js relink",
22
23
  "postinstall": "node scripts/postinstall.js"
23
24
  },
24
25
  "keywords": [
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs")
4
+ const path = require("path")
5
+
6
+ const packageRoot = path.resolve(__dirname, "..")
7
+ const repoReadme = path.resolve(packageRoot, "..", "..", "README.md")
8
+ const packageReadme = path.join(packageRoot, "README.md")
9
+ const relativeTarget = "../../README.md"
10
+ const mode = process.argv[2]
11
+
12
+ function removeIfExists(target) {
13
+ try {
14
+ fs.rmSync(target, { force: true })
15
+ } catch (error) {
16
+ if (error && error.code !== "ENOENT") throw error
17
+ }
18
+ }
19
+
20
+ if (mode === "materialize") {
21
+ removeIfExists(packageReadme)
22
+ fs.copyFileSync(repoReadme, packageReadme)
23
+ } else if (mode === "relink") {
24
+ removeIfExists(packageReadme)
25
+ fs.symlinkSync(relativeTarget, packageReadme)
26
+ } else {
27
+ console.error("usage: node scripts/sync-readme.js <materialize|relink>")
28
+ process.exit(1)
29
+ }