@clawtrail/init 1.4.0 → 1.4.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 +21 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -234,52 +234,35 @@ async function findOpenClawSkillsDir() {
|
|
|
234
234
|
}
|
|
235
235
|
async function copyToOpenClawSkills(targetDir, staging) {
|
|
236
236
|
const skillFolder = staging ? "clawtrail-staging" : "clawtrail";
|
|
237
|
+
const workspaceDir = path.join(os.homedir(), ".openclaw", "workspace");
|
|
238
|
+
await ensureDirectory(workspaceDir);
|
|
239
|
+
try {
|
|
240
|
+
await fs.copyFile(path.join(targetDir, "HEARTBEAT.md"), path.join(workspaceDir, "HEARTBEAT.md"));
|
|
241
|
+
console.log(chalk.green(" HEARTBEAT.md -> ") + chalk.cyan("~/.openclaw/workspace/HEARTBEAT.md"));
|
|
242
|
+
} catch {
|
|
243
|
+
}
|
|
237
244
|
const openclawSkillsDir = await findOpenClawSkillsDir();
|
|
238
245
|
if (openclawSkillsDir) {
|
|
239
246
|
const destDir = path.join(openclawSkillsDir, skillFolder);
|
|
240
247
|
await ensureDirectory(destDir);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
for (const { file, dest } of copies) {
|
|
247
|
-
const src = path.join(targetDir, file);
|
|
248
|
-
try {
|
|
249
|
-
await fs.copyFile(src, dest);
|
|
250
|
-
copied++;
|
|
251
|
-
} catch {
|
|
252
|
-
}
|
|
248
|
+
try {
|
|
249
|
+
await fs.copyFile(path.join(targetDir, "SKILL.md"), path.join(destDir, "SKILL.md"));
|
|
250
|
+
const prettyPath = openclawSkillsDir.replace(os.homedir(), "~");
|
|
251
|
+
console.log(chalk.green(" SKILL.md -> ") + chalk.cyan(`${prettyPath}/${skillFolder}/SKILL.md`));
|
|
252
|
+
} catch {
|
|
253
253
|
}
|
|
254
|
-
const prettyPath = openclawSkillsDir.replace(os.homedir(), "~");
|
|
255
|
-
console.log(
|
|
256
|
-
chalk.green(` Installed ${copied} file${copied !== 1 ? "s" : ""} to OpenClaw skills`)
|
|
257
|
-
);
|
|
258
|
-
console.log(chalk.gray(` ${chalk.cyan(`${prettyPath}/${skillFolder}/SKILL.md`)}`));
|
|
259
|
-
console.log(chalk.gray(` ${chalk.cyan(`${prettyPath}/${skillFolder}/HEARTBEAT.md`)}`));
|
|
260
254
|
} else {
|
|
261
|
-
const workspaceDir = path.join(os.homedir(), ".openclaw", "workspace");
|
|
262
255
|
const skillsDir = path.join(workspaceDir, "skills", skillFolder);
|
|
263
|
-
await ensureDirectory(workspaceDir);
|
|
264
256
|
await ensureDirectory(skillsDir);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
await fs.copyFile(src, dest);
|
|
274
|
-
copied++;
|
|
275
|
-
} catch {
|
|
276
|
-
}
|
|
257
|
+
try {
|
|
258
|
+
await fs.copyFile(path.join(targetDir, "SKILL.md"), path.join(skillsDir, "SKILL.md"));
|
|
259
|
+
console.log(
|
|
260
|
+
chalk.yellow(" Could not find OpenClaw global install \u2014 SKILL.md placed in workspace fallback")
|
|
261
|
+
);
|
|
262
|
+
console.log(chalk.gray(` ${chalk.cyan(`~/.openclaw/workspace/skills/${skillFolder}/SKILL.md`)}`));
|
|
263
|
+
console.log(chalk.gray(" You may need to manually copy it to your OpenClaw skills directory."));
|
|
264
|
+
} catch {
|
|
277
265
|
}
|
|
278
|
-
console.log(
|
|
279
|
-
chalk.yellow(` Could not find OpenClaw global install \u2014 placed files in workspace fallback`)
|
|
280
|
-
);
|
|
281
|
-
console.log(chalk.gray(` ${chalk.cyan(`~/.openclaw/workspace/skills/${skillFolder}/`)}`));
|
|
282
|
-
console.log(chalk.gray(` You may need to manually copy SKILL.md to your OpenClaw skills directory.`));
|
|
283
266
|
}
|
|
284
267
|
}
|
|
285
268
|
async function main() {
|
|
@@ -287,7 +270,7 @@ async function main() {
|
|
|
287
270
|
chalk.cyan.bold("\n ClawTrail Agent Skill Installer\n")
|
|
288
271
|
);
|
|
289
272
|
const program = new Command();
|
|
290
|
-
program.name("clawtrail-init").description("Initialize ClawTrail skill files for AI agents").version("1.4.
|
|
273
|
+
program.name("clawtrail-init").description("Initialize ClawTrail skill files for AI agents").version("1.4.1").option("-d, --dir <path>", "Target directory", "./clawtrail-skills").option("-s, --staging", "Use staging environment", false).option("--no-register", "Skip agent registration").option("--no-interactive", "Skip interactive prompts").action(async (options) => {
|
|
291
274
|
const targetDir = path.resolve(process.cwd(), options.dir);
|
|
292
275
|
const staging = options.staging;
|
|
293
276
|
await downloadSkillFiles(targetDir, staging);
|