edusquads-cli 0.1.0 → 0.2.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 +2 -0
- package/bin/edusquads.js +76 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,8 @@ Opções úteis:
|
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
npx edusquads-cli install --target <pasta-do-projeto>
|
|
26
|
+
npx edusquads-cli install --ide claude,codex,opencode,kilocode,antigravity
|
|
27
|
+
npx edusquads-cli install --ide all
|
|
26
28
|
npx edusquads-cli install --force
|
|
27
29
|
npx edusquads-cli install --dry-run
|
|
28
30
|
```
|
package/bin/edusquads.js
CHANGED
|
@@ -13,10 +13,20 @@ const targetDir =
|
|
|
13
13
|
? path.resolve(args[targetArgIndex + 1])
|
|
14
14
|
: process.cwd();
|
|
15
15
|
|
|
16
|
+
const ideArgIndex = args.findIndex((a) => a === "--ide");
|
|
17
|
+
const ideArg = ideArgIndex >= 0 ? args[ideArgIndex + 1] : "claude";
|
|
18
|
+
|
|
16
19
|
const PACKAGE_ROOT = path.resolve(__dirname, "..");
|
|
17
20
|
|
|
18
|
-
const
|
|
19
|
-
|
|
21
|
+
const IDE_SKILL_PATHS = {
|
|
22
|
+
claude: ".claude/skills/edusquads",
|
|
23
|
+
codex: ".codex/skills/edusquads",
|
|
24
|
+
opencode: ".opencode/skills/edusquads",
|
|
25
|
+
kilocode: ".kilocode/skills/edusquads",
|
|
26
|
+
antigravity: ".antigravity/skills/edusquads"
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const SHARED_INSTALL_ITEMS = [
|
|
20
30
|
{ src: "base", dest: "base" },
|
|
21
31
|
{ src: "especialistas", dest: "especialistas" },
|
|
22
32
|
{ src: "pesquisa", dest: "pesquisa" },
|
|
@@ -29,7 +39,42 @@ const INSTALL_ITEMS = [
|
|
|
29
39
|
];
|
|
30
40
|
|
|
31
41
|
function help() {
|
|
32
|
-
console.log(
|
|
42
|
+
console.log(`
|
|
43
|
+
EduSquads CLI
|
|
44
|
+
|
|
45
|
+
Uso:
|
|
46
|
+
npx edusquads-cli install [--target <dir>] [--ide <lista>] [--force] [--dry-run]
|
|
47
|
+
npx edusquads-cli --help
|
|
48
|
+
|
|
49
|
+
Opções:
|
|
50
|
+
--target <dir> Diretório do projeto de destino (default: diretório atual)
|
|
51
|
+
--ide <lista> IDE(s) para instalar a skill (default: claude)
|
|
52
|
+
Valores: claude,codex,opencode,kilocode,antigravity,all
|
|
53
|
+
Exemplo: --ide claude,codex,opencode
|
|
54
|
+
--force Sobrescreve arquivos existentes
|
|
55
|
+
--dry-run Simula instalação sem gravar arquivos
|
|
56
|
+
`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseIdes(input) {
|
|
60
|
+
const raw = (input || "claude").toLowerCase().trim();
|
|
61
|
+
if (!raw) return ["claude"];
|
|
62
|
+
|
|
63
|
+
if (raw === "all") return Object.keys(IDE_SKILL_PATHS);
|
|
64
|
+
|
|
65
|
+
const picked = raw
|
|
66
|
+
.split(",")
|
|
67
|
+
.map((x) => x.trim())
|
|
68
|
+
.filter(Boolean);
|
|
69
|
+
|
|
70
|
+
const unknown = picked.filter((x) => !IDE_SKILL_PATHS[x]);
|
|
71
|
+
if (unknown.length) {
|
|
72
|
+
console.error(`IDE(s) inválida(s): ${unknown.join(", ")}`);
|
|
73
|
+
console.error(`Use: ${Object.keys(IDE_SKILL_PATHS).join(", ")} ou all`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return [...new Set(picked)];
|
|
33
78
|
}
|
|
34
79
|
|
|
35
80
|
function ensureDir(p) {
|
|
@@ -62,10 +107,7 @@ function copyDir(src, dest, report) {
|
|
|
62
107
|
|
|
63
108
|
function patchGitignore(target) {
|
|
64
109
|
const gitignorePath = path.join(target, ".gitignore");
|
|
65
|
-
const required = [
|
|
66
|
-
"_edusquads/browser_profile/",
|
|
67
|
-
"_edusquads/evidencias/"
|
|
68
|
-
];
|
|
110
|
+
const required = ["_edusquads/browser_profile/", "_edusquads/evidencias/"];
|
|
69
111
|
|
|
70
112
|
let current = "";
|
|
71
113
|
if (fs.existsSync(gitignorePath)) {
|
|
@@ -75,7 +117,10 @@ function patchGitignore(target) {
|
|
|
75
117
|
let changed = false;
|
|
76
118
|
for (const line of required) {
|
|
77
119
|
if (!current.includes(line)) {
|
|
78
|
-
current +=
|
|
120
|
+
current +=
|
|
121
|
+
(current.endsWith("\n") || current.length === 0 ? "" : "\n") +
|
|
122
|
+
line +
|
|
123
|
+
"\n";
|
|
79
124
|
changed = true;
|
|
80
125
|
}
|
|
81
126
|
}
|
|
@@ -84,26 +129,37 @@ function patchGitignore(target) {
|
|
|
84
129
|
return changed;
|
|
85
130
|
}
|
|
86
131
|
|
|
87
|
-
function writeInstallMarker(target) {
|
|
132
|
+
function writeInstallMarker(target, ides) {
|
|
88
133
|
const markerPath = path.join(target, "_edusquads", "INSTALLATION.json");
|
|
89
134
|
const payload = {
|
|
90
135
|
installedAt: new Date().toISOString(),
|
|
91
136
|
package: "edusquads-cli",
|
|
92
|
-
version: "0.
|
|
137
|
+
version: "0.2.0",
|
|
138
|
+
ides
|
|
93
139
|
};
|
|
94
140
|
ensureDir(path.dirname(markerPath));
|
|
95
141
|
if (!dryRun) fs.writeFileSync(markerPath, JSON.stringify(payload, null, 2), "utf-8");
|
|
96
142
|
}
|
|
97
143
|
|
|
144
|
+
function buildInstallItems(ides) {
|
|
145
|
+
const skillItems = ides.map((ide) => ({
|
|
146
|
+
src: ".claude/skills/edusquads",
|
|
147
|
+
dest: IDE_SKILL_PATHS[ide]
|
|
148
|
+
}));
|
|
149
|
+
return [...skillItems, ...SHARED_INSTALL_ITEMS];
|
|
150
|
+
}
|
|
151
|
+
|
|
98
152
|
function install() {
|
|
99
153
|
if (!fs.existsSync(targetDir)) {
|
|
100
154
|
console.error(`Diretório alvo não existe: ${targetDir}`);
|
|
101
155
|
process.exit(1);
|
|
102
156
|
}
|
|
103
157
|
|
|
158
|
+
const ides = parseIdes(ideArg);
|
|
159
|
+
const installItems = buildInstallItems(ides);
|
|
104
160
|
const report = { created: 0, overwritten: 0, skipped: 0 };
|
|
105
161
|
|
|
106
|
-
for (const item of
|
|
162
|
+
for (const item of installItems) {
|
|
107
163
|
const src = path.join(PACKAGE_ROOT, item.src);
|
|
108
164
|
const dest = path.join(targetDir, item.dest);
|
|
109
165
|
|
|
@@ -122,14 +178,21 @@ function install() {
|
|
|
122
178
|
}
|
|
123
179
|
|
|
124
180
|
const gitignoreChanged = patchGitignore(targetDir);
|
|
125
|
-
writeInstallMarker(targetDir);
|
|
181
|
+
writeInstallMarker(targetDir, ides);
|
|
126
182
|
|
|
127
183
|
console.log(`\nEduSquads ${dryRun ? "(simulação) " : ""}instalado em: ${targetDir}`);
|
|
184
|
+
console.log(`IDEs instaladas: ${ides.join(", ")}`);
|
|
128
185
|
console.log(`Arquivos criados: ${report.created}`);
|
|
129
186
|
console.log(`Arquivos sobrescritos: ${report.overwritten}`);
|
|
130
187
|
console.log(`Arquivos ignorados (já existiam): ${report.skipped}`);
|
|
131
188
|
console.log(`.gitignore atualizado: ${gitignoreChanged ? "sim" : "não"}`);
|
|
132
|
-
|
|
189
|
+
|
|
190
|
+
console.log("\nComandos esperados por IDE (após abrir o projeto na IDE):");
|
|
191
|
+
for (const ide of ides) {
|
|
192
|
+
if (ide === "claude") console.log("- Claude Code: /edusquads");
|
|
193
|
+
else console.log(`- ${ide}: skill 'edusquads' instalada em ${IDE_SKILL_PATHS[ide]}`);
|
|
194
|
+
}
|
|
195
|
+
console.log("");
|
|
133
196
|
}
|
|
134
197
|
|
|
135
198
|
if (args.includes("--help") || args.includes("-h")) {
|