@arvorco/relentless 0.1.7 ā 0.1.8
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/bin/relentless.ts +2 -1
- package/package.json +1 -1
- package/src/init/scaffolder.ts +25 -15
package/bin/relentless.ts
CHANGED
|
@@ -30,8 +30,9 @@ program
|
|
|
30
30
|
.command("init")
|
|
31
31
|
.description("Initialize Relentless in the current project")
|
|
32
32
|
.option("-d, --dir <path>", "Project directory", process.cwd())
|
|
33
|
+
.option("-f, --force", "Force reinstall - overwrite existing files", false)
|
|
33
34
|
.action(async (options) => {
|
|
34
|
-
await initProject(options.dir);
|
|
35
|
+
await initProject(options.dir, options.force);
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
// Run command
|
package/package.json
CHANGED
package/src/init/scaffolder.ts
CHANGED
|
@@ -127,8 +127,8 @@ patterns: []
|
|
|
127
127
|
/**
|
|
128
128
|
* Initialize Relentless in a project
|
|
129
129
|
*/
|
|
130
|
-
export async function initProject(projectDir: string = process.cwd()): Promise<void> {
|
|
131
|
-
console.log(chalk.bold.blue(
|
|
130
|
+
export async function initProject(projectDir: string = process.cwd(), force: boolean = false): Promise<void> {
|
|
131
|
+
console.log(chalk.bold.blue(`\nš ${force ? "Reinstalling" : "Initializing"} Relentless\n`));
|
|
132
132
|
|
|
133
133
|
// Check installed agents
|
|
134
134
|
console.log(chalk.dim("Detecting installed agents..."));
|
|
@@ -161,13 +161,14 @@ export async function initProject(projectDir: string = process.cwd()): Promise<v
|
|
|
161
161
|
for (const [filename, contentFn] of Object.entries(RELENTLESS_FILES)) {
|
|
162
162
|
const path = join(relentlessDir, filename);
|
|
163
163
|
|
|
164
|
-
if (existsSync(path)) {
|
|
164
|
+
if (existsSync(path) && !force) {
|
|
165
165
|
console.log(` ${chalk.yellow("ā ")} relentless/${filename} already exists, skipping`);
|
|
166
166
|
continue;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
await Bun.write(path, contentFn());
|
|
170
|
-
|
|
170
|
+
const action = existsSync(path) && force ? "updated" : "created";
|
|
171
|
+
console.log(` ${chalk.green("ā")} relentless/${filename} ${force ? `(${action})` : ""}`);
|
|
171
172
|
}
|
|
172
173
|
|
|
173
174
|
// Note: constitution.md is NOT copied - it should be created by /relentless.constitution command
|
|
@@ -208,11 +209,17 @@ export async function initProject(projectDir: string = process.cwd()): Promise<v
|
|
|
208
209
|
const sourcePath = join(sourceSkillsDir, skill);
|
|
209
210
|
const destPath = join(skillsDir, skill);
|
|
210
211
|
|
|
211
|
-
if (existsSync(sourcePath)
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
if (existsSync(sourcePath)) {
|
|
213
|
+
if (existsSync(destPath) && !force) {
|
|
214
|
+
console.log(` ${chalk.yellow("ā ")} .claude/skills/${skill} already exists, skipping`);
|
|
215
|
+
} else {
|
|
216
|
+
if (existsSync(destPath) && force) {
|
|
217
|
+
await Bun.spawn(["rm", "-rf", destPath]).exited;
|
|
218
|
+
}
|
|
219
|
+
await Bun.spawn(["cp", "-r", sourcePath, destPath]).exited;
|
|
220
|
+
const action = force ? "updated" : "created";
|
|
221
|
+
console.log(` ${chalk.green("ā")} .claude/skills/${skill} (${action})`);
|
|
222
|
+
}
|
|
216
223
|
}
|
|
217
224
|
}
|
|
218
225
|
}
|
|
@@ -243,12 +250,15 @@ export async function initProject(projectDir: string = process.cwd()): Promise<v
|
|
|
243
250
|
const sourcePath = join(sourceCommandsDir, command);
|
|
244
251
|
const destPath = join(commandsDir, command);
|
|
245
252
|
|
|
246
|
-
if (existsSync(sourcePath)
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
253
|
+
if (existsSync(sourcePath)) {
|
|
254
|
+
if (existsSync(destPath) && !force) {
|
|
255
|
+
console.log(` ${chalk.yellow("ā ")} .claude/commands/${command} already exists, skipping`);
|
|
256
|
+
} else {
|
|
257
|
+
const content = await Bun.file(sourcePath).text();
|
|
258
|
+
await Bun.write(destPath, content);
|
|
259
|
+
const action = existsSync(destPath) && force ? "updated" : "created";
|
|
260
|
+
console.log(` ${chalk.green("ā")} .claude/commands/${command} (${action})`);
|
|
261
|
+
}
|
|
252
262
|
}
|
|
253
263
|
}
|
|
254
264
|
}
|