contribute-now 0.7.1 → 0.7.2-dev.2734078
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 +84 -70
- package/dist/cli.js +16074 -0
- package/dist/index.js +31 -17343
- package/package.json +2 -5
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ It natively supports multiple workflow models and commit conventions, with AI-po
|
|
|
14
14
|
|
|
15
15
|
## Workflow Modes
|
|
16
16
|
|
|
17
|
-
Pick the model that matches your project during `
|
|
17
|
+
Pick the model that matches your project during `cn setup`. contribute-now adapts its commands to your chosen workflow automatically — no manual branch names to remember.
|
|
18
18
|
|
|
19
19
|
| Mode | Branches | Strategy | Default |
|
|
20
20
|
|------|----------|----------|:-------:|
|
|
@@ -37,17 +37,21 @@ contribute-now validates commit messages and guides your AI toward the right for
|
|
|
37
37
|
## Quick Start
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
|
|
40
|
+
bunx contribute-now setup
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
Or install globally:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
bun install -g contribute-now
|
|
47
|
+
contribute setup
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
`contribute-now` now runs on Bun at runtime. Use `bunx` for one-off execution and `bun install -g` for a global install.
|
|
51
|
+
|
|
52
|
+
> `contribute` is the primary command; `cn` is the short alias for the same binary — use whichever you prefer.
|
|
53
|
+
>
|
|
54
|
+
> The older `contrib` alias is being phased out. Please switch to `contribute` or `cn`.
|
|
51
55
|
>
|
|
52
56
|
> **Fun fact:** `cn` is shorter than `git`. Yes, your workflow command is now faster to type than git itself. 🚀
|
|
53
57
|
|
|
@@ -56,21 +60,29 @@ contrib setup
|
|
|
56
60
|
## Installation
|
|
57
61
|
|
|
58
62
|
```bash
|
|
59
|
-
#
|
|
60
|
-
|
|
63
|
+
# one-off
|
|
64
|
+
bunx contribute-now setup
|
|
61
65
|
|
|
62
|
-
#
|
|
66
|
+
# global
|
|
63
67
|
bun install -g contribute-now
|
|
64
68
|
```
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
If you prefer to install the package from npm, install Bun first and then install `contribute-now`:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npm install -g bun
|
|
74
|
+
npm install -g contribute-now
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Once installed, you can use either alias:
|
|
67
78
|
|
|
68
79
|
```bash
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
cn setup # shortest — even shorter than git!
|
|
80
|
+
contribute setup # primary command — spelled out
|
|
81
|
+
cn setup # short alias — even shorter than git!
|
|
72
82
|
```
|
|
73
83
|
|
|
84
|
+
> The legacy `contrib` alias still works but is being phased out. Prefer `contribute` or `cn`.
|
|
85
|
+
|
|
74
86
|
## Prerequisites
|
|
75
87
|
|
|
76
88
|
- **[Git](https://git-scm.com/)** — required
|
|
@@ -81,12 +93,12 @@ cn setup # shortest — even shorter than git!
|
|
|
81
93
|
|
|
82
94
|
## Commands
|
|
83
95
|
|
|
84
|
-
### `
|
|
96
|
+
### `cn setup`
|
|
85
97
|
|
|
86
98
|
Interactive setup wizard. Configures your repo's workflow mode, commit convention, your role, branch/remote names, and AI provider settings. Writes local config to `.git/contribute-now/config.json` by default.
|
|
87
99
|
|
|
88
100
|
```bash
|
|
89
|
-
|
|
101
|
+
cn setup
|
|
90
102
|
```
|
|
91
103
|
|
|
92
104
|
Steps:
|
|
@@ -98,33 +110,33 @@ Steps:
|
|
|
98
110
|
6. Confirm branch and remote names
|
|
99
111
|
7. Write `.git/contribute-now/config.json` (or update `.contributerc.json` if that legacy file is still the active source)
|
|
100
112
|
|
|
101
|
-
If you want to disable AI completely for a repo, run `
|
|
113
|
+
If you want to disable AI completely for a repo, run `cn setup` and turn AI off, or set `"aiEnabled": false` in the active config file. Per-command `--no-ai` flags still work as one-off overrides when AI is enabled globally.
|
|
102
114
|
|
|
103
115
|
If you want a cleaner output once you're familiar with the CLI, set `"showTips": false` in the active config file to hide the beginner quick guides and loading tips.
|
|
104
116
|
|
|
105
117
|
---
|
|
106
118
|
|
|
107
|
-
### `
|
|
119
|
+
### `cn config`
|
|
108
120
|
|
|
109
121
|
Inspect the active repo config or edit it without rerunning the full setup flow.
|
|
110
122
|
|
|
111
123
|
```bash
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
cn config
|
|
125
|
+
cn config --json
|
|
126
|
+
cn config --edit
|
|
115
127
|
```
|
|
116
128
|
|
|
117
129
|
Use `--edit` to update workflow settings, branch names, commit convention, AI provider details, the stored Ollama Cloud API key, and to choose from the currently available Ollama Cloud models. Ollama Cloud uses the built-in default host and does not ask for a custom host URL.
|
|
118
130
|
|
|
119
131
|
---
|
|
120
132
|
|
|
121
|
-
### `
|
|
133
|
+
### `cn sync`
|
|
122
134
|
|
|
123
135
|
Pull the latest changes from the correct remote branch based on your workflow and role.
|
|
124
136
|
|
|
125
137
|
```bash
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
cn sync # with confirmation
|
|
139
|
+
cn sync --yes # skip confirmation
|
|
128
140
|
```
|
|
129
141
|
|
|
130
142
|
| Role | Clean Flow / Git Flow | GitHub Flow |
|
|
@@ -134,98 +146,98 @@ contrib sync --yes # skip confirmation
|
|
|
134
146
|
|
|
135
147
|
---
|
|
136
148
|
|
|
137
|
-
### `
|
|
149
|
+
### `cn start`
|
|
138
150
|
|
|
139
151
|
Create a new feature branch from the correct base branch, with optional AI-powered branch naming.
|
|
140
152
|
|
|
141
153
|
```bash
|
|
142
154
|
# Direct branch name
|
|
143
|
-
|
|
155
|
+
cn start feature/user-auth
|
|
144
156
|
|
|
145
157
|
# Natural language — AI suggests the branch name
|
|
146
|
-
|
|
158
|
+
cn start "add user authentication"
|
|
147
159
|
|
|
148
160
|
# Skip AI
|
|
149
|
-
|
|
161
|
+
cn start "add user authentication" --no-ai
|
|
150
162
|
```
|
|
151
163
|
|
|
152
164
|
---
|
|
153
165
|
|
|
154
|
-
### `
|
|
166
|
+
### `cn commit`
|
|
155
167
|
|
|
156
168
|
Stage your changes and create a validated, AI-generated commit message matching your configured convention.
|
|
157
169
|
|
|
158
170
|
```bash
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
171
|
+
cn commit # AI-generated message
|
|
172
|
+
cn commit --no-ai # manual entry, still validated
|
|
173
|
+
cn commit --model gpt-4.1 # specific AI model
|
|
174
|
+
cn commit --group # AI groups changes into atomic commits
|
|
163
175
|
```
|
|
164
176
|
|
|
165
177
|
After the AI generates a message, you can **accept**, **edit**, **regenerate**, or **write manually**. Messages are always validated against your convention — with a soft warning if they don't match (you can still commit).
|
|
166
178
|
|
|
167
179
|
**Group commit mode** (`--group`): AI analyzes all staged and unstaged changes, groups related files into logical atomic commits, and generates a commit message for each group. Great for splitting a large set of changes into clean, reviewable commits.
|
|
168
180
|
|
|
169
|
-
If `aiEnabled` is set to `false` in `.contributerc.json`, `
|
|
181
|
+
If `aiEnabled` is set to `false` in `.contributerc.json`, `cn commit` stays manual and `--group` is unavailable.
|
|
170
182
|
|
|
171
183
|
---
|
|
172
184
|
|
|
173
|
-
### `
|
|
185
|
+
### `cn update`
|
|
174
186
|
|
|
175
187
|
Rebase your current branch onto the latest base branch, with AI guidance if conflicts occur.
|
|
176
188
|
|
|
177
189
|
```bash
|
|
178
|
-
|
|
179
|
-
|
|
190
|
+
cn update
|
|
191
|
+
cn update --no-ai # skip AI conflict guidance
|
|
180
192
|
```
|
|
181
193
|
|
|
182
194
|
---
|
|
183
195
|
|
|
184
|
-
### `
|
|
196
|
+
### `cn submit`
|
|
185
197
|
|
|
186
198
|
Push your branch and open a pull request with an AI-generated title and description.
|
|
187
199
|
|
|
188
200
|
```bash
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
201
|
+
cn submit
|
|
202
|
+
cn submit --draft
|
|
203
|
+
cn submit --no-ai
|
|
204
|
+
cn submit --model gpt-4.1
|
|
193
205
|
```
|
|
194
206
|
|
|
195
207
|
---
|
|
196
208
|
|
|
197
|
-
### `
|
|
209
|
+
### `cn clean`
|
|
198
210
|
|
|
199
211
|
Delete merged branches and prune stale remote refs.
|
|
200
212
|
|
|
201
213
|
```bash
|
|
202
|
-
|
|
203
|
-
|
|
214
|
+
cn clean # shows candidates, asks to confirm
|
|
215
|
+
cn clean --yes # skip confirmation
|
|
204
216
|
```
|
|
205
217
|
|
|
206
218
|
---
|
|
207
219
|
|
|
208
|
-
### `
|
|
220
|
+
### `cn status`
|
|
209
221
|
|
|
210
222
|
Show a sync status dashboard for your main, dev, and current branch.
|
|
211
223
|
|
|
212
224
|
```bash
|
|
213
|
-
|
|
225
|
+
cn status
|
|
214
226
|
```
|
|
215
227
|
|
|
216
228
|
---
|
|
217
229
|
|
|
218
|
-
### `
|
|
230
|
+
### `cn doctor`
|
|
219
231
|
|
|
220
232
|
Diagnose the contribute-now CLI environment and configuration. Checks tools, dependencies, config, git state, fork setup, workflow, and environment.
|
|
221
233
|
|
|
222
234
|
```bash
|
|
223
|
-
|
|
224
|
-
|
|
235
|
+
cn doctor # pretty-printed report
|
|
236
|
+
cn doctor --json # machine-readable JSON output
|
|
225
237
|
```
|
|
226
238
|
|
|
227
239
|
Checks include:
|
|
228
|
-
- CLI version and runtime (Bun
|
|
240
|
+
- CLI version and runtime (Bun)
|
|
229
241
|
- git and GitHub CLI availability and authentication
|
|
230
242
|
- active repo config validity and storage location
|
|
231
243
|
- Git repo state (uncommitted changes, lock files, shallow clone)
|
|
@@ -234,45 +246,45 @@ Checks include:
|
|
|
234
246
|
|
|
235
247
|
---
|
|
236
248
|
|
|
237
|
-
### `
|
|
249
|
+
### `cn log`
|
|
238
250
|
|
|
239
251
|
Show a colorized, workflow-aware commit log. By default it shows only **local unpushed commits** — the changes you've made since the last push (or since branching off the base branch). Use flags to switch between different views.
|
|
240
252
|
|
|
241
253
|
```bash
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
254
|
+
cn log # local unpushed commits (default)
|
|
255
|
+
cn log --remote # commits on remote not yet pulled
|
|
256
|
+
cn log --full # full history for the current branch
|
|
257
|
+
cn log --all # commits across all branches
|
|
258
|
+
cn log -n 50 # change the commit limit (default: 20)
|
|
259
|
+
cn log -b feature/x # log for a specific branch
|
|
260
|
+
cn log --no-graph # flat view without graph lines
|
|
249
261
|
```
|
|
250
262
|
|
|
251
263
|
When no upstream tracking is set (branch hasn't been pushed yet), the command automatically compares against the base branch from your config (e.g., `origin/dev`). Protected branches are highlighted, and the current branch is color-coded for quick orientation.
|
|
252
264
|
|
|
253
265
|
---
|
|
254
266
|
|
|
255
|
-
### `
|
|
267
|
+
### `cn branch`
|
|
256
268
|
|
|
257
269
|
List branches with workflow-aware labels and tracking status.
|
|
258
270
|
|
|
259
271
|
```bash
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
272
|
+
cn branch # local branches
|
|
273
|
+
cn branch --all # local + remote branches
|
|
274
|
+
cn branch --remote # remote branches only
|
|
263
275
|
```
|
|
264
276
|
|
|
265
277
|
Branches are annotated with workflow labels (e.g., base, dev, feature) and tracking info (upstream, gone, no remote).
|
|
266
278
|
|
|
267
279
|
---
|
|
268
280
|
|
|
269
|
-
### `
|
|
281
|
+
### `cn hook`
|
|
270
282
|
|
|
271
283
|
Install or uninstall a `commit-msg` git hook that validates every commit against your configured convention — no Husky or lint-staged needed.
|
|
272
284
|
|
|
273
285
|
```bash
|
|
274
|
-
|
|
275
|
-
|
|
286
|
+
cn hook install # writes .git/hooks/commit-msg
|
|
287
|
+
cn hook uninstall # removes it
|
|
276
288
|
```
|
|
277
289
|
|
|
278
290
|
- Automatically skips merge commits, fixup, squash, and amend commits
|
|
@@ -280,13 +292,13 @@ contrib hook uninstall # removes it
|
|
|
280
292
|
|
|
281
293
|
---
|
|
282
294
|
|
|
283
|
-
### `
|
|
295
|
+
### `cn validate`
|
|
284
296
|
|
|
285
297
|
Validate a commit message against your configured convention. Exits `0` if valid, `1` if not — useful in CI pipelines or custom hooks.
|
|
286
298
|
|
|
287
299
|
```bash
|
|
288
|
-
|
|
289
|
-
|
|
300
|
+
cn validate "📦 new: user auth module" # exit 0
|
|
301
|
+
cn validate "added stuff" # exit 1
|
|
290
302
|
```
|
|
291
303
|
|
|
292
304
|
---
|
|
@@ -355,7 +367,7 @@ feat!: redesign authentication API
|
|
|
355
367
|
|
|
356
368
|
## Config File
|
|
357
369
|
|
|
358
|
-
`
|
|
370
|
+
`cn setup` writes `.git/contribute-now/config.json` by default. If a legacy `.contributerc.json` already exists, it remains the active source until you migrate or remove it:
|
|
359
371
|
|
|
360
372
|
```json
|
|
361
373
|
{
|
|
@@ -370,7 +382,7 @@ feat!: redesign authentication API
|
|
|
370
382
|
}
|
|
371
383
|
```
|
|
372
384
|
|
|
373
|
-
Use `
|
|
385
|
+
Use `cn config --edit` to change these values later without rerunning the full setup flow. If you are still on the legacy `.contributerc.json`, keep that file ignored until you migrate away from it.
|
|
374
386
|
|
|
375
387
|
---
|
|
376
388
|
|
|
@@ -386,6 +398,8 @@ bun test # run tests
|
|
|
386
398
|
bun run lint # check code quality
|
|
387
399
|
```
|
|
388
400
|
|
|
401
|
+
The CLI is Bun-first end to end: local development, tests, packaged runtime, and one-off execution all assume Bun.
|
|
402
|
+
|
|
389
403
|
## 🎯 Contributing
|
|
390
404
|
|
|
391
405
|
Contributions are welcome, create a pull request to this repo and I will review your code. Please consider to submit your pull request to the `dev` branch. Thank you!
|
|
@@ -418,7 +432,7 @@ This project is licensed under [GNU General Public License v3.0](https://opensou
|
|
|
418
432
|
|
|
419
433
|
This project is created by **[Waren Gonzaga](https://github.com/warengonzaga)**, with the help of awesome [contributors](https://github.com/warengonzaga/contribute-now/graphs/contributors).
|
|
420
434
|
|
|
421
|
-
[](https://github.com/warengonzaga/contribute-now/graphs/contributors)
|
|
422
436
|
|
|
423
437
|
---
|
|
424
438
|
|