@alejandrochaves/devflow-cli 1.7.0 → 1.8.0
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 +9 -3
- package/dist/cli-runner.d.ts +1 -0
- package/dist/cli-runner.js +17 -0
- package/dist/colors.d.ts +0 -1
- package/dist/colors.js +0 -1
- package/dist/commands/amend.d.ts +0 -1
- package/dist/commands/amend.js +3 -3
- package/dist/commands/branch.d.ts +0 -1
- package/dist/commands/branch.js +4 -5
- package/dist/commands/changelog.d.ts +0 -1
- package/dist/commands/changelog.js +0 -1
- package/dist/commands/cleanup.d.ts +0 -1
- package/dist/commands/cleanup.js +4 -3
- package/dist/commands/comments.d.ts +0 -1
- package/dist/commands/comments.js +0 -1
- package/dist/commands/commit.d.ts +0 -1
- package/dist/commands/commit.js +0 -1
- package/dist/commands/doctor.d.ts +0 -1
- package/dist/commands/doctor.js +0 -1
- package/dist/commands/fixup.d.ts +0 -1
- package/dist/commands/fixup.js +3 -4
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +57 -13
- package/dist/commands/issue.d.ts +0 -1
- package/dist/commands/issue.js +5 -21
- package/dist/commands/issues.d.ts +0 -1
- package/dist/commands/issues.js +2 -3
- package/dist/commands/lint-config.d.ts +0 -1
- package/dist/commands/lint-config.js +0 -1
- package/dist/commands/log.d.ts +0 -1
- package/dist/commands/log.js +5 -6
- package/dist/commands/merge.d.ts +0 -1
- package/dist/commands/merge.js +5 -6
- package/dist/commands/pr.d.ts +0 -1
- package/dist/commands/pr.js +68 -17
- package/dist/commands/release.d.ts +0 -1
- package/dist/commands/release.js +0 -1
- package/dist/commands/review.d.ts +0 -1
- package/dist/commands/review.js +0 -1
- package/dist/commands/stash.d.ts +1 -1
- package/dist/commands/stash.js +26 -12
- package/dist/commands/stats.d.ts +0 -1
- package/dist/commands/stats.js +0 -1
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.js +4 -2
- package/dist/commands/test-plan.d.ts +0 -1
- package/dist/commands/test-plan.js +0 -1
- package/dist/commands/undo.d.ts +0 -1
- package/dist/commands/undo.js +4 -5
- package/dist/commands/update.d.ts +0 -1
- package/dist/commands/update.js +71 -1
- package/dist/commands/worktree.d.ts +1 -1
- package/dist/commands/worktree.js +30 -21
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -1
- package/dist/devflow-version.d.ts +1 -1
- package/dist/devflow-version.js +1 -1
- package/dist/git.d.ts +2 -1
- package/dist/git.js +30 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +28 -25
- package/dist/monorepo.d.ts +0 -1
- package/dist/monorepo.js +0 -1
- package/dist/output.d.ts +3 -0
- package/dist/output.js +13 -0
- package/dist/plugins.d.ts +0 -1
- package/dist/plugins.js +0 -1
- package/dist/prompts.d.ts +0 -1
- package/dist/prompts.js +0 -1
- package/dist/providers/projects.d.ts +0 -1
- package/dist/providers/projects.js +3 -10
- package/dist/providers/tickets.d.ts +0 -1
- package/dist/providers/tickets.js +0 -1
- package/dist/test-plan.d.ts +0 -1
- package/dist/test-plan.js +0 -1
- package/dist/update-notifier.d.ts +0 -1
- package/dist/update-notifier.js +33 -26
- package/package.json +1 -1
- package/dist/colors.d.ts.map +0 -1
- package/dist/colors.js.map +0 -1
- package/dist/commands/amend.d.ts.map +0 -1
- package/dist/commands/amend.js.map +0 -1
- package/dist/commands/branch.d.ts.map +0 -1
- package/dist/commands/branch.js.map +0 -1
- package/dist/commands/changelog.d.ts.map +0 -1
- package/dist/commands/changelog.js.map +0 -1
- package/dist/commands/cleanup.d.ts.map +0 -1
- package/dist/commands/cleanup.js.map +0 -1
- package/dist/commands/comments.d.ts.map +0 -1
- package/dist/commands/comments.js.map +0 -1
- package/dist/commands/commit.d.ts.map +0 -1
- package/dist/commands/commit.js.map +0 -1
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/fixup.d.ts.map +0 -1
- package/dist/commands/fixup.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/issue.d.ts.map +0 -1
- package/dist/commands/issue.js.map +0 -1
- package/dist/commands/issues.d.ts.map +0 -1
- package/dist/commands/issues.js.map +0 -1
- package/dist/commands/lint-config.d.ts.map +0 -1
- package/dist/commands/lint-config.js.map +0 -1
- package/dist/commands/log.d.ts.map +0 -1
- package/dist/commands/log.js.map +0 -1
- package/dist/commands/merge.d.ts.map +0 -1
- package/dist/commands/merge.js.map +0 -1
- package/dist/commands/pr.d.ts.map +0 -1
- package/dist/commands/pr.js.map +0 -1
- package/dist/commands/release.d.ts.map +0 -1
- package/dist/commands/release.js.map +0 -1
- package/dist/commands/review.d.ts.map +0 -1
- package/dist/commands/review.js.map +0 -1
- package/dist/commands/stash.d.ts.map +0 -1
- package/dist/commands/stash.js.map +0 -1
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/test-plan.d.ts.map +0 -1
- package/dist/commands/test-plan.js.map +0 -1
- package/dist/commands/undo.d.ts.map +0 -1
- package/dist/commands/undo.js.map +0 -1
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/worktree.d.ts.map +0 -1
- package/dist/commands/worktree.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/devflow-version.d.ts.map +0 -1
- package/dist/devflow-version.js.map +0 -1
- package/dist/git.d.ts.map +0 -1
- package/dist/git.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/monorepo.d.ts.map +0 -1
- package/dist/monorepo.js.map +0 -1
- package/dist/plugins.d.ts.map +0 -1
- package/dist/plugins.js.map +0 -1
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js.map +0 -1
- package/dist/providers/projects.d.ts.map +0 -1
- package/dist/providers/projects.js.map +0 -1
- package/dist/providers/tickets.d.ts.map +0 -1
- package/dist/providers/tickets.js.map +0 -1
- package/dist/test-plan.d.ts.map +0 -1
- package/dist/test-plan.js.map +0 -1
- package/dist/update-notifier.d.ts.map +0 -1
- package/dist/update-notifier.js.map +0 -1
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ Or add scripts to your `package.json`:
|
|
|
44
44
|
|
|
45
45
|
## Commands
|
|
46
46
|
|
|
47
|
+
> **Tip:** In any multi-step command, press **Escape** to go back to the previous step.
|
|
48
|
+
|
|
47
49
|
### `devflow init`
|
|
48
50
|
|
|
49
51
|
Interactive setup wizard that configures your entire project. Walks you through:
|
|
@@ -116,15 +118,18 @@ The `!` after the ticket indicates a breaking change.
|
|
|
116
118
|
Create or update a pull request with an auto-filled template.
|
|
117
119
|
|
|
118
120
|
**Flow:**
|
|
119
|
-
1. Checks if a PR already exists for the current branch
|
|
121
|
+
1. Checks if a PR already exists for the current branch:
|
|
122
|
+
- **Open** — offers to update it
|
|
123
|
+
- **Merged** — asks whether to create a new PR
|
|
124
|
+
- **Closed** — asks to reopen and update, or create a new PR
|
|
120
125
|
2. Infers the base branch (closest remote branch by merge-base)
|
|
121
126
|
3. Enter PR title (pre-filled from branch description)
|
|
122
127
|
4. Enter optional summary
|
|
123
128
|
5. Preview PR body with template
|
|
124
|
-
6. Confirm and create/update
|
|
129
|
+
6. Confirm and create/update/reopen
|
|
125
130
|
|
|
126
131
|
**Features:**
|
|
127
|
-
- Auto-detects existing PRs and
|
|
132
|
+
- Auto-detects existing PRs; handles open, merged, and closed states
|
|
128
133
|
- Infers base branch using `git merge-base` comparison
|
|
129
134
|
- Pre-fills commit list in the summary
|
|
130
135
|
- Auto-labels from branch type (feat → `feature`, fix → `bug`, etc.)
|
|
@@ -449,6 +454,7 @@ eval "$(devflow completions --shell bash)"
|
|
|
449
454
|
| `devflow status` | `devflow s` |
|
|
450
455
|
| `devflow test-plan` | `devflow tp` |
|
|
451
456
|
| `devflow lint-config` | `devflow lint` |
|
|
457
|
+
| `devflow update` | `devflow up` |
|
|
452
458
|
|
|
453
459
|
## Global Options
|
|
454
460
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runCommand(fn: () => Promise<void> | void): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { red } from "./colors.js";
|
|
2
|
+
export async function runCommand(fn) {
|
|
3
|
+
try {
|
|
4
|
+
await fn();
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
if (error?.name === "ExitPromptError") {
|
|
8
|
+
console.log("\nCancelled.");
|
|
9
|
+
process.exit(0);
|
|
10
|
+
}
|
|
11
|
+
const message = error?.message;
|
|
12
|
+
if (message) {
|
|
13
|
+
console.error(`${red("✗")} ${message}`);
|
|
14
|
+
}
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/dist/colors.d.ts
CHANGED
package/dist/colors.js
CHANGED
package/dist/commands/amend.d.ts
CHANGED
package/dist/commands/amend.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { confirm } from "@inquirer/prompts";
|
|
2
1
|
import { execSync } from "child_process";
|
|
3
2
|
import { loadConfig } from "../config.js";
|
|
4
3
|
import { inferTicket } from "../git.js";
|
|
@@ -45,10 +44,12 @@ export async function amendCommand(options = {}) {
|
|
|
45
44
|
editMessage = hasEditFlags;
|
|
46
45
|
}
|
|
47
46
|
else {
|
|
48
|
-
|
|
47
|
+
const editResult = await confirmWithBack({
|
|
49
48
|
message: "Edit commit message?",
|
|
50
49
|
default: true,
|
|
50
|
+
showBack: false,
|
|
51
51
|
});
|
|
52
|
+
editMessage = editResult === true;
|
|
52
53
|
}
|
|
53
54
|
let newMessage = lastMessage;
|
|
54
55
|
if (editMessage) {
|
|
@@ -239,4 +240,3 @@ export async function amendCommand(options = {}) {
|
|
|
239
240
|
process.exit(1);
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
|
-
//# sourceMappingURL=amend.js.map
|
package/dist/commands/branch.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { select, input } from "@inquirer/prompts";
|
|
2
|
-
import {
|
|
2
|
+
import { execFileSync } from "child_process";
|
|
3
3
|
import { loadConfig } from "../config.js";
|
|
4
4
|
import { bold, dim, green, cyan, gray } from "../colors.js";
|
|
5
5
|
import { setTestPlan } from "../test-plan.js";
|
|
@@ -254,7 +254,7 @@ export async function branchCommand(options = {}) {
|
|
|
254
254
|
// Check if branch already exists
|
|
255
255
|
let branchExists = false;
|
|
256
256
|
try {
|
|
257
|
-
|
|
257
|
+
execFileSync("git", ["rev-parse", "--verify", branchName], { stdio: "pipe" });
|
|
258
258
|
branchExists = true;
|
|
259
259
|
}
|
|
260
260
|
catch {
|
|
@@ -270,7 +270,7 @@ export async function branchCommand(options = {}) {
|
|
|
270
270
|
],
|
|
271
271
|
});
|
|
272
272
|
if (action === "checkout") {
|
|
273
|
-
|
|
273
|
+
execFileSync("git", ["checkout", branchName], { stdio: "inherit" });
|
|
274
274
|
console.log(green(`✓ Checked out existing branch: ${branchName}`));
|
|
275
275
|
}
|
|
276
276
|
else if (action === "new") {
|
|
@@ -283,7 +283,7 @@ export async function branchCommand(options = {}) {
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
else {
|
|
286
|
-
|
|
286
|
+
execFileSync("git", ["checkout", "-b", branchName], { stdio: "inherit" });
|
|
287
287
|
console.log(green(`✓ Branch created: ${branchName}`));
|
|
288
288
|
}
|
|
289
289
|
// Handle test plan from flag or prompt
|
|
@@ -356,4 +356,3 @@ export async function branchCommand(options = {}) {
|
|
|
356
356
|
process.exit(1);
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
//# sourceMappingURL=branch.js.map
|
package/dist/commands/cleanup.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import { bold, dim, green, red, yellow, gray } from "../colors.js";
|
|
3
3
|
import { deleteTestPlan } from "../test-plan.js";
|
|
4
|
+
import { getRepoDefaultBranch } from "../git.js";
|
|
4
5
|
import { checkboxWithBack, confirmWithBack, BACK_VALUE } from "../prompts.js";
|
|
5
6
|
function getMergedBranches() {
|
|
6
7
|
try {
|
|
7
|
-
const
|
|
8
|
+
const defaultBranch = getRepoDefaultBranch();
|
|
9
|
+
const result = execSync(`git branch --merged ${defaultBranch}`, { encoding: "utf-8" }).trim();
|
|
8
10
|
return result
|
|
9
11
|
.split("\n")
|
|
10
12
|
.map((b) => b.trim())
|
|
11
|
-
.filter((b) => b && !b.startsWith("*") && b !==
|
|
13
|
+
.filter((b) => b && !b.startsWith("*") && b !== defaultBranch);
|
|
12
14
|
}
|
|
13
15
|
catch {
|
|
14
16
|
return [];
|
|
@@ -147,4 +149,3 @@ export async function cleanupCommand(options = {}) {
|
|
|
147
149
|
process.exit(1);
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
|
-
//# sourceMappingURL=cleanup.js.map
|
package/dist/commands/commit.js
CHANGED
package/dist/commands/doctor.js
CHANGED
package/dist/commands/fixup.d.ts
CHANGED
package/dist/commands/fixup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execSync } from "child_process";
|
|
1
|
+
import { execSync, execFileSync } from "child_process";
|
|
2
2
|
import { bold, dim, green, cyan } from "../colors.js";
|
|
3
3
|
import { getDefaultBase, getBranch } from "../git.js";
|
|
4
4
|
import { selectWithBack, confirmWithBack, checkboxWithBack, BACK_VALUE, } from "../prompts.js";
|
|
@@ -146,7 +146,7 @@ export async function fixupCommand(options = {}) {
|
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
// Create fixup commit
|
|
149
|
-
|
|
149
|
+
execFileSync("git", ["commit", `--fixup=${target}`], { stdio: "inherit" });
|
|
150
150
|
console.log(green("✓ Fixup commit created."));
|
|
151
151
|
// Handle auto-squash from flag or prompt
|
|
152
152
|
let autoSquash;
|
|
@@ -165,7 +165,7 @@ export async function fixupCommand(options = {}) {
|
|
|
165
165
|
autoSquash = squashResult === true;
|
|
166
166
|
}
|
|
167
167
|
if (autoSquash) {
|
|
168
|
-
|
|
168
|
+
execFileSync("git", ["rebase", "-i", "--autosquash", base], {
|
|
169
169
|
stdio: "inherit",
|
|
170
170
|
env: { ...process.env, GIT_SEQUENCE_EDITOR: "true" },
|
|
171
171
|
});
|
|
@@ -190,4 +190,3 @@ export async function fixupCommand(options = {}) {
|
|
|
190
190
|
process.exit(1);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
//# sourceMappingURL=fixup.js.map
|
package/dist/commands/init.d.ts
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
2
2
|
import { resolve } from "path";
|
|
3
3
|
import { confirm, input, select } from "@inquirer/prompts";
|
|
4
|
-
import { execSync } from "child_process";
|
|
4
|
+
import { execSync, execFileSync } from "child_process";
|
|
5
5
|
import { PRESETS } from "../config.js";
|
|
6
6
|
import { writeVersionInfo, getCliVersion } from "../devflow-version.js";
|
|
7
|
+
import { isGhInstalled } from "../git.js";
|
|
7
8
|
import { selectWithBack, inputWithBack, confirmWithBack, BACK_VALUE, } from "../prompts.js";
|
|
8
9
|
const DEFAULT_CHECKLIST = [
|
|
9
10
|
"Code follows project conventions",
|
|
@@ -84,7 +85,7 @@ function getRepoLinkedProjects(repo) {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
}`;
|
|
87
|
-
const result =
|
|
88
|
+
const result = execFileSync("gh", ["api", "graphql", "-f", `query=${query}`], {
|
|
88
89
|
encoding: "utf-8",
|
|
89
90
|
stdio: ["pipe", "pipe", "pipe"],
|
|
90
91
|
}).trim();
|
|
@@ -114,18 +115,10 @@ function refreshProjectScopes() {
|
|
|
114
115
|
}
|
|
115
116
|
function createAndLinkProject(repo, title) {
|
|
116
117
|
try {
|
|
117
|
-
|
|
118
|
-
const createResult = execSync(`gh project create --owner ${repo.owner} --title "${title}" --format json`, {
|
|
119
|
-
encoding: "utf-8",
|
|
120
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
121
|
-
}).trim();
|
|
118
|
+
const createResult = execFileSync("gh", ["project", "create", "--owner", repo.owner, "--title", title, "--format", "json"], { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
122
119
|
const project = JSON.parse(createResult);
|
|
123
120
|
const projectNumber = project.number;
|
|
124
|
-
|
|
125
|
-
execSync(`gh project link ${projectNumber} --owner ${repo.owner} --repo ${repo.name}`, {
|
|
126
|
-
encoding: "utf-8",
|
|
127
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
128
|
-
});
|
|
121
|
+
execFileSync("gh", ["project", "link", String(projectNumber), "--owner", repo.owner, "--repo", repo.name], { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
129
122
|
return { number: projectNumber, title };
|
|
130
123
|
}
|
|
131
124
|
catch {
|
|
@@ -227,6 +220,12 @@ export async function initCommand() {
|
|
|
227
220
|
break;
|
|
228
221
|
}
|
|
229
222
|
case "projectSetup": {
|
|
223
|
+
if (!isGhInstalled()) {
|
|
224
|
+
console.log("⚠ GitHub CLI (gh) is not installed — skipping project integration.");
|
|
225
|
+
console.log(" Install it with: brew install gh\n");
|
|
226
|
+
currentStep = "scopes";
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
230
229
|
// Check if we have project scopes
|
|
231
230
|
const hasScopes = hasProjectScopes();
|
|
232
231
|
if (!hasScopes) {
|
|
@@ -734,6 +733,52 @@ devflow amend # If you need to add more changes
|
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
}
|
|
736
|
+
// Generate Claude Code skill wrapper that points to AI_INSTRUCTIONS.md
|
|
737
|
+
const skillDir = resolve(cwd, ".claude/skills/devflow-usage");
|
|
738
|
+
mkdirSync(skillDir, { recursive: true });
|
|
739
|
+
const claudeSkill = `---
|
|
740
|
+
name: devflow-usage
|
|
741
|
+
description: MANDATORY when working in any devflow-managed repo (one with a .devflow/config.json). Always use devflow commands instead of raw git/gh — \`devflow branch\` over \`git checkout -b\`, \`devflow commit\` over \`git commit\`, \`devflow pr\` over \`gh pr create\`. Never push directly to main; all changes go through PRs. Full command reference and non-interactive flag examples live in .devflow/AI_INSTRUCTIONS.md.
|
|
742
|
+
---
|
|
743
|
+
|
|
744
|
+
# DevFlow Usage
|
|
745
|
+
|
|
746
|
+
This repo uses [devflow](https://github.com/alejandrochvs/devflow-cli) for Git workflow automation. Apply these rules whenever making changes.
|
|
747
|
+
|
|
748
|
+
## Core rules
|
|
749
|
+
|
|
750
|
+
1. **Never push directly to main.** All changes go through pull requests, even small fixes.
|
|
751
|
+
2. **Use devflow commands, not raw git/gh:**
|
|
752
|
+
- Branches: \`devflow branch\` (not \`git checkout -b\`)
|
|
753
|
+
- Commits: \`devflow commit\` (not \`git commit\`)
|
|
754
|
+
- PRs: \`devflow pr\` (not \`gh pr create\`)
|
|
755
|
+
- Issues: \`devflow issue\` / \`devflow issues\` (not \`gh issue ...\`)
|
|
756
|
+
3. **Issue-first workflow** (when a project board is configured):
|
|
757
|
+
- \`devflow issues\` to see Todo / In Progress
|
|
758
|
+
- \`devflow issues --work --issue <N> --yes\` to start work
|
|
759
|
+
4. **Commit format:** \`${commitFormat}\` — e.g. \`feat[123](auth): add OAuth2 login\`.
|
|
760
|
+
5. **Branch format:** \`${branchFormat}\` — e.g. \`feat/123_add-login\`.
|
|
761
|
+
6. **Press \`Escape\`** to go back a step in any multi-step prompt.
|
|
762
|
+
7. **Use \`--dry-run\`** to preview any command without executing.
|
|
763
|
+
|
|
764
|
+
## Non-interactive mode for AI agents
|
|
765
|
+
|
|
766
|
+
Append \`--yes\` to skip all confirmation prompts. Each command also accepts content flags so prompts can be skipped entirely:
|
|
767
|
+
|
|
768
|
+
\`\`\`bash
|
|
769
|
+
devflow branch --type feat --ticket 123 --description "add-login" --yes
|
|
770
|
+
devflow commit --type feat --scope auth --message "add login" --all --yes
|
|
771
|
+
devflow pr --title "Add login" --summary "Implements login UI" --yes
|
|
772
|
+
\`\`\`
|
|
773
|
+
|
|
774
|
+
Full per-command non-interactive examples live in \`.devflow/AI_INSTRUCTIONS.md\`.
|
|
775
|
+
|
|
776
|
+
## Full reference
|
|
777
|
+
|
|
778
|
+
For everything beyond the basics above — Quick Reference table, all command flags, common workflows, edge cases like merged/closed PRs — read \`.devflow/AI_INSTRUCTIONS.md\`. Treat that file as canonical.
|
|
779
|
+
`;
|
|
780
|
+
writeFileSync(resolve(skillDir, "SKILL.md"), claudeSkill);
|
|
781
|
+
console.log("✓ Created .claude/skills/devflow-usage/SKILL.md");
|
|
737
782
|
}
|
|
738
783
|
// 10. Write .devflow/config.json
|
|
739
784
|
const config = {
|
|
@@ -790,4 +835,3 @@ devflow amend # If you need to add more changes
|
|
|
790
835
|
process.exit(1);
|
|
791
836
|
}
|
|
792
837
|
}
|
|
793
|
-
//# sourceMappingURL=init.js.map
|
package/dist/commands/issue.d.ts
CHANGED
package/dist/commands/issue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { select, input, confirm, editor } from "@inquirer/prompts";
|
|
2
|
-
import { execSync } from "child_process";
|
|
2
|
+
import { execSync, execFileSync } from "child_process";
|
|
3
3
|
import { loadConfig } from "../config.js";
|
|
4
4
|
import { bold, dim, green, cyan, gray } from "../colors.js";
|
|
5
5
|
import { checkGhInstalled } from "../git.js";
|
|
@@ -198,35 +198,20 @@ async function collectIssueData(issueType) {
|
|
|
198
198
|
function ensureLabelsExist(labels) {
|
|
199
199
|
for (const label of labels) {
|
|
200
200
|
try {
|
|
201
|
-
|
|
202
|
-
execSync(`gh label list --search "${label}" --json name`, {
|
|
203
|
-
encoding: "utf-8",
|
|
204
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
205
|
-
});
|
|
206
|
-
// Parse results to see if exact match exists
|
|
207
|
-
const result = execSync(`gh label list --search "${label}" --json name`, {
|
|
208
|
-
encoding: "utf-8",
|
|
209
|
-
});
|
|
201
|
+
const result = execFileSync("gh", ["label", "list", "--search", label, "--json", "name"], { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
210
202
|
const existingLabels = JSON.parse(result);
|
|
211
203
|
const exactMatch = existingLabels.some((l) => l.name.toLowerCase() === label.toLowerCase());
|
|
212
204
|
if (!exactMatch) {
|
|
213
|
-
// Create the label with a default color
|
|
214
205
|
console.log(dim(`Creating label "${label}"...`));
|
|
215
|
-
|
|
216
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
217
|
-
});
|
|
206
|
+
execFileSync("gh", ["label", "create", label, "--color", "0e8a16", "--force"], { stdio: ["pipe", "pipe", "pipe"] });
|
|
218
207
|
}
|
|
219
208
|
}
|
|
220
209
|
catch {
|
|
221
|
-
// Label doesn't exist or error checking, try to create it
|
|
222
210
|
try {
|
|
223
211
|
console.log(dim(`Creating label "${label}"...`));
|
|
224
|
-
|
|
225
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
226
|
-
});
|
|
212
|
+
execFileSync("gh", ["label", "create", label, "--color", "0e8a16", "--force"], { stdio: ["pipe", "pipe", "pipe"] });
|
|
227
213
|
}
|
|
228
214
|
catch {
|
|
229
|
-
// If we can't create the label, we'll let the issue creation fail with the original error
|
|
230
215
|
console.warn(dim(`Warning: Could not create label "${label}"`));
|
|
231
216
|
}
|
|
232
217
|
}
|
|
@@ -504,7 +489,7 @@ export async function issueCommand(options = {}) {
|
|
|
504
489
|
}
|
|
505
490
|
}
|
|
506
491
|
// Create the branch
|
|
507
|
-
|
|
492
|
+
execFileSync("git", ["checkout", "-b", branchName], { stdio: "inherit" });
|
|
508
493
|
console.log(green(`✓ Branch created: ${branchName}`));
|
|
509
494
|
// Skip test plan prompts if --yes is provided
|
|
510
495
|
if (!options.yes) {
|
|
@@ -593,4 +578,3 @@ export async function issueCommand(options = {}) {
|
|
|
593
578
|
throw error;
|
|
594
579
|
}
|
|
595
580
|
}
|
|
596
|
-
//# sourceMappingURL=issue.js.map
|
package/dist/commands/issues.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from "child_process";
|
|
2
2
|
import { loadConfig } from "../config.js";
|
|
3
3
|
import { bold, dim, green, cyan, yellow, gray } from "../colors.js";
|
|
4
4
|
import { checkGhInstalled } from "../git.js";
|
|
@@ -331,7 +331,7 @@ async function startWork(options, config, ctx) {
|
|
|
331
331
|
}
|
|
332
332
|
// 3. Create branch
|
|
333
333
|
try {
|
|
334
|
-
|
|
334
|
+
execFileSync("git", ["checkout", "-b", branchName], { stdio: "inherit" });
|
|
335
335
|
console.log(green(`✓ Branch created: ${branchName}`));
|
|
336
336
|
}
|
|
337
337
|
catch {
|
|
@@ -376,4 +376,3 @@ export async function issuesCommand(options = {}) {
|
|
|
376
376
|
throw error;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
//# sourceMappingURL=issues.js.map
|
package/dist/commands/log.d.ts
CHANGED
package/dist/commands/log.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execSync } from "child_process";
|
|
1
|
+
import { execSync, execFileSync } from "child_process";
|
|
2
2
|
import { bold, dim, green, cyan } from "../colors.js";
|
|
3
3
|
import { getDefaultBase, getBranch } from "../git.js";
|
|
4
4
|
import { selectWithBack, BACK_VALUE } from "../prompts.js";
|
|
@@ -82,22 +82,22 @@ export async function logCommand() {
|
|
|
82
82
|
}
|
|
83
83
|
switch (action) {
|
|
84
84
|
case "cherry-pick":
|
|
85
|
-
|
|
85
|
+
execFileSync("git", ["cherry-pick", selectedHash], { stdio: "inherit" });
|
|
86
86
|
console.log(green(`✓ Cherry-picked ${entry.shortHash}`));
|
|
87
87
|
currentStep = "done";
|
|
88
88
|
break;
|
|
89
89
|
case "revert":
|
|
90
|
-
|
|
90
|
+
execFileSync("git", ["revert", selectedHash], { stdio: "inherit" });
|
|
91
91
|
console.log(green(`✓ Reverted ${entry.shortHash}`));
|
|
92
92
|
currentStep = "done";
|
|
93
93
|
break;
|
|
94
94
|
case "fixup":
|
|
95
|
-
|
|
95
|
+
execFileSync("git", ["commit", `--fixup=${selectedHash}`], { stdio: "inherit" });
|
|
96
96
|
console.log(green(`✓ Created fixup for ${entry.shortHash}`));
|
|
97
97
|
currentStep = "done";
|
|
98
98
|
break;
|
|
99
99
|
case "diff": {
|
|
100
|
-
const diff =
|
|
100
|
+
const diff = execFileSync("git", ["show", selectedHash], { encoding: "utf-8" });
|
|
101
101
|
console.log(diff);
|
|
102
102
|
// Stay on action step to allow choosing another action
|
|
103
103
|
break;
|
|
@@ -121,4 +121,3 @@ export async function logCommand() {
|
|
|
121
121
|
process.exit(1);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
//# sourceMappingURL=log.js.map
|
package/dist/commands/merge.d.ts
CHANGED
package/dist/commands/merge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execSync } from "child_process";
|
|
2
2
|
import { bold, dim, green, cyan } from "../colors.js";
|
|
3
|
-
import { getBranch, checkGhInstalled } from "../git.js";
|
|
3
|
+
import { getBranch, checkGhInstalled, getRepoDefaultBranch } from "../git.js";
|
|
4
4
|
import { deleteTestPlan } from "../test-plan.js";
|
|
5
5
|
import { selectWithBack, confirmWithBack, BACK_VALUE, } from "../prompts.js";
|
|
6
6
|
function getPrForBranch() {
|
|
@@ -123,14 +123,14 @@ export async function mergeCommand(options = {}) {
|
|
|
123
123
|
console.log(green(`\n✓ PR #${pr.number} merged via ${method}.`));
|
|
124
124
|
if (deleteBranch) {
|
|
125
125
|
deleteTestPlan(branch);
|
|
126
|
-
|
|
126
|
+
const defaultBranch = getRepoDefaultBranch();
|
|
127
127
|
try {
|
|
128
|
-
execSync(
|
|
128
|
+
execSync(`git checkout ${defaultBranch}`, { stdio: "inherit" });
|
|
129
129
|
execSync("git pull", { stdio: "inherit" });
|
|
130
|
-
console.log(green(
|
|
130
|
+
console.log(green(`✓ Switched to ${defaultBranch} and pulled latest.`));
|
|
131
131
|
}
|
|
132
132
|
catch {
|
|
133
|
-
// May not have
|
|
133
|
+
// May not have default branch locally
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -142,4 +142,3 @@ export async function mergeCommand(options = {}) {
|
|
|
142
142
|
process.exit(1);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
//# sourceMappingURL=merge.js.map
|
package/dist/commands/pr.d.ts
CHANGED