@clawtrail/init 1.3.0 → 1.3.2

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.
Files changed (2) hide show
  1. package/dist/index.js +28 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -230,13 +230,18 @@ async function main() {
230
230
  chalk.cyan.bold("\n ClawTrail Agent Skill Installer\n")
231
231
  );
232
232
  const program = new Command();
233
- program.name("clawtrail-init").description("Initialize ClawTrail skill files for AI agents").version("1.3.0").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) => {
233
+ program.name("clawtrail-init").description("Initialize ClawTrail skill files for AI agents").version("1.3.2").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) => {
234
234
  const targetDir = path.resolve(process.cwd(), options.dir);
235
235
  const staging = options.staging;
236
236
  await downloadSkillFiles(targetDir, staging);
237
237
  const hasOpenClaw = await detectOpenClaw();
238
238
  if (hasOpenClaw) {
239
239
  console.log(chalk.cyan(" OpenClaw detected!\n"));
240
+ try {
241
+ await copyToOpenClawSkills(targetDir, staging);
242
+ } catch (copyErr) {
243
+ console.log(chalk.yellow(` Could not copy to OpenClaw workspace: ${copyErr.message}`));
244
+ }
240
245
  }
241
246
  if (options.register && options.interactive) {
242
247
  const hasExistingKey = await checkExistingApiKey();
@@ -260,15 +265,30 @@ async function main() {
260
265
  }
261
266
  if (options.register && options.interactive) {
262
267
  console.log(chalk.cyan("\n Agent Registration (Optional)\n"));
263
- const { shouldRegister } = await inquirer.prompt([
268
+ const { registrationChoice } = await inquirer.prompt([
264
269
  {
265
- type: "confirm",
266
- name: "shouldRegister",
267
- message: "Would you like to register an agent now?",
268
- default: false
270
+ type: "list",
271
+ name: "registrationChoice",
272
+ message: "How would you like to register your agent?",
273
+ choices: [
274
+ { name: "Let my bot register itself (recommended for OpenClaw)", value: "bot" },
275
+ { name: "Enter agent info manually now", value: "manual" },
276
+ { name: "Skip registration", value: "skip" }
277
+ ],
278
+ default: hasOpenClaw ? "bot" : "manual"
269
279
  }
270
280
  ]);
271
- if (shouldRegister) {
281
+ if (registrationChoice === "bot") {
282
+ console.log(chalk.green("\n Got it! Your bot will register itself.\n"));
283
+ console.log(chalk.gray(" Your bot can register using the SKILL.md instructions."));
284
+ console.log(chalk.gray(" It will call POST /api/agents/register with its own info."));
285
+ if (hasOpenClaw) {
286
+ console.log(chalk.gray(" The ClawTrail skill file has been placed in your OpenClaw workspace."));
287
+ console.log(chalk.gray(" Just start your bot \u2014 it will read the skill and register automatically.\n"));
288
+ } else {
289
+ console.log(chalk.gray(" Point your agent at the SKILL.md file to get started.\n"));
290
+ }
291
+ } else if (registrationChoice === "manual") {
272
292
  const answers = await inquirer.prompt([
273
293
  {
274
294
  type: "input",
@@ -307,7 +327,7 @@ async function main() {
307
327
  { name: "A2A Agent", value: "a2a-agent" },
308
328
  { name: "ERC-8004 Agent", value: "erc8004" }
309
329
  ],
310
- default: "openclaw"
330
+ default: hasOpenClaw ? "openclaw" : "custom"
311
331
  },
312
332
  {
313
333
  type: "input",
@@ -364,7 +384,6 @@ async function main() {
364
384
  if (configureOC) {
365
385
  try {
366
386
  await configureOpenClaw(apiKey, staging);
367
- await copyToOpenClawSkills(targetDir, staging);
368
387
  } catch (ocErr) {
369
388
  console.log(chalk.yellow(` OpenClaw config failed: ${ocErr.message}`));
370
389
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawtrail/init",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "CLI installer for ClawTrail AI agent skill files",
5
5
  "main": "dist/index.js",
6
6
  "bin": {