@devflow-one/cli 0.1.12 → 0.1.13
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 +6 -2
- package/package.json +1 -1
- package/src/commands.js +16 -10
package/README.md
CHANGED
|
@@ -162,6 +162,7 @@ devflow mr find # issue key from the branch
|
|
|
162
162
|
devflow branch resolve ABC-124 # read-only: branch name + whether it exists
|
|
163
163
|
devflow branch create --issue ABC-124 # creates it, or reuses an existing one
|
|
164
164
|
devflow branch create feat/x # a name is only a fallback when no issue key is known
|
|
165
|
+
devflow branch create --issue ABC-124 --from release/2026.4 # start from another remote branch
|
|
165
166
|
|
|
166
167
|
# or route explicitly, overriding whatever the directory implies
|
|
167
168
|
devflow branch create feat/x --project ABC
|
|
@@ -183,7 +184,8 @@ devflow mr types --project ABC # configured types: id, label, def
|
|
|
183
184
|
# {issueTitle} needs the Jira API token set in Settings, else it renders empty.
|
|
184
185
|
devflow mr create "Title" feat/x --issue ABC-123
|
|
185
186
|
devflow mr create "Title" --issue ABC-123 # head branch from the branch template
|
|
186
|
-
#
|
|
187
|
+
# a head branch that exists on the remote is used as is; otherwise the template picks it
|
|
188
|
+
# and a different one is replaced (warning on stderr)
|
|
187
189
|
|
|
188
190
|
# routed by issue key (project key = prefix before the last '-')
|
|
189
191
|
devflow mr find ABC-123
|
|
@@ -194,10 +196,12 @@ devflow commit template /wt/ABC-123 --values '{"summary":"fix login"}' --project
|
|
|
194
196
|
devflow commit template /wt/ABC-123 --no-push --project ABC # commit locally, skip push
|
|
195
197
|
|
|
196
198
|
# read a PR/MR's title + description, then edit it: --title/--description replace,
|
|
197
|
-
# --append-description adds text after a `---` rule (skipped if already at the end)
|
|
199
|
+
# --append-description adds text after a `---` rule (skipped if already at the end);
|
|
200
|
+
# --base retargets the PR/MR to an existing remote branch
|
|
198
201
|
devflow mr get 42 --project ABC
|
|
199
202
|
devflow mr update 42 --append-description "## Test plan" --project ABC
|
|
200
203
|
devflow mr update 42 --title "Fix login redirect" --project ABC
|
|
204
|
+
devflow mr update 42 --base release/2026.4 --project ABC
|
|
201
205
|
|
|
202
206
|
# assembled fix-review-comments prompt (read-only; runs no AI, makes no writes)
|
|
203
207
|
devflow mr fix-prompt 42 # issue key inferred from the branch
|
package/package.json
CHANGED
package/src/commands.js
CHANGED
|
@@ -153,17 +153,19 @@ const COMMANDS = {
|
|
|
153
153
|
retryUnsafe: true,
|
|
154
154
|
action: "createBranch",
|
|
155
155
|
usage:
|
|
156
|
-
"branch create [branchName] [--issue KEY] [--project KEY]" +
|
|
156
|
+
"branch create [branchName] [--issue KEY] [--from <branch>] [--project KEY]" +
|
|
157
157
|
" (the repo's branch template names the branch from the issue, incl. {parentIssueKey};" +
|
|
158
|
-
" branchName is only a fallback; an existing branch is reused
|
|
158
|
+
" branchName is only a fallback; an existing branch is reused; --from picks the remote" +
|
|
159
|
+
" branch to start from instead of the repo's configured base branch)",
|
|
159
160
|
buildArgs: ([branchName], flags, context = {}) => {
|
|
160
161
|
const issueKey = templateIssueKey(branchName, flags, context);
|
|
162
|
+
const from = toBranch("from", flags.from);
|
|
161
163
|
|
|
162
164
|
if (!branchName && !issueKey) {
|
|
163
165
|
throw new UsageError("branch create needs an issue key (--issue) or a <branchName>.");
|
|
164
166
|
}
|
|
165
167
|
|
|
166
|
-
return [branchName, issueKey];
|
|
168
|
+
return from === undefined ? [branchName, issueKey] : [branchName, issueKey, from];
|
|
167
169
|
},
|
|
168
170
|
},
|
|
169
171
|
"branch resolve": {
|
|
@@ -215,8 +217,8 @@ const COMMANDS = {
|
|
|
215
217
|
usage:
|
|
216
218
|
"mr create <title> [headBranch] [--body <text>] [--base <branch>] [--type <idOrLabel>]" +
|
|
217
219
|
" [--issue KEY] [--project KEY]" +
|
|
218
|
-
" (
|
|
219
|
-
"
|
|
220
|
+
" (a headBranch that exists on the remote is used as is; otherwise the repo's branch" +
|
|
221
|
+
" template picks the head branch from the issue; --base defaults to the repo's configured base branch, expanding a {year}/{number} pattern;" +
|
|
220
222
|
" --type is auto-selected by matching PR type names against the title prefix, branch prefix," +
|
|
221
223
|
" Jira issue type and title keywords, falling back to the first configured type)",
|
|
222
224
|
buildArgs: ([title, headBranch], flags, context = {}) => {
|
|
@@ -328,23 +330,27 @@ const COMMANDS = {
|
|
|
328
330
|
action: "updatePullRequest",
|
|
329
331
|
usage:
|
|
330
332
|
"mr update <prId> [--title <text>] [--description <text> | --append-description <text>]" +
|
|
331
|
-
" [--issue KEY] [--project KEY]" +
|
|
333
|
+
" [--base <branch>] [--issue KEY] [--project KEY]" +
|
|
332
334
|
" (--title/--description replace; --append-description adds text after a `---` rule" +
|
|
333
|
-
" and is skipped if it already ends the description after that rule
|
|
335
|
+
" and is skipped if it already ends the description after that rule; --base retargets" +
|
|
336
|
+
" the PR/MR to an existing remote branch)",
|
|
334
337
|
buildArgs: ([prId], flags) => {
|
|
335
338
|
const title = toText("title", flags.title);
|
|
336
339
|
const body = toRawText("description", flags.description);
|
|
337
340
|
const appendBody = toRawText("append-description", flags["append-description"]);
|
|
341
|
+
const baseBranch = toBranch("base", flags.base);
|
|
338
342
|
|
|
339
|
-
if (title
|
|
340
|
-
throw new UsageError(
|
|
343
|
+
if ([title, body, appendBody, baseBranch].every((value) => value === undefined)) {
|
|
344
|
+
throw new UsageError(
|
|
345
|
+
"mr update needs --title, --description, --append-description or --base.",
|
|
346
|
+
);
|
|
341
347
|
}
|
|
342
348
|
|
|
343
349
|
if (body !== undefined && appendBody !== undefined) {
|
|
344
350
|
throw new UsageError("mr update takes --description or --append-description, not both.");
|
|
345
351
|
}
|
|
346
352
|
|
|
347
|
-
return [toInt("prId", prId), { title, body, appendBody }];
|
|
353
|
+
return [toInt("prId", prId), { title, body, appendBody, baseBranch }];
|
|
348
354
|
},
|
|
349
355
|
},
|
|
350
356
|
"mr types": {
|