opencodecommit 1.1.4 → 1.3.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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # OpenCodeCommit
2
2
 
3
3
  AI commit messages via terminal AI agents. VSCodium / VS Code extension + standalone Rust / npm CLI.
4
+ asdf
4
5
 
5
6
  **Security scanning built in** — diffs are scanned locally for secrets, source maps, and private keys before anything leaves your machine.
6
7
 
@@ -29,6 +30,7 @@ AI commit messages via terminal AI agents. VSCodium / VS Code extension + standa
29
30
  3. Commit message appears in the input box
30
31
 
31
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.
32
34
 
33
35
  ## CLI Usage
34
36
 
@@ -36,18 +38,24 @@ Dropdown menu: mode-specific generation, refine, branch name generation, switch
36
38
  occ tui # launch the minimal interactive TUI
37
39
  occ commit # generate message + commit
38
40
  occ commit --dry-run # preview only, don't commit
39
- occ commit --language Suomi # generate in Finnish
41
+ 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
40
47
  occ branch # generate branch name + checkout
41
48
  occ branch --mode adaptive # match existing branch naming style
42
49
  occ pr # generate PR title + body
50
+ occ pr --backend gemini --text
43
51
  occ changelog # generate changelog entry
44
52
 
45
53
  # JSON output (default), or --text for human readable plain text
46
54
  occ commit --text
47
- occ commit --allow-sensitive # skip secret scanning
55
+ occ commit --allow-sensitive # bypass blocking findings in non-strict modes
48
56
  ```
49
57
 
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.
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.
51
59
 
52
60
  `occ` is the short form. `opencodecommit` also works if `occ` clashes with something on your system.
53
61
 
@@ -60,20 +68,38 @@ Use OpenCodeCommit as a background safety layer for normal `git commit` usage:
60
68
  ```bash
61
69
  occ guard install --global # install a machine-wide commit guard
62
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
63
73
  ```
64
74
 
65
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.
66
76
 
67
77
  ## Sensitive Content Detection
68
78
 
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.
79
+ Diffs are scanned locally before being sent to any AI backend. Findings are classified as:
70
80
 
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:
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
84
+
85
+ Enforcement modes:
86
+
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:
72
96
 
73
97
  ```bash
74
98
  OCC_ALLOW_SENSITIVE=1 git commit ...
75
99
  ```
76
100
 
101
+ Strict modes ignore `OCC_ALLOW_SENSITIVE=1` and `--allow-sensitive`.
102
+
77
103
  **Flagged file names:**
78
104
 
79
105
  | Category | Patterns |
@@ -86,9 +112,9 @@ OCC_ALLOW_SENSITIVE=1 git commit ...
86
112
 
87
113
  | Category | Patterns |
88
114
  |----------|----------|
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>` |
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 |
92
118
 
93
119
  ## Configuration
94
120
 
@@ -100,16 +126,30 @@ All VSCodium / VS Code settings are prefixed with `opencodecommit.`. Key setting
100
126
  | `commitMode` | `adaptive` | `adaptive`, `adaptive-oneliner`, `conventional`, `conventional-oneliner` |
101
127
  | `branchMode` | `conventional` | `conventional` or `adaptive` (matches existing branch names) |
102
128
  | `diffSource` | `auto` | `auto`, `staged`, or `all` |
103
- | `languages` | English, Suomi | Array of language configs with custom prompt modules |
129
+ | `languages` | English, Finnish, Japanese, Chinese, Spanish, Portuguese, French, Korean, Russian, Vietnamese, German, Custom (example) | Array of language configs with custom prompt modules |
104
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 |
105
133
 
106
134
  CLI config: `~/.config/opencodecommit/config.toml` (TOML with the same fields in kebab-case).
107
135
 
136
+ Example:
137
+
138
+ ```toml
139
+ [sensitive]
140
+ enforcement = "block-high"
141
+
142
+ [[sensitive.allowlist]]
143
+ path-regex = "\\.env\\.example$"
144
+ rule = "openai-project-key"
145
+ value-regex = "^sk-proj-"
146
+ ```
147
+
108
148
  ## Languages
109
149
 
110
- Built-in: **English** (default), **Suomi** (Finnish), **Custom (example)** (template for your own).
150
+ Built-in: **English** (default), **Finnish**, **Japanese**, **Chinese**, **Spanish**, **Portuguese**, **French**, **Korean**, **Russian**, **Vietnamese**, **German**, **Custom (example)** (template for your own).
111
151
 
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.
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.
113
153
 
114
154
  Add custom languages in config — only `label` and `instruction` are required:
115
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencodecommit",
3
- "version": "1.1.4",
3
+ "version": "1.3.1",
4
4
  "description": "AI-powered git commit message generator that delegates to terminal AI agents",
5
5
  "license": "MIT",
6
6
  "repository": {
Binary file
Binary file
Binary file
Binary file
Binary file