@stefanoginella/auto-bmad 0.1.4 → 0.1.12
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/cli.js +99 -0
- package/package.json +4 -4
- package/install.sh +0 -76
package/cli.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync, execFileSync } = require("child_process");
|
|
3
|
+
const { createInterface } = require("readline");
|
|
4
|
+
|
|
5
|
+
const PLUGIN_NAME = "auto-bmad";
|
|
6
|
+
const MARKETPLACE = "stefanoginella-plugins";
|
|
7
|
+
const MARKETPLACE_REPO = "stefanoginella/claude-code-plugins";
|
|
8
|
+
const NPM_SCOPE = "@stefanoginella";
|
|
9
|
+
|
|
10
|
+
const noColor = process.env.NO_COLOR || !process.stdout.isTTY;
|
|
11
|
+
const GREEN = noColor ? "" : "\x1b[32m";
|
|
12
|
+
const RED = noColor ? "" : "\x1b[31m";
|
|
13
|
+
const YELLOW = noColor ? "" : "\x1b[33m";
|
|
14
|
+
const BOLD = noColor ? "" : "\x1b[1m";
|
|
15
|
+
const RESET = noColor ? "" : "\x1b[0m";
|
|
16
|
+
|
|
17
|
+
function run(cmd, opts = {}) {
|
|
18
|
+
return execSync(cmd, { stdio: "inherit", ...opts });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function claudeExists() {
|
|
22
|
+
try {
|
|
23
|
+
execFileSync("claude", ["--version"], { stdio: "ignore" });
|
|
24
|
+
return true;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function ask(question) {
|
|
31
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
32
|
+
return new Promise((resolve) => {
|
|
33
|
+
rl.question(question, (answer) => {
|
|
34
|
+
rl.close();
|
|
35
|
+
resolve(answer.trim());
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function main() {
|
|
41
|
+
if (!claudeExists()) {
|
|
42
|
+
console.error(`${RED}Error: claude CLI not found.${RESET}`);
|
|
43
|
+
console.error("Install Claude Code first: https://docs.anthropic.com/en/docs/claude-code");
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Uninstall
|
|
48
|
+
if (process.argv.includes("--uninstall")) {
|
|
49
|
+
console.log(`Uninstalling ${PLUGIN_NAME}...`);
|
|
50
|
+
try {
|
|
51
|
+
run(`claude plugin uninstall "${PLUGIN_NAME}@${MARKETPLACE}"`);
|
|
52
|
+
console.log(`${GREEN}${PLUGIN_NAME} uninstalled.${RESET}`);
|
|
53
|
+
} catch {
|
|
54
|
+
console.log(`${PLUGIN_NAME} is not installed.`);
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Choose scope
|
|
60
|
+
console.log();
|
|
61
|
+
console.log(`${BOLD}Install scope:${RESET}`);
|
|
62
|
+
console.log(" 1) project — shared with team via .claude/settings.json (default)");
|
|
63
|
+
console.log(" 2) user — available across all your projects");
|
|
64
|
+
console.log(" 3) local — this project only, personal, gitignored");
|
|
65
|
+
console.log();
|
|
66
|
+
|
|
67
|
+
const choice = await ask("Choose scope [1]: ");
|
|
68
|
+
const scope = choice === "2" ? "user" : choice === "3" ? "local" : "project";
|
|
69
|
+
|
|
70
|
+
// Install
|
|
71
|
+
console.log();
|
|
72
|
+
console.log(`${BOLD}Installing ${PLUGIN_NAME} (scope: ${scope})...${RESET}`);
|
|
73
|
+
console.log();
|
|
74
|
+
|
|
75
|
+
// Add marketplace (idempotent)
|
|
76
|
+
console.log(`Adding marketplace ${MARKETPLACE_REPO}...`);
|
|
77
|
+
try { run(`claude plugin marketplace add "${MARKETPLACE_REPO}"`, { stdio: "pipe" }); } catch {}
|
|
78
|
+
|
|
79
|
+
// Install plugin
|
|
80
|
+
console.log("Installing plugin...");
|
|
81
|
+
try {
|
|
82
|
+
run(`claude plugin install "${PLUGIN_NAME}@${MARKETPLACE}" --scope ${scope}`);
|
|
83
|
+
console.log();
|
|
84
|
+
console.log(`${GREEN}${BOLD}${PLUGIN_NAME} installed successfully.${RESET}`);
|
|
85
|
+
console.log();
|
|
86
|
+
console.log("Start Claude Code in this project directory to use the plugin.");
|
|
87
|
+
console.log(`Run ${YELLOW}npx ${NPM_SCOPE}/${PLUGIN_NAME} --uninstall${RESET} to remove.`);
|
|
88
|
+
console.log();
|
|
89
|
+
} catch {
|
|
90
|
+
console.error();
|
|
91
|
+
console.error(`${RED}Installation failed.${RESET}`);
|
|
92
|
+
console.error("Try installing manually inside Claude Code:");
|
|
93
|
+
console.error(` /plugin marketplace add ${MARKETPLACE_REPO}`);
|
|
94
|
+
console.error(` /plugin install ${PLUGIN_NAME}@${MARKETPLACE}`);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stefanoginella/auto-bmad",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Installs the auto-bmad Claude Code plugin — automated BMAD pipeline orchestration",
|
|
5
5
|
"bin": {
|
|
6
|
-
"auto-bmad": "
|
|
6
|
+
"auto-bmad": "cli.js"
|
|
7
7
|
},
|
|
8
|
-
"files": ["
|
|
8
|
+
"files": ["cli.js"],
|
|
9
9
|
"keywords": ["claude-code", "plugin", "bmad", "pipeline", "automation", "orchestration", "sdlc"],
|
|
10
10
|
"author": "Stefano Ginella",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/stefanoginella/claude-code-plugins",
|
|
14
|
+
"url": "git+https://github.com/stefanoginella/claude-code-plugins.git",
|
|
15
15
|
"directory": "packages/auto-bmad"
|
|
16
16
|
},
|
|
17
17
|
"homepage": "https://github.com/stefanoginella/claude-code-plugins/blob/main/plugins/auto-bmad/README.md"
|
package/install.sh
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
PLUGIN_NAME="auto-bmad"
|
|
5
|
-
MARKETPLACE="stefanoginella-plugins"
|
|
6
|
-
MARKETPLACE_REPO="stefanoginella/claude-code-plugins"
|
|
7
|
-
|
|
8
|
-
# --- Color support ---
|
|
9
|
-
if [ "${NO_COLOR:-}" = "" ] && [ -t 1 ]; then
|
|
10
|
-
GREEN='\033[0;32m'
|
|
11
|
-
RED='\033[0;31m'
|
|
12
|
-
YELLOW='\033[1;33m'
|
|
13
|
-
BOLD='\033[1m'
|
|
14
|
-
RESET='\033[0m'
|
|
15
|
-
else
|
|
16
|
-
GREEN='' RED='' YELLOW='' BOLD='' RESET=''
|
|
17
|
-
fi
|
|
18
|
-
|
|
19
|
-
# --- Check claude CLI is available ---
|
|
20
|
-
if ! command -v claude &>/dev/null; then
|
|
21
|
-
echo -e "${RED}Error: claude CLI not found.${RESET}" >&2
|
|
22
|
-
echo "Install Claude Code first: https://docs.anthropic.com/en/docs/claude-code" >&2
|
|
23
|
-
exit 1
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# --- Uninstall ---
|
|
27
|
-
if [ "${1:-}" = "--uninstall" ]; then
|
|
28
|
-
echo "Uninstalling ${PLUGIN_NAME}..."
|
|
29
|
-
claude plugin uninstall "${PLUGIN_NAME}@${MARKETPLACE}" 2>/dev/null && \
|
|
30
|
-
echo -e "${GREEN}${PLUGIN_NAME} uninstalled.${RESET}" || \
|
|
31
|
-
echo "${PLUGIN_NAME} is not installed."
|
|
32
|
-
exit 0
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
# --- Choose scope ---
|
|
36
|
-
echo ""
|
|
37
|
-
echo -e "${BOLD}Install scope:${RESET}"
|
|
38
|
-
echo " 1) project — shared with team via .claude/settings.json (default)"
|
|
39
|
-
echo " 2) user — available across all your projects"
|
|
40
|
-
echo " 3) local — this project only, personal, gitignored"
|
|
41
|
-
echo ""
|
|
42
|
-
printf "Choose scope [1]: "
|
|
43
|
-
read -r scope_choice
|
|
44
|
-
|
|
45
|
-
case "${scope_choice}" in
|
|
46
|
-
2) SCOPE="user" ;;
|
|
47
|
-
3) SCOPE="local" ;;
|
|
48
|
-
*) SCOPE="project" ;;
|
|
49
|
-
esac
|
|
50
|
-
|
|
51
|
-
# --- Install ---
|
|
52
|
-
echo ""
|
|
53
|
-
echo -e "${BOLD}Installing ${PLUGIN_NAME} (scope: ${SCOPE})...${RESET}"
|
|
54
|
-
echo ""
|
|
55
|
-
|
|
56
|
-
# Add marketplace (idempotent)
|
|
57
|
-
echo "Adding marketplace ${MARKETPLACE_REPO}..."
|
|
58
|
-
claude plugin marketplace add "${MARKETPLACE_REPO}" 2>/dev/null || true
|
|
59
|
-
|
|
60
|
-
# Install plugin
|
|
61
|
-
echo "Installing plugin..."
|
|
62
|
-
if claude plugin install "${PLUGIN_NAME}@${MARKETPLACE}" --scope "${SCOPE}"; then
|
|
63
|
-
echo ""
|
|
64
|
-
echo -e "${GREEN}${BOLD}${PLUGIN_NAME} installed successfully.${RESET}"
|
|
65
|
-
echo ""
|
|
66
|
-
echo "Start Claude Code in this project directory to use the plugin."
|
|
67
|
-
echo -e "Run ${YELLOW}npx @stefanoginella/${PLUGIN_NAME} --uninstall${RESET} to remove."
|
|
68
|
-
echo ""
|
|
69
|
-
else
|
|
70
|
-
echo ""
|
|
71
|
-
echo -e "${RED}Installation failed.${RESET}" >&2
|
|
72
|
-
echo "Try installing manually inside Claude Code:" >&2
|
|
73
|
-
echo " /plugin marketplace add ${MARKETPLACE_REPO}" >&2
|
|
74
|
-
echo " /plugin install ${PLUGIN_NAME}@${MARKETPLACE}" >&2
|
|
75
|
-
exit 1
|
|
76
|
-
fi
|