buddydex 0.1.1 → 0.1.3

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/buddydex.js +81 -1
  2. package/package.json +4 -1
package/buddydex.js CHANGED
@@ -400,6 +400,74 @@ function cmdRoll(argv) {
400
400
  console.log();
401
401
  }
402
402
 
403
+ // packages/cli/commands/name.ts
404
+ import { parseArgs as parseArgs4 } from "util";
405
+ function cmdName(argv) {
406
+ const { values: args } = parseArgs4({
407
+ args: argv,
408
+ options: {
409
+ name: { type: "string" },
410
+ personality: { type: "string" }
411
+ }
412
+ });
413
+ const config = readJson(CONFIG_PATH);
414
+ if (!config) {
415
+ console.error(`
416
+ Cannot read ${CONFIG_PATH}
417
+ `);
418
+ process.exit(1);
419
+ }
420
+ printHeader();
421
+ const companion = config.companion ?? {};
422
+ if (!args.name && !args.personality) {
423
+ if (!config.companion) {
424
+ console.log(`
425
+ No companion data found. Launch Claude Code to hatch your buddy first.
426
+ `);
427
+ } else {
428
+ console.log(`
429
+ Name: ${companion.name || "(none)"}`);
430
+ console.log(` Personality: ${companion.personality || "(none)"}
431
+ `);
432
+ }
433
+ return;
434
+ }
435
+ if (args.name)
436
+ companion.name = args.name;
437
+ if (args.personality)
438
+ companion.personality = args.personality;
439
+ config.companion = companion;
440
+ writeConfig(config);
441
+ console.log(`
442
+ Updated companion:`);
443
+ console.log(` Name: ${companion.name || "(none)"}`);
444
+ console.log(` Personality: ${companion.personality || "(none)"}`);
445
+ console.log(`
446
+ Restart Claude Code to see the changes.
447
+ `);
448
+ }
449
+ // packages/cli/package.json
450
+ var package_default = {
451
+ name: "buddydex",
452
+ version: "0.1.3",
453
+ description: "Hunt, browse, and inject Claude Code buddies",
454
+ type: "module",
455
+ bin: {
456
+ buddydex: "dist/buddydex.js"
457
+ },
458
+ files: ["dist"],
459
+ keywords: ["claude", "claude-code", "buddy", "companion", "wyhash"],
460
+ author: "iammatthias",
461
+ license: "MIT",
462
+ repository: {
463
+ type: "git",
464
+ url: "git+https://github.com/iammatthias/buddydex.git"
465
+ },
466
+ dependencies: {
467
+ "@buddy/engine": "workspace:*"
468
+ }
469
+ };
470
+
403
471
  // packages/cli/bin.ts
404
472
  var USAGE = `
405
473
  BuddyDex CLI
@@ -410,6 +478,7 @@ var USAGE = `
410
478
  restore Restore your original UUID from backup
411
479
  show Show your current buddy
412
480
  roll Roll a specific UUID to see its buddy
481
+ name View or set your buddy's name and personality
413
482
 
414
483
  Hunt options:
415
484
  --species <name> Filter by species
@@ -424,19 +493,30 @@ var USAGE = `
424
493
  Inject options:
425
494
  --preview Preview without saving
426
495
 
496
+ Name options:
497
+ --name <name> Set buddy name
498
+ --personality <text> Set buddy personality
499
+
427
500
  Examples:
428
501
  buddydex hunt --species dragon --rarity legendary
429
502
  buddydex hunt --rarity legendary --perfect 70
430
503
  buddydex inject <seed>
431
504
  buddydex show
505
+ buddydex name
506
+ buddydex name --name "Ember" --personality "Chaotic but loyal"
432
507
  `;
433
508
  var [command, ...rest] = process.argv.slice(2);
509
+ if (command === "--version" || command === "-v") {
510
+ console.log(package_default.version);
511
+ process.exit(0);
512
+ }
434
513
  var commands = {
435
514
  hunt: cmdHunt,
436
515
  inject: cmdInject,
437
516
  restore: cmdRestore,
438
517
  show: cmdShow,
439
- roll: cmdRoll
518
+ roll: cmdRoll,
519
+ name: cmdName
440
520
  };
441
521
  if (command && command in commands) {
442
522
  commands[command](rest);
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "buddydex",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Hunt, browse, and inject Claude Code buddies",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "buddydex": "buddydex.js"
8
8
  },
9
+ "files": [
10
+ "dist"
11
+ ],
9
12
  "keywords": [
10
13
  "claude",
11
14
  "claude-code",