opencodecommit 1.3.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,163 +1,93 @@
1
1
  # OpenCodeCommit
2
2
 
3
- AI commit messages via terminal AI agents. VSCodium / VS Code extension + standalone Rust / npm CLI.
4
- asdf
3
+ AI commit, branch, PR, and changelog generation through terminal AI CLIs.
5
4
 
6
- **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
7
9
 
8
- [VSCodium Open VSX registry](https://open-vsx.org/extension/Nevaberry/opencodecommit)<br>
9
- [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.
11
+
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)
10
13
 
11
14
  ## Install
12
15
 
13
- **Extension:** Search "OpenCodeCommit" in VSCodium / VS Code, or `ext install Nevaberry.opencodecommit`
16
+ Extension:
17
+ - Search for `OpenCodeCommit` in VS Code or VSCodium
18
+ - Or run `ext install Nevaberry.opencodecommit`
14
19
 
15
- **CLI:** `cargo install opencodecommit` or `npm i -g opencodecommit` (official unscoped alias: `@nevaberry/opencodecommit`)
20
+ CLI:
21
+ - `cargo install opencodecommit`
22
+ - `npm i -g opencodecommit`
16
23
 
17
- **Prerequisite:** At least one CLI backend:
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`
18
29
 
19
- | Backend | Install |
20
- |---------|---------|
21
- | [Codex CLI](https://github.com/openai/codex) | `npm i -g @openai/codex` |
22
- | [OpenCode](https://github.com/nicepkg/opencode) | `npm i -g opencode` |
23
- | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `npm i -g @google/gemini-cli` |
24
- | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | `npm i -g @anthropic-ai/claude-code` |
30
+ ## Highlights
25
31
 
26
- ## VSCodium / VS Code Usage
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.
27
37
 
28
- 1. Stage changes (or leave unstaged — auto-detected)
29
- 2. Click the **sparkle button** in Source Control
30
- 3. Commit message appears in the input box
38
+ ## Quick Start
31
39
 
32
- Dropdown menu: mode-specific generation, refine, branch name generation, switch language, diagnose.
33
- Single-backend testing is available from dedicated SCM submenus for adaptive commit generation and PR generation; the main generate actions still follow fallback order.
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.
34
44
 
35
- ## CLI Usage
45
+ CLI:
36
46
 
37
47
  ```bash
38
- occ tui # launch the minimal interactive TUI
39
- occ commit # generate message + commit
40
- occ commit --dry-run # preview only, don't commit
48
+ occ tui
49
+ occ commit
41
50
  occ commit --backend gemini --dry-run --text
42
- occ commit --language Finnish # generate in Finnish
43
- occ commit --language Spanish # generate in Spanish
44
- occ commit --language Korean # generate in Korean
45
- occ guard profile human # set human-friendly warning mode
46
- occ guard profile strict-agent # set strict agent-safe mode
47
- occ branch # generate branch name + checkout
48
- occ branch --mode adaptive # match existing branch naming style
49
- occ pr # generate PR title + body
50
- occ pr --backend gemini --text
51
- occ changelog # generate changelog entry
52
-
53
- # JSON output (default), or --text for human readable plain text
54
- occ commit --text
55
- occ commit --allow-sensitive # bypass blocking findings in non-strict modes
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
56
57
  ```
57
58
 
58
- `occ tui` is a small launcher over the existing commands, not a full git dashboard. It lets you generate, shorten, and commit messages, preview branch / PR / changelog output, install the safety hook, switch between human / strict-agent sensitive profiles, and run one-shot `Commit Backend` / `PR Backend` actions without changing the default backend.
59
-
60
- `occ` is the short form. `opencodecommit` also works if `occ` clashes with something on your system.
61
-
62
- Exit codes: 0 success, 1 no changes, 2 backend error, 3 config error, 5 sensitive content detected
63
-
64
- ## Transparent Git Guard
65
-
66
- Use OpenCodeCommit as a background safety layer for normal `git commit` usage:
67
-
68
- ```bash
69
- occ guard install --global # install a machine-wide commit guard
70
- occ guard uninstall --global # remove the machine-wide guard
71
- occ guard profile human # warn by default, tuned for humans
72
- occ guard profile strict-agent # strict-all, no bypass
73
- ```
59
+ ## Security Scanner
74
60
 
75
- 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.
76
-
77
- ## Sensitive Content Detection
78
-
79
- Diffs are scanned locally before being sent to any AI backend. Findings are classified as:
80
-
81
- - `confirmed-secret`: real provider tokens, private keys, credential-bearing URLs, webhook secrets
82
- - `sensitive-artifact`: `.env`, kubeconfig, Terraform state, credential stores, key containers
83
- - `suspicious`: generic assignments, local connection strings, public IPv4s, source maps, docs/examples with weaker evidence
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`
84
66
 
85
67
  Enforcement modes:
68
+ - `warn`
69
+ - `block-high`
70
+ - `block-all`
71
+ - `strict-high`
72
+ - `strict-all`
86
73
 
87
- - `warn`: default. Show the report, but continue after acknowledgement.
88
- - `block-high`: block only high-confidence findings, allow a one-shot bypass.
89
- - `block-all`: block all findings, allow a one-shot bypass.
90
- - `strict-high`: block high-confidence findings, ignore bypass flags.
91
- - `strict-all`: block all findings, ignore bypass flags.
92
-
93
- `occ commit` exits with code `5` for blocking findings. In `warn` mode, text-mode `occ commit` prints the report and continues automatically. The global guard warns and returns success in `warn` mode, blocks in `block-*`, and blocks without bypass in `strict-*`.
94
-
95
- Reports include the file, line number when available, rule, tier, and a redacted snippet preview. If a non-strict guard block is an intentional false positive, bypass only OpenCodeCommit for that one command:
96
-
97
- ```bash
98
- OCC_ALLOW_SENSITIVE=1 git commit ...
99
- ```
100
-
101
- Strict modes ignore `OCC_ALLOW_SENSITIVE=1` and `--allow-sensitive`.
102
-
103
- **Flagged file names:**
104
-
105
- | Category | Patterns |
106
- |----------|----------|
107
- | Environment / secrets | `.env*`, `credentials.json`, `secret.*`, `secrets.*`, `.netrc`, `service-account*.json` |
108
- | 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/) |
109
- | Private keys / certs | `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.keystore`, `*.jks` |
110
- | SSH keys | `id_rsa`, `id_ed25519`, `id_ecdsa`, `id_dsa`, `.ssh/*` |
111
- | Auth files | `.htpasswd` |
112
-
113
- | Category | Patterns |
114
- |----------|----------|
115
- | Generic secrets | assignment-based heuristics for `PASSWORD`, `SECRET_KEY`, `ACCESS_TOKEN`, `DB_PASSWORD`, `DATABASE_URL`, `CLIENT_SECRET`, `CREDENTIALS` |
116
- | Service-specific | OpenAI, GitHub, AWS, Slack, Stripe, SendGrid, npm, PyPI, Docker, Vault, Discord, Teams |
117
- | Structural patterns | `Bearer <token>`, JWTs, private key PEM headers, Docker auth blobs, kube auth fields, credential-bearing connection strings |
118
-
119
- ## Configuration
120
-
121
- All VSCodium / VS Code settings are prefixed with `opencodecommit.`. Key settings:
122
-
123
- | Setting | Default | Description |
124
- |---------|---------|-------------|
125
- | `backendOrder` | `["codex","opencode","claude","gemini"]` | Backend fallback order |
126
- | `commitMode` | `adaptive` | `adaptive`, `adaptive-oneliner`, `conventional`, `conventional-oneliner` |
127
- | `branchMode` | `conventional` | `conventional` or `adaptive` (matches existing branch names) |
128
- | `diffSource` | `auto` | `auto`, `staged`, or `all` |
129
- | `languages` | English, Finnish, Japanese, Chinese, Spanish, Portuguese, French, Korean, Russian, Vietnamese, German, Custom (example) | Array of language configs with custom prompt modules |
130
- | `commitTemplate` | `{{type}}: {{message}}` | Supports `{{type}}`, `{{emoji}}`, `{{message}}` |
131
- | `sensitive.enforcement` | `warn` | `warn`, `block-high`, `block-all`, `strict-high`, or `strict-all` |
132
- | `sensitive.allowlist` | `[]` | Suppress findings by `pathRegex`, `rule`, and/or `valueRegex` with AND semantics |
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.
133
75
 
