@gitset-dev/cli 2.5.0 → 2.5.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 +17 -17
- package/lib/cli-commit.js +43 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ gitset knowledge init # scaffold optional .gitset-knowledge.json (include/
|
|
|
101
101
|
gitset knowledge scan # zero AI calls — discovers files, prints the plan + exact cost estimate
|
|
102
102
|
gitset knowledge generate # shows the estimate again, asks to confirm, then writes the knowledge base
|
|
103
103
|
gitset knowledge update # incremental — only changed modules (and their direct importers) are re-summarized
|
|
104
|
-
gitset knowledge automate # writes a GitHub Actions workflow that
|
|
104
|
+
gitset knowledge automate # writes a GitHub Actions workflow that keeps it fresh in CI (direct commits, or PRs with --sync pr)
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
It's a six-stage local pipeline (Discover → Map → Summarize → Plan → Write →
|
|
@@ -113,22 +113,22 @@ generated link, command, and script before anything is written to disk.
|
|
|
113
113
|
Secrets are redacted locally before any file content is sent, and prose
|
|
114
114
|
docs / test file bodies are listed structurally but never sent at all.
|
|
115
115
|
|
|
116
|
-
`gitset knowledge automate`
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
116
|
+
`gitset knowledge automate` applies updates in one of two ways, and you
|
|
117
|
+
never touch a GitHub settings page for either:
|
|
118
|
+
|
|
119
|
+
- **Direct commit (the default).** CI commits refreshed docs straight to
|
|
120
|
+
your default branch using only the built-in Actions token — works on
|
|
121
|
+
every repository and organization, zero extra permissions or tokens,
|
|
122
|
+
and it can't re-trigger itself.
|
|
123
|
+
- **Review pull request (`--sync pr`).** Each update arrives as a PR on
|
|
124
|
+
the `gitset/knowledge-update` branch. Its one prerequisite is set up
|
|
125
|
+
for you: the CLI first tries enabling the repo's Actions PR permission
|
|
126
|
+
via the API; if your organization blocks that, it offers to store a
|
|
127
|
+
token from your existing `gh` login as the `GITSET_PR_TOKEN` secret —
|
|
128
|
+
explained in plain language before asking, reversible anytime by
|
|
129
|
+
deleting the secret. If neither works out, updates still commit and
|
|
130
|
+
push their branch safely; only the PR step fails, and the workflow run
|
|
131
|
+
shows that failure clearly rather than hide it.
|
|
132
132
|
|
|
133
133
|
## Templates
|
|
134
134
|
|
package/lib/cli-commit.js
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* `gitset commit` — local, BYOAI commit-message generation with iterative
|
|
5
5
|
* refinement. No backend, key never leaves the machine.
|
|
6
6
|
*
|
|
7
|
+
* If nothing is staged but the working tree has changes, an interactive
|
|
8
|
+
* session is offered a one-time prompt to stage everything (`git add -A`)
|
|
9
|
+
* and continue; a non-interactive session (CI, `--yes`, `--json`, `--print`,
|
|
10
|
+
* or no TTY) fails immediately instead of hanging on the prompt.
|
|
11
|
+
*
|
|
7
12
|
* Flags:
|
|
8
13
|
* --provider <name> override default provider for this run
|
|
9
14
|
* --model <name> override model
|
|
@@ -65,8 +70,44 @@ async function runCommitCommand(argv) {
|
|
|
65
70
|
return 1;
|
|
66
71
|
}
|
|
67
72
|
if (!changes.diff.trim()) {
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
if (nonInteractive) {
|
|
74
|
+
errln('Nothing staged. Stage changes with `git add` (or pass --all).');
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let status = '';
|
|
79
|
+
try {
|
|
80
|
+
status = execFileSync('git', ['status', '--porcelain'], { encoding: 'utf8' }).trim();
|
|
81
|
+
} catch {
|
|
82
|
+
// getStagedChanges() already confirmed this is a git repo; treat as no changes.
|
|
83
|
+
}
|
|
84
|
+
if (!status) {
|
|
85
|
+
errln('Nothing to commit — the working tree is clean.');
|
|
86
|
+
return 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
out(theme.warn('No staged changes detected.'));
|
|
90
|
+
const stage = (await ask('Stage all changes and continue? [y/N] ')).toLowerCase();
|
|
91
|
+
if (stage !== 'y' && stage !== 'yes') {
|
|
92
|
+
out('Aborted. Nothing staged.');
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
execFileSync('git', ['add', '-A'], { stdio: 'ignore' });
|
|
97
|
+
} catch {
|
|
98
|
+
errln('`git add -A` failed — is this a git repository?');
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
changes = getStagedChanges();
|
|
103
|
+
} catch (e) {
|
|
104
|
+
errln(e.message);
|
|
105
|
+
return 1;
|
|
106
|
+
}
|
|
107
|
+
if (!changes.diff.trim()) {
|
|
108
|
+
errln('Still nothing staged after `git add -A` — nothing to commit.');
|
|
109
|
+
return 1;
|
|
110
|
+
}
|
|
70
111
|
}
|
|
71
112
|
|
|
72
113
|
const style = getFlag(argv, '--style') || 'conventional';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitset-dev/cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Gitset CLI — drafts commits, PRs, issues, READMEs and release notes with your own AI key. Fully local: your code and keys never touch a Gitset server. Draft. Refine. Ship.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|