contribute-now 0.7.3 → 0.7.4-dev.e1cbd66
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 +67 -64
- package/dist/cli.js +470 -1738
- package/package.json +1 -3
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
|
|------|----------|----------|:-------:|
|
|
@@ -44,12 +44,14 @@ Or install globally:
|
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
bun install -g contribute-now
|
|
47
|
-
|
|
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
51
|
|
|
52
|
-
> `
|
|
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`.
|
|
53
55
|
>
|
|
54
56
|
> **Fun fact:** `cn` is shorter than `git`. Yes, your workflow command is now faster to type than git itself. 🚀
|
|
55
57
|
|
|
@@ -72,14 +74,15 @@ npm install -g bun
|
|
|
72
74
|
npm install -g contribute-now
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
Once installed, you can use
|
|
77
|
+
Once installed, you can use either alias:
|
|
76
78
|
|
|
77
79
|
```bash
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
cn setup # shortest — even shorter than git!
|
|
80
|
+
contribute setup # primary command — spelled out
|
|
81
|
+
cn setup # short alias — even shorter than git!
|
|
81
82
|
```
|
|
82
83
|
|
|
84
|
+
> The legacy `contrib` alias still works but is being phased out. Prefer `contribute` or `cn`.
|
|
85
|
+
|
|
83
86
|
## Prerequisites
|
|
84
87
|
|
|
85
88
|
- **[Git](https://git-scm.com/)** — required
|
|
@@ -90,12 +93,12 @@ cn setup # shortest — even shorter than git!
|
|
|
90
93
|
|
|
91
94
|
## Commands
|
|
92
95
|
|
|
93
|
-
### `
|
|
96
|
+
### `cn setup`
|
|
94
97
|
|
|
95
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.
|
|
96
99
|
|
|
97
100
|
```bash
|
|
98
|
-
|
|
101
|
+
cn setup
|
|
99
102
|
```
|
|
100
103
|
|
|
101
104
|
Steps:
|
|
@@ -107,33 +110,33 @@ Steps:
|
|
|
107
110
|
6. Confirm branch and remote names
|
|
108
111
|
7. Write `.git/contribute-now/config.json` (or update `.contributerc.json` if that legacy file is still the active source)
|
|
109
112
|
|
|
110
|
-
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.
|
|
111
114
|
|
|
112
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.
|
|
113
116
|
|
|
114
117
|
---
|
|
115
118
|
|
|
116
|
-
### `
|
|
119
|
+
### `cn config`
|
|
117
120
|
|
|
118
121
|
Inspect the active repo config or edit it without rerunning the full setup flow.
|
|
119
122
|
|
|
120
123
|
```bash
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
cn config
|
|
125
|
+
cn config --json
|
|
126
|
+
cn config --edit
|
|
124
127
|
```
|
|
125
128
|
|
|
126
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.
|
|
127
130
|
|
|
128
131
|
---
|
|
129
132
|
|
|
130
|
-
### `
|
|
133
|
+
### `cn sync`
|
|
131
134
|
|
|
132
135
|
Pull the latest changes from the correct remote branch based on your workflow and role.
|
|
133
136
|
|
|
134
137
|
```bash
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
cn sync # with confirmation
|
|
139
|
+
cn sync --yes # skip confirmation
|
|
137
140
|
```
|
|
138
141
|
|
|
139
142
|
| Role | Clean Flow / Git Flow | GitHub Flow |
|
|
@@ -143,94 +146,94 @@ contrib sync --yes # skip confirmation
|
|
|
143
146
|
|
|
144
147
|
---
|
|
145
148
|
|
|
146
|
-
### `
|
|
149
|
+
### `cn start`
|
|
147
150
|
|
|
148
151
|
Create a new feature branch from the correct base branch, with optional AI-powered branch naming.
|
|
149
152
|
|
|
150
153
|
```bash
|
|
151
154
|
# Direct branch name
|
|
152
|
-
|
|
155
|
+
cn start feature/user-auth
|
|
153
156
|
|
|
154
157
|
# Natural language — AI suggests the branch name
|
|
155
|
-
|
|
158
|
+
cn start "add user authentication"
|
|
156
159
|
|
|
157
160
|
# Skip AI
|
|
158
|
-
|
|
161
|
+
cn start "add user authentication" --no-ai
|
|
159
162
|
```
|
|
160
163
|
|
|
161
164
|
---
|
|
162
165
|
|
|
163
|
-
### `
|
|
166
|
+
### `cn commit`
|
|
164
167
|
|
|
165
168
|
Stage your changes and create a validated, AI-generated commit message matching your configured convention.
|
|
166
169
|
|
|
167
170
|
```bash
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
|
172
175
|
```
|
|
173
176
|
|
|
174
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).
|
|
175
178
|
|
|
176
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.
|
|
177
180
|
|
|
178
|
-
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.
|
|
179
182
|
|
|
180
183
|
---
|
|
181
184
|
|
|
182
|
-
### `
|
|
185
|
+
### `cn update`
|
|
183
186
|
|
|
184
187
|
Rebase your current branch onto the latest base branch, with AI guidance if conflicts occur.
|
|
185
188
|
|
|
186
189
|
```bash
|
|
187
|
-
|
|
188
|
-
|
|
190
|
+
cn update
|
|
191
|
+
cn update --no-ai # skip AI conflict guidance
|
|
189
192
|
```
|
|
190
193
|
|
|
191
194
|
---
|
|
192
195
|
|
|
193
|
-
### `
|
|
196
|
+
### `cn submit`
|
|
194
197
|
|
|
195
198
|
Push your branch and open a pull request with an AI-generated title and description.
|
|
196
199
|
|
|
197
200
|
```bash
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
cn submit
|
|
202
|
+
cn submit --draft
|
|
203
|
+
cn submit --no-ai
|
|
204
|
+
cn submit --model gpt-4.1
|
|
202
205
|
```
|
|
203
206
|
|
|
204
207
|
---
|
|
205
208
|
|
|
206
|
-
### `
|
|
209
|
+
### `cn clean`
|
|
207
210
|
|
|
208
211
|
Delete merged branches and prune stale remote refs.
|
|
209
212
|
|
|
210
213
|
```bash
|
|
211
|
-
|
|
212
|
-
|
|
214
|
+
cn clean # shows candidates, asks to confirm
|
|
215
|
+
cn clean --yes # skip confirmation
|
|
213
216
|
```
|
|
214
217
|
|
|
215
218
|
---
|
|
216
219
|
|
|
217
|
-
### `
|
|
220
|
+
### `cn status`
|
|
218
221
|
|
|
219
222
|
Show a sync status dashboard for your main, dev, and current branch.
|
|
220
223
|
|
|
221
224
|
```bash
|
|
222
|
-
|
|
225
|
+
cn status
|
|
223
226
|
```
|
|
224
227
|
|
|
225
228
|
---
|
|
226
229
|
|
|
227
|
-
### `
|
|
230
|
+
### `cn doctor`
|
|
228
231
|
|
|
229
232
|
Diagnose the contribute-now CLI environment and configuration. Checks tools, dependencies, config, git state, fork setup, workflow, and environment.
|
|
230
233
|
|
|
231
234
|
```bash
|
|
232
|
-
|
|
233
|
-
|
|
235
|
+
cn doctor # pretty-printed report
|
|
236
|
+
cn doctor --json # machine-readable JSON output
|
|
234
237
|
```
|
|
235
238
|
|
|
236
239
|
Checks include:
|
|
@@ -243,45 +246,45 @@ Checks include:
|
|
|
243
246
|
|
|
244
247
|
---
|
|
245
248
|
|
|
246
|
-
### `
|
|
249
|
+
### `cn log`
|
|
247
250
|
|
|
248
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.
|
|
249
252
|
|
|
250
253
|
```bash
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
|
258
261
|
```
|
|
259
262
|
|
|
260
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.
|
|
261
264
|
|
|
262
265
|
---
|
|
263
266
|
|
|
264
|
-
### `
|
|
267
|
+
### `cn branch`
|
|
265
268
|
|
|
266
269
|
List branches with workflow-aware labels and tracking status.
|
|
267
270
|
|
|
268
271
|
```bash
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
+
cn branch # local branches
|
|
273
|
+
cn branch --all # local + remote branches
|
|
274
|
+
cn branch --remote # remote branches only
|
|
272
275
|
```
|
|
273
276
|
|
|
274
277
|
Branches are annotated with workflow labels (e.g., base, dev, feature) and tracking info (upstream, gone, no remote).
|
|
275
278
|
|
|
276
279
|
---
|
|
277
280
|
|
|
278
|
-
### `
|
|
281
|
+
### `cn hook`
|
|
279
282
|
|
|
280
283
|
Install or uninstall a `commit-msg` git hook that validates every commit against your configured convention — no Husky or lint-staged needed.
|
|
281
284
|
|
|
282
285
|
```bash
|
|
283
|
-
|
|
284
|
-
|
|
286
|
+
cn hook install # writes .git/hooks/commit-msg
|
|
287
|
+
cn hook uninstall # removes it
|
|
285
288
|
```
|
|
286
289
|
|
|
287
290
|
- Automatically skips merge commits, fixup, squash, and amend commits
|
|
@@ -289,13 +292,13 @@ contrib hook uninstall # removes it
|
|
|
289
292
|
|
|
290
293
|
---
|
|
291
294
|
|
|
292
|
-
### `
|
|
295
|
+
### `cn validate`
|
|
293
296
|
|
|
294
297
|
Validate a commit message against your configured convention. Exits `0` if valid, `1` if not — useful in CI pipelines or custom hooks.
|
|
295
298
|
|
|
296
299
|
```bash
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
cn validate "📦 new: user auth module" # exit 0
|
|
301
|
+
cn validate "added stuff" # exit 1
|
|
299
302
|
```
|
|
300
303
|
|
|
301
304
|
---
|
|
@@ -364,7 +367,7 @@ feat!: redesign authentication API
|
|
|
364
367
|
|
|
365
368
|
## Config File
|
|
366
369
|
|
|
367
|
-
`
|
|
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:
|
|
368
371
|
|
|
369
372
|
```json
|
|
370
373
|
{
|
|
@@ -379,7 +382,7 @@ feat!: redesign authentication API
|
|
|
379
382
|
}
|
|
380
383
|
```
|
|
381
384
|
|
|
382
|
-
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.
|
|
383
386
|
|
|
384
387
|
---
|
|
385
388
|
|
|
@@ -429,7 +432,7 @@ This project is licensed under [GNU General Public License v3.0](https://opensou
|
|
|
429
432
|
|
|
430
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).
|
|
431
434
|
|
|
432
|
-
[](https://github.com/warengonzaga/contribute-now/graphs/contributors)
|
|
433
436
|
|
|
434
437
|
---
|
|
435
438
|
|