134
- CLI config: `~/.config/opencodecommit/config.toml` (TOML with the same fields in kebab-case).
76
+ ## Config
135
77
 
136
- Example:
78
+ VS Code / VSCodium settings live under `opencodecommit.*`.
137
79
 
138
- ```toml
139
- [sensitive]
140
- enforcement = "block-high"
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.
141
82
 
142
- [[sensitive.allowlist]]
143
- path-regex = "\\.env\\.example$"
144
- rule = "openai-project-key"
145
- value-regex = "^sk-proj-"
146
- ```
147
-
148
- ## Languages
149
-
150
- Built-in: **English** (default), **Finnish**, **Japanese**, **Chinese**, **Spanish**, **Portuguese**, **French**, **Korean**, **Russian**, **Vietnamese**, **German**, **Custom (example)** (template for your own).
151
-
152
- Each language defines full prompt modules (base, adaptive, conventional, length, sensitive note). Missing modules fall back to English. CLI: `--language <built-in label>`. Extension: dropdown menu or `opencodecommit.activeLanguage` setting.
153
-
154
- Add custom languages in config — only `label` and `instruction` are required:
155
-
156
- ```toml
157
- [[languages]]
158
- label = "Deutsch"
159
- instruction = "Schreibe die Commit-Nachricht auf Deutsch."
160
- ```
83
+ Useful settings:
84
+ - `backendOrder`
85
+ - `commitMode`
86
+ - `branchMode`
87
+ - `diffSource`
88
+ - `activeLanguage`
89
+ - `sensitive.enforcement`
90
+ - `sensitive.allowlist`
161
91
 
162
92
  ## License
163
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodecommit",
3
- "version": "1.3.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
+ }