@michael_magdy/mic-drop 0.1.0 → 0.1.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/dist/index.js +80 -9
- package/package.json +9 -2
package/dist/index.js
CHANGED
|
@@ -26,6 +26,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
// src/index.ts
|
|
27
27
|
var import_commander = require("commander");
|
|
28
28
|
|
|
29
|
+
// package.json
|
|
30
|
+
var version = "0.1.1";
|
|
31
|
+
|
|
29
32
|
// src/commands/setup.ts
|
|
30
33
|
var import_prompts = require("@inquirer/prompts");
|
|
31
34
|
var import_path5 = __toESM(require("path"));
|
|
@@ -60,7 +63,9 @@ var ProjectConfigSchema = import_zod.z.object({
|
|
|
60
63
|
copyFiles: import_zod.z.array(import_zod.z.string()).default([]),
|
|
61
64
|
copyDirs: import_zod.z.array(import_zod.z.string()).default([]),
|
|
62
65
|
terminal: import_zod.z.string().default("warp"),
|
|
63
|
-
|
|
66
|
+
cliTool: import_zod.z.string().default("claude"),
|
|
67
|
+
cliCommand: import_zod.z.string().default("claude"),
|
|
68
|
+
cliFlags: import_zod.z.string().default("--permission-mode plan")
|
|
64
69
|
});
|
|
65
70
|
var PROJECT_CONFIG_DEFAULTS = {
|
|
66
71
|
baseBranch: "develop",
|
|
@@ -68,7 +73,9 @@ var PROJECT_CONFIG_DEFAULTS = {
|
|
|
68
73
|
copyFiles: [],
|
|
69
74
|
copyDirs: [],
|
|
70
75
|
terminal: "warp",
|
|
71
|
-
|
|
76
|
+
cliTool: "claude",
|
|
77
|
+
cliCommand: "claude",
|
|
78
|
+
cliFlags: "--permission-mode plan"
|
|
72
79
|
};
|
|
73
80
|
|
|
74
81
|
// src/config/projectConfig.ts
|
|
@@ -79,6 +86,12 @@ async function loadProjectConfig(repoRoot) {
|
|
|
79
86
|
const legacyPath = import_path.default.join(repoRoot, LEGACY_CONFIG);
|
|
80
87
|
if (import_fs.default.existsSync(jsonPath)) {
|
|
81
88
|
const raw = JSON.parse(import_fs.default.readFileSync(jsonPath, "utf-8"));
|
|
89
|
+
if ("claudeMode" in raw && !("cliTool" in raw)) {
|
|
90
|
+
raw.cliTool = "claude";
|
|
91
|
+
raw.cliCommand = "claude";
|
|
92
|
+
raw.cliFlags = raw.claudeMode;
|
|
93
|
+
delete raw.claudeMode;
|
|
94
|
+
}
|
|
82
95
|
const config = ProjectConfigSchema.parse(raw);
|
|
83
96
|
return { config, source: "json" };
|
|
84
97
|
}
|
|
@@ -115,16 +128,52 @@ function parseLegacyConf(content) {
|
|
|
115
128
|
partial[key] = value;
|
|
116
129
|
}
|
|
117
130
|
}
|
|
131
|
+
const legacyFlags = partial["CLAUDE_MODE"];
|
|
118
132
|
return ProjectConfigSchema.parse({
|
|
119
133
|
baseBranch: partial["BASE_BRANCH"],
|
|
120
134
|
worktreesDir: partial["WORKTREES_DIR"],
|
|
121
135
|
copyFiles: partial["COPY_FILES"],
|
|
122
136
|
copyDirs: partial["COPY_DIRS"],
|
|
123
137
|
terminal: partial["TERMINAL"],
|
|
124
|
-
|
|
138
|
+
cliTool: "claude",
|
|
139
|
+
cliCommand: "claude",
|
|
140
|
+
cliFlags: legacyFlags
|
|
125
141
|
});
|
|
126
142
|
}
|
|
127
143
|
|
|
144
|
+
// src/config/cliTools.ts
|
|
145
|
+
var CLI_TOOLS = [
|
|
146
|
+
{
|
|
147
|
+
id: "claude",
|
|
148
|
+
label: "Claude Code",
|
|
149
|
+
command: "claude",
|
|
150
|
+
defaultFlags: "--permission-mode plan"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: "gemini",
|
|
154
|
+
label: "Gemini CLI",
|
|
155
|
+
command: "gemini",
|
|
156
|
+
defaultFlags: ""
|
|
157
|
+
// default interactive mode (omit --yolo for safety)
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "codex",
|
|
161
|
+
label: "OpenAI Codex CLI",
|
|
162
|
+
command: "codex",
|
|
163
|
+
defaultFlags: "--approval-mode suggest"
|
|
164
|
+
// suggest-only, mirrors plan mode
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: "other",
|
|
168
|
+
label: "Other",
|
|
169
|
+
command: "",
|
|
170
|
+
defaultFlags: ""
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
function getCliTool(id) {
|
|
174
|
+
return CLI_TOOLS.find((t) => t.id === id);
|
|
175
|
+
}
|
|
176
|
+
|
|
128
177
|
// src/jira/adfParser.ts
|
|
129
178
|
function extractText(node) {
|
|
130
179
|
const parts = [];
|
|
@@ -657,9 +706,28 @@ async function runSetup() {
|
|
|
657
706
|
choices: terminalChoices,
|
|
658
707
|
default: available.find((l) => l.name === existing.terminal) ? existing.terminal : terminalChoices[0].value
|
|
659
708
|
}) : terminalChoices[0].value;
|
|
660
|
-
const
|
|
661
|
-
message: "
|
|
662
|
-
|
|
709
|
+
const cliToolId = await (0, import_prompts.select)({
|
|
710
|
+
message: "AI CLI tool:",
|
|
711
|
+
choices: CLI_TOOLS.map((t) => ({ name: t.label, value: t.id })),
|
|
712
|
+
default: existing.cliTool
|
|
713
|
+
});
|
|
714
|
+
const toolDef = getCliTool(cliToolId);
|
|
715
|
+
let cliCommand;
|
|
716
|
+
if (cliToolId === "other") {
|
|
717
|
+
console.log(' Enter the CLI command to run (e.g. "my-ai-tool").');
|
|
718
|
+
console.log(' It will be invoked as: <command> <flags> "$(cat .ticket.md)"');
|
|
719
|
+
cliCommand = await (0, import_prompts.input)({
|
|
720
|
+
message: "CLI command:",
|
|
721
|
+
default: existing.cliTool === "other" ? existing.cliCommand : "",
|
|
722
|
+
validate: (v) => v.trim() ? true : "Required"
|
|
723
|
+
});
|
|
724
|
+
} else {
|
|
725
|
+
cliCommand = toolDef.command;
|
|
726
|
+
}
|
|
727
|
+
const flagsDefault = toolDef.defaultFlags !== "" ? toolDef.defaultFlags : existing.cliTool === cliToolId ? existing.cliFlags : "";
|
|
728
|
+
const cliFlags = await (0, import_prompts.input)({
|
|
729
|
+
message: `${cliToolId === "other" ? "CLI" : toolDef.label} flags:`,
|
|
730
|
+
default: flagsDefault
|
|
663
731
|
});
|
|
664
732
|
const parseList = (raw) => raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
665
733
|
const newConfig = {
|
|
@@ -668,7 +736,9 @@ async function runSetup() {
|
|
|
668
736
|
copyFiles: parseList(copyFilesRaw),
|
|
669
737
|
copyDirs: parseList(copyDirsRaw),
|
|
670
738
|
terminal,
|
|
671
|
-
|
|
739
|
+
cliTool: cliToolId,
|
|
740
|
+
cliCommand: cliCommand.trim(),
|
|
741
|
+
cliFlags: cliFlags.trim()
|
|
672
742
|
};
|
|
673
743
|
saveProjectConfig(repoRoot, newConfig);
|
|
674
744
|
logger.success(`Config written to ${import_path5.default.join(repoRoot, ".worktree.json")}`);
|
|
@@ -777,7 +847,8 @@ async function runTicket(issueKey, opts) {
|
|
|
777
847
|
await excludeFromWorktree(targetDir, [".ticket.md", ".start-claude.sh"]);
|
|
778
848
|
ensureGitignoreEntry(repoRoot, config.worktreesDir);
|
|
779
849
|
logger.success("Updated .gitignore");
|
|
780
|
-
const
|
|
850
|
+
const flags = config.cliFlags.trim();
|
|
851
|
+
const claudeCommand = flags ? `${config.cliCommand} ${flags} "$(cat .ticket.md)"` : `${config.cliCommand} "$(cat .ticket.md)"`;
|
|
781
852
|
logger.step("Launching terminal...");
|
|
782
853
|
const launcher = getLauncher(config.terminal);
|
|
783
854
|
logger.detail("Terminal", launcher.name);
|
|
@@ -793,7 +864,7 @@ async function runTicket(issueKey, opts) {
|
|
|
793
864
|
|
|
794
865
|
// src/index.ts
|
|
795
866
|
var program = new import_commander.Command();
|
|
796
|
-
program.name("mic-drop").description("Turn a Jira ticket into an isolated git worktree with Claude Code \u2014 in one command.").version(
|
|
867
|
+
program.name("mic-drop").description("Turn a Jira ticket into an isolated git worktree with Claude Code \u2014 in one command.").version(version);
|
|
797
868
|
program.command("setup").description("Interactive setup wizard for Jira credentials and project configuration").action(async () => {
|
|
798
869
|
await runSetup();
|
|
799
870
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michael_magdy/mic-drop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"author": "Michael Magdy",
|
|
5
5
|
"description": "Turn a Jira ticket into an isolated git worktree with Claude Code running automatically — in one command.",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -19,7 +19,14 @@
|
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=18.0.0"
|
|
21
21
|
},
|
|
22
|
-
"keywords": [
|
|
22
|
+
"keywords": [
|
|
23
|
+
"jira",
|
|
24
|
+
"git",
|
|
25
|
+
"worktree",
|
|
26
|
+
"claude",
|
|
27
|
+
"cli",
|
|
28
|
+
"ai"
|
|
29
|
+
],
|
|
23
30
|
"license": "MIT",
|
|
24
31
|
"files": [
|
|
25
32
|
"dist"
|