opencodecommit 1.0.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.
Files changed (4) hide show
  1. package/README.md +104 -0
  2. package/bin/occ +11 -0
  3. package/index.js +2 -0
  4. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # OpenCodeCommit
2
+
3
+ AI commit messages via terminal AI agents. VSCodium / VS Code extension + standalone Rust / npm CLI.
4
+
5
+ **Security scanning built in** — diffs are scanned locally for secrets, source maps, and private keys before anything leaves your machine.
6
+
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)
9
+
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
26
+
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 commit # generate message + commit
37
+ occ commit --dry-run # preview only, don't commit
38
+ occ commit --language Suomi # generate in Finnish
39
+ occ branch # generate branch name + checkout
40
+ occ branch --mode adaptive # match existing branch naming style
41
+ occ pr # generate PR title + body
42
+ occ changelog # generate changelog entry
43
+
44
+ # JSON output (default), or --text for human readable plain text
45
+ occ commit --text
46
+ occ commit --allow-sensitive # skip secret scanning
47
+ ```
48
+
49
+ `occ` is the short form. `opencodecommit` also works if `occ` clashes with something on your system.
50
+
51
+ Exit codes: 0 success, 1 no changes, 2 backend error, 3 config error, 5 sensitive content detected
52
+
53
+ ## Sensitive Content Detection
54
+
55
+ Diffs are scanned locally before being sent to any AI backend. The CLI blocks (exit 5) and the extension shows a warning dialog.
56
+
57
+ **Flagged file names:**
58
+
59
+ | Category | Patterns |
60
+ |----------|----------|
61
+ | Environment / secrets | `.env*`, `credentials.json`, `secret.*`, `secrets.*`, `.netrc`, `service-account*.json` |
62
+ | 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/) |
63
+ | Private keys / certs | `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.keystore`, `*.jks` |
64
+ | SSH keys | `id_rsa`, `id_ed25519`, `id_ecdsa`, `id_dsa`, `.ssh/*` |
65
+ | Auth files | `.htpasswd` |
66
+
67
+ | Category | Patterns |
68
+ |----------|----------|
69
+ | Generic secrets | `API_KEY`, `SECRET_KEY`, `ACCESS_TOKEN`, `AUTH_TOKEN`, `PRIVATE_KEY`, `PASSWORD`, `DB_PASSWORD`, `DATABASE_URL`, `CLIENT_SECRET`, `CREDENTIALS` |
70
+ | Service-specific | `AWS_SECRET`, `GH_TOKEN`, `NPM_TOKEN`, `SLACK_TOKEN`, `STRIPE_SECRET`, `SENDGRID_KEY`, `TWILIO_AUTH` |
71
+ | Token patterns | `Bearer <20+ chars>`, `sk-<20+ chars>`, `ghp_<20+ chars>`, `AKIA<12+ chars>` |
72
+
73
+ ## Configuration
74
+
75
+ All VSCodium / VS Code settings are prefixed with `opencodecommit.`. Key settings:
76
+
77
+ | Setting | Default | Description |
78
+ |---------|---------|-------------|
79
+ | `backendOrder` | `["codex","opencode","claude","gemini"]` | Backend fallback order |
80
+ | `commitMode` | `adaptive` | `adaptive`, `adaptive-oneliner`, `conventional`, `conventional-oneliner` |
81
+ | `branchMode` | `conventional` | `conventional` or `adaptive` (matches existing branch names) |
82
+ | `diffSource` | `auto` | `auto`, `staged`, or `all` |
83
+ | `languages` | English, Suomi | Array of language configs with custom prompt modules |
84
+ | `commitTemplate` | `{{type}}: {{message}}` | Supports `{{type}}`, `{{emoji}}`, `{{message}}` |
85
+
86
+ CLI config: `~/.config/opencodecommit/config.toml` (TOML with the same fields in kebab-case).
87
+
88
+ ## Languages
89
+
90
+ Built-in: **English** (default), **Suomi** (Finnish), **Custom (example)** (template for your own).
91
+
92
+ 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.
93
+
94
+ Add custom languages in config — only `label` and `instruction` are required:
95
+
96
+ ```toml
97
+ [[languages]]
98
+ label = "Deutsch"
99
+ instruction = "Schreibe die Commit-Nachricht auf Deutsch."
100
+ ```
101
+
102
+ ## License
103
+
104
+ [MIT](LICENSE)
package/bin/occ ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ const { execFileSync } = require("child_process")
3
+ const { getBinaryPath } = require("@nevaberry/opencodecommit")
4
+
5
+ try {
6
+ execFileSync(getBinaryPath(), process.argv.slice(2), { stdio: "inherit" })
7
+ } catch (err) {
8
+ if (err.status) process.exit(err.status)
9
+ console.error(err.message)
10
+ process.exit(1)
11
+ }
package/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // Re-export the scoped package so programmatic require() behaves the same.
2
+ module.exports = require("@nevaberry/opencodecommit")
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "opencodecommit",
3
+ "version": "1.0.4",
4
+ "description": "Official unscoped alias for @nevaberry/opencodecommit",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Nevaberry/opencodecommit.git"
9
+ },
10
+ "bin": {
11
+ "occ": "bin/occ",
12
+ "opencodecommit": "bin/occ"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "index.js"
17
+ ],
18
+ "scripts": {
19
+ "prepack": "cp ../../README.md . 2>/dev/null || true"
20
+ },
21
+ "keywords": [
22
+ "git",
23
+ "commit",
24
+ "ai",
25
+ "cli",
26
+ "opencode",
27
+ "claude",
28
+ "codex"
29
+ ],
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "dependencies": {
34
+ "@nevaberry/opencodecommit": "1.0.4"
35
+ }
36
+ }