contribute-now 0.8.0 → 0.9.0-dev.30c88ec
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/LICENSE +674 -0
- package/README.md +81 -5
- package/dist/cli.js +10984 -9129
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,7 +88,8 @@ cn setup # short alias — even shorter than git!
|
|
|
88
88
|
|
|
89
89
|
- **[Git](https://git-scm.com/)** — required
|
|
90
90
|
- **[GitHub CLI](https://cli.github.com)** (`gh`) — recommended; required for PR creation, role detection, and merge status checks
|
|
91
|
-
- **[GitHub Copilot](https://github.com/features/copilot)** — optional;
|
|
91
|
+
- **[GitHub Copilot](https://github.com/features/copilot)** — optional; one of the supported AI providers
|
|
92
|
+
- **[Ollama Cloud](https://ollama.com)** or **[OpenRouter](https://openrouter.ai)** API key — optional; alternative AI providers
|
|
92
93
|
|
|
93
94
|
---
|
|
94
95
|
|
|
@@ -106,7 +107,7 @@ Steps:
|
|
|
106
107
|
1. Choose **workflow mode** — Clean Flow, GitHub Flow, or Git Flow
|
|
107
108
|
2. Choose **commit convention** — Clean Commit, Conventional Commits, or None
|
|
108
109
|
3. Choose whether **AI features** should be enabled for this repo
|
|
109
|
-
4. If using **Ollama Cloud**, pick from the available models returned by your
|
|
110
|
+
4. If using **Ollama Cloud** or **OpenRouter**, enter your API key; pick from the available models returned by your key, or enter one manually
|
|
110
111
|
5. Detect remotes and auto-detect your **role** (maintainer or contributor)
|
|
111
112
|
6. Confirm branch and remote names
|
|
112
113
|
7. Write `.git/contribute-now/config.json` (or update `.contributerc.json` if that legacy file is still the active source)
|
|
@@ -127,7 +128,7 @@ cn config --json
|
|
|
127
128
|
cn config --edit
|
|
128
129
|
```
|
|
129
130
|
|
|
130
|
-
Use `--edit` to update workflow settings, branch names, commit convention, AI provider details,
|
|
131
|
+
Use `--edit` to update workflow settings, branch names, commit convention, AI provider details, stored API keys (Ollama Cloud or OpenRouter), and to choose from the currently available models for the selected provider.
|
|
131
132
|
|
|
132
133
|
---
|
|
133
134
|
|
|
@@ -304,9 +305,74 @@ cn validate "added stuff" # exit 1
|
|
|
304
305
|
|
|
305
306
|
---
|
|
306
307
|
|
|
308
|
+
### `cn label`
|
|
309
|
+
|
|
310
|
+
Apply existing labels to issues and pull requests, or get ranked label suggestions from content. All operations are non-interactive and automation-friendly.
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# Apply one or more labels to an issue
|
|
314
|
+
cn label add --issue 42 bug,enhancement
|
|
315
|
+
|
|
316
|
+
# Apply labels with spaces in their names (no quotes needed in most shells)
|
|
317
|
+
cn label add --issue 42 bug,good first issue
|
|
318
|
+
|
|
319
|
+
# Apply labels to a PR
|
|
320
|
+
cn label add --pr 7 enhancement,needs triage
|
|
321
|
+
|
|
322
|
+
# Get ranked label suggestions for an issue
|
|
323
|
+
cn label suggest --issue 42
|
|
324
|
+
|
|
325
|
+
# Get ranked label suggestions for a PR
|
|
326
|
+
cn label suggest --pr 7
|
|
327
|
+
|
|
328
|
+
# Auto-apply top labels to a PR
|
|
329
|
+
cn label apply --pr 7
|
|
330
|
+
|
|
331
|
+
# Auto-apply top labels to an issue
|
|
332
|
+
cn label apply --issue 42
|
|
333
|
+
|
|
334
|
+
# Bulk preview (safe default): inspect open issues and PRs
|
|
335
|
+
cn label apply
|
|
336
|
+
|
|
337
|
+
# Bulk apply to open issues and PRs
|
|
338
|
+
cn label apply --yes
|
|
339
|
+
|
|
340
|
+
# Bulk apply to PRs only with custom limits
|
|
341
|
+
cn label apply --prs --yes --limit 30 --count 2 --min-score 5
|
|
342
|
+
|
|
343
|
+
# Force heuristic-only ranking (no AI)
|
|
344
|
+
cn label apply --pr 7 --no-ai
|
|
345
|
+
|
|
346
|
+
# Use a specific AI model for ranking
|
|
347
|
+
cn label apply --pr 7 --model gpt-4.1
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
**Label source strategy:**
|
|
351
|
+
1. Repository labels are fetched once and cached locally (`.git/contribute-now/labels.json`).
|
|
352
|
+
2. If the repository labels are a 100% name-match against the [Clean Labels](https://github.com/wgtechlabs/clean-labels) dataset, Clean Labels (with canonical descriptions) are used as the source.
|
|
353
|
+
3. Otherwise, repository-specific labels are used.
|
|
354
|
+
4. The local cache is used by default — no repeated `gh` API calls.
|
|
355
|
+
5. On label-not-found errors, the cache is automatically resynced and the operation is retried once.
|
|
356
|
+
|
|
357
|
+
**Auto-apply behavior (`cn label apply`):**
|
|
358
|
+
- Uses the same label scoring engine as `cn label suggest` (label names + descriptions vs issue/PR content).
|
|
359
|
+
- Applies only existing repository labels (never creates labels).
|
|
360
|
+
- Filters out labels that are already present on the target issue/PR.
|
|
361
|
+
- In bulk mode (no `--issue`/`--pr`), defaults to dry-run unless `--yes` is provided.
|
|
362
|
+
- Supports tunable controls: `--count`, `--min-score`, `--limit`, `--issues`, `--prs`, and `--dry-run`.
|
|
363
|
+
- Uses AI ranking by default when AI is enabled in your config, with automatic fallback to heuristic scoring.
|
|
364
|
+
- Pass `--no-ai` to force heuristic-only scoring or `--model <name>` to pick a specific AI model.
|
|
365
|
+
|
|
366
|
+
**Label input format:**
|
|
367
|
+
- Commas are the separator between labels.
|
|
368
|
+
- Spaces are part of a label name (`good first issue` is one label, not three words).
|
|
369
|
+
- Unknown labels are reported with close-match suggestions.
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
307
373
|
## AI Features
|
|
308
374
|
|
|
309
|
-
All AI features are
|
|
375
|
+
All AI features are **optional** — every command has a manual fallback. Three providers are supported: **GitHub Copilot**, **Ollama Cloud**, and **OpenRouter**.
|
|
310
376
|
|
|
311
377
|
| Command | AI Feature | Fallback |
|
|
312
378
|
|---------|------------|----------|
|
|
@@ -316,7 +382,17 @@ All AI features are powered by **GitHub Copilot** via `@github/copilot-sdk` and
|
|
|
316
382
|
| `update` | Conflict resolution guidance | Standard git instructions |
|
|
317
383
|
| `submit` | Generate PR title and body | `gh pr create --fill` or manual |
|
|
318
384
|
|
|
319
|
-
Pass `--no-ai` to any command to skip AI entirely. Use `--model <name>` to select a specific
|
|
385
|
+
Pass `--no-ai` to any command to skip AI entirely. Use `--model <name>` to select a specific model (e.g., `gpt-4.1`, `claude-sonnet-4`).
|
|
386
|
+
|
|
387
|
+
### AI Providers
|
|
388
|
+
|
|
389
|
+
| Provider | Auth | How it works |
|
|
390
|
+
|----------|------|--------------|
|
|
391
|
+
| **GitHub Copilot** *(default)* | `gh auth login` | Uses your existing GitHub/Copilot auth via the `@github/copilot-sdk` |
|
|
392
|
+
| **Ollama Cloud** | API key (stored in local secrets) | OpenAI-compatible API; model list fetched from your key on setup |
|
|
393
|
+
| **OpenRouter** | API key (stored in local secrets) | Unified API that routes to many model providers (OpenAI, Anthropic, Google, etc.) |
|
|
394
|
+
|
|
395
|
+
Select your provider during `cn setup` or change it later with `cn config --edit`. API keys for Ollama Cloud and OpenRouter are stored as plain JSON in `~/.contribute-now/secrets/store.json` with file permissions restricted to the current user (mode 0600) — never in the plain config file.
|
|
320
396
|
|
|
321
397
|
---
|
|
322
398
|
|