lism-cli 0.0.1 → 0.3.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/dist/index.js CHANGED
@@ -9,8 +9,11 @@ import {
9
9
  UI_HELPER_PATH,
10
10
  UI_REGISTRY_INDEX_PATH,
11
11
  createCommand,
12
- logger
13
- } from "./chunk-4TQG5MGT.js";
12
+ logger,
13
+ preScanLang,
14
+ setLang,
15
+ t
16
+ } from "./chunk-5ULZ7QME.js";
14
17
 
15
18
  // src/createProgram.ts
16
19
  import { Command as Command3 } from "commander";
@@ -51,10 +54,10 @@ function getDefaultConfigPath() {
51
54
  async function readConfig() {
52
55
  const found = findConfigFile();
53
56
  if (!found) {
54
- throw new Error("lism.config.js / lism.config.mjs / lism-ui.json \u306E\u3044\u305A\u308C\u3082\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002");
57
+ throw new Error(t("config.notFound"));
55
58
  }
56
59
  if (found.kind === "legacy-json") {
57
- logger.warn(`[deprecated] ${LEGACY_CONFIG_FILE} \u306F\u5EC3\u6B62\u4E88\u5B9A\u3067\u3059\u3002"lism ui init" \u3067 lism.config.js \u3078\u79FB\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
60
+ logger.warn(t("config.legacyWarning", { filename: LEGACY_CONFIG_FILE }));
58
61
  const raw = fs.readFileSync(found.path, "utf-8");
59
62
  const parsed = JSON.parse(raw);
60
63
  return parsed;
@@ -63,7 +66,7 @@ async function readConfig() {
63
66
  const mod = await jiti.import(found.path);
64
67
  const cli = mod?.cli ?? mod;
65
68
  if (!cli || typeof cli !== "object") {
66
- throw new Error(`${found.filename} \u304B\u3089 CLI \u8A2D\u5B9A\uFF08cli \u30AD\u30FC\uFF09\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002`);
69
+ throw new Error(t("config.cliSectionMissing", { filename: found.filename }));
67
70
  }
68
71
  validateCliConfig(cli);
69
72
  return cli;
@@ -71,13 +74,13 @@ async function readConfig() {
71
74
  function validateCliConfig(cli) {
72
75
  const c = cli;
73
76
  if (c.framework !== "react" && c.framework !== "astro") {
74
- throw new Error(`cli.framework \u306F "react" \u307E\u305F\u306F "astro" \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
77
+ throw new Error(t("config.invalidFramework"));
75
78
  }
76
79
  if (typeof c.componentsDir !== "string" || !c.componentsDir) {
77
- throw new Error("cli.componentsDir \u306F\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
80
+ throw new Error(t("config.invalidComponentsDir"));
78
81
  }
79
82
  if (typeof c.helperDir !== "string" || !c.helperDir) {
80
- throw new Error("cli.helperDir \u306F\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
83
+ throw new Error(t("config.invalidHelperDir"));
81
84
  }
82
85
  }
83
86
  function writeFreshConfig(cli) {
@@ -92,7 +95,7 @@ async function hasCliSection(filePath) {
92
95
  const mod = await jiti.import(filePath);
93
96
  return !!mod?.cli;
94
97
  } catch (err) {
95
- throw new Error(`${filePath} \u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\uFF08\u69CB\u6587\u30A8\u30E9\u30FC\u7B49\uFF09\u3002\u4FEE\u6B63\u3057\u3066\u304B\u3089\u518D\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044: ${String(err)}`);
98
+ throw new Error(t("config.loadFailed", { path: filePath, reason: String(err) }));
96
99
  }
97
100
  }
98
101
  async function patchConfigWithCli(cli, targetPath, options = {}) {
@@ -361,18 +364,18 @@ async function fetchHelper(name, options = {}) {
361
364
  import { select, input } from "@inquirer/prompts";
362
365
  async function runInit(options = {}) {
363
366
  const framework = options.framework ?? await select({
364
- message: "\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044:",
367
+ message: t("ui.init.promptFramework"),
365
368
  choices: [
366
369
  { name: "React", value: "react" },
367
370
  { name: "Astro", value: "astro" }
368
371
  ]
369
372
  });
370
373
  const componentsDir = options.componentsDir ?? await input({
371
- message: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA:",
374
+ message: t("ui.init.promptComponentsDir"),
372
375
  default: "src/components/ui"
373
376
  });
374
377
  const helperDir = options.helperDir ?? await input({
375
- message: "helper \u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA:",
378
+ message: t("ui.init.promptHelperDir"),
376
379
  default: `${componentsDir}/_helper`
377
380
  });
378
381
  const config = { framework, componentsDir, helperDir };
@@ -383,13 +386,13 @@ async function runInit(options = {}) {
383
386
  existingCli: options.existingCli
384
387
  });
385
388
  if (patched) {
386
- logger.success(`${outPath} \u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092${options.force ? "\u66F4\u65B0" : "\u8FFD\u8A18"}\u3057\u307E\u3057\u305F\u3002`);
389
+ logger.success(t(options.force ? "ui.init.patchedUpdate" : "ui.init.patchedAdd", { path: outPath }));
387
390
  } else {
388
- logger.warn(`${outPath} \u306B\u65E2\u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u542B\u307E\u308C\u3066\u3044\u308B\u304B\u3001export default \u304C\u691C\u51FA\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u624B\u52D5\u3067\u8FFD\u8A18\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
391
+ logger.warn(t("ui.init.notPatched", { path: outPath }));
389
392
  }
390
393
  } else {
391
394
  const outPath = writeFreshConfig(config);
392
- logger.success(`${outPath} \u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\u3002`);
395
+ logger.success(t("ui.init.created", { path: outPath }));
393
396
  }
394
397
  return config;
395
398
  }
@@ -397,7 +400,7 @@ async function initCommand(options) {
397
400
  const found = findConfigFile();
398
401
  let existingCli = false;
399
402
  if (found?.kind === "legacy-json") {
400
- logger.warn(`${found.filename} \u3092\u691C\u51FA\u3057\u307E\u3057\u305F\u3002lism.config.js \u3078\u79FB\u884C\u3057\u307E\u3059\u3002\u53E4\u3044\u30D5\u30A1\u30A4\u30EB\u306F\u5F8C\u3067\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
403
+ logger.warn(t("ui.init.legacyDetected", { filename: found.filename }));
401
404
  } else if (found?.kind === "module") {
402
405
  try {
403
406
  existingCli = await hasCliSection(found.path);
@@ -407,10 +410,10 @@ async function initCommand(options) {
407
410
  }
408
411
  if (existingCli) {
409
412
  if (!options.force) {
410
- logger.warn(`${found.filename} \u306B\u306F\u65E2\u306B cli \u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3059\u308B\u306B\u306F --force \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);
413
+ logger.warn(t("ui.init.alreadyExists", { filename: found.filename }));
411
414
  return;
412
415
  }
413
- logger.warn(`${found.filename} \u306E\u65E2\u5B58\u306E cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u3002`);
416
+ logger.warn(t("ui.init.willOverwrite", { filename: found.filename }));
414
417
  }
415
418
  }
416
419
  await runInit({ ...options, existingCli });
@@ -425,7 +428,7 @@ async function addCommand(names, options) {
425
428
  if (configExists()) {
426
429
  config = await readConfig();
427
430
  } else {
428
- logger.info("lism.config.js \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u958B\u59CB\u3057\u307E\u3059...\n");
431
+ logger.info(t("ui.add.noConfig"));
429
432
  config = await runInit();
430
433
  console.log();
431
434
  }
@@ -436,15 +439,15 @@ async function addCommand(names, options) {
436
439
  } catch (err) {
437
440
  const refInfo = options.ref ? ` (ref: ${options.ref})` : "";
438
441
  const reason = err instanceof Error ? err.message : String(err);
439
- logger.error(`\u30AB\u30BF\u30ED\u30B0\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F${refInfo}: ${reason}`);
442
+ logger.error(t("ui.catalogFailed", { refInfo, reason }));
440
443
  process.exit(1);
441
444
  }
442
445
  if (options.all) {
443
446
  names = catalog.components.map((c) => c.name);
444
- logger.info(`\u5168 ${names.length} \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8FFD\u52A0\u3057\u307E\u3059...`);
447
+ logger.info(t("ui.add.addingAll", { count: names.length }));
445
448
  }
446
449
  if (names.length === 0) {
447
- logger.error("\u8FFD\u52A0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
450
+ logger.error(t("ui.add.specifyName"));
448
451
  process.exit(1);
449
452
  }
450
453
  const resolvedNames = [];
@@ -456,7 +459,7 @@ async function addCommand(names, options) {
456
459
  else notFound.push(input2);
457
460
  }
458
461
  if (notFound.length > 0) {
459
- logger.error(`\u898B\u3064\u304B\u3089\u306A\u3044\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8: ${notFound.join(", ")}`);
462
+ logger.error(t("ui.add.notFound", { list: notFound.join(", ") }));
460
463
  process.exit(1);
461
464
  }
462
465
  const excludeRootFiles = new Set(catalog.excludeComponentFiles);
@@ -471,7 +474,7 @@ async function addCommand(names, options) {
471
474
  for (let i = 0; i < resolvedNames.length; i++) {
472
475
  const result = results[i];
473
476
  if (result.status === "rejected") {
474
- logger.error(`"${resolvedNames[i]}" \u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${String(result.reason)}`);
477
+ logger.error(t("ui.add.componentFetchFailed", { name: resolvedNames[i], reason: String(result.reason) }));
475
478
  hasFailure = true;
476
479
  continue;
477
480
  }
@@ -479,31 +482,31 @@ async function addCommand(names, options) {
479
482
  if (helperFailed) hasFailure = true;
480
483
  }
481
484
  if (hasFailure) {
482
- logger.error("\u4E00\u90E8\u306E\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 / helper \u306E\u8FFD\u52A0\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002");
485
+ logger.error(t("ui.add.someFailed"));
483
486
  process.exit(1);
484
487
  }
485
- logger.success("\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002");
488
+ logger.success(t("common.done"));
486
489
  }
487
490
  async function askOverwritePolicy() {
488
491
  return select2({
489
- message: "\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u306E\u4E0A\u66F8\u304D\u65B9\u91DD\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044:",
492
+ message: t("ui.add.promptOverwritePolicy"),
490
493
  choices: [
491
- { name: "\u5168\u3066\u4E0A\u66F8\u304D", value: "all" },
492
- { name: "\u5168\u3066\u30B9\u30AD\u30C3\u30D7", value: "none" },
493
- { name: "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3054\u3068\u306B\u78BA\u8A8D", value: "per-component" }
494
+ { name: t("ui.add.policyAll"), value: "all" },
495
+ { name: t("ui.add.policyNone"), value: "none" },
496
+ { name: t("ui.add.policyPerComponent"), value: "per-component" }
494
497
  ]
495
498
  });
496
499
  }
497
500
  function writeFile(filePath, content) {
498
501
  fs3.mkdirSync(path4.dirname(filePath), { recursive: true });
499
502
  fs3.writeFileSync(filePath, content);
500
- logger.log(` \u4F5C\u6210: ${path4.relative(process.cwd(), filePath)}`);
503
+ logger.log(t("ui.add.created", { path: path4.relative(process.cwd(), filePath) }));
501
504
  }
502
505
  function hasExistingFiles(files, baseDir) {
503
506
  return files.some((f) => fs3.existsSync(path4.join(baseDir, f.path)));
504
507
  }
505
508
  async function writeComponent(component, config, overwriteAll, policy, installedHelpers, fetchOpts) {
506
- logger.info(`${component.name} \u3092\u5C55\u958B\u4E2D...`);
509
+ logger.info(t("ui.add.deploying", { name: component.name }));
507
510
  const filesToWrite = [...component.files.shared, ...component.files[config.framework]];
508
511
  const componentDirName = component.name;
509
512
  const componentDir = path4.resolve(process.cwd(), config.componentsDir, componentDirName);
@@ -518,14 +521,14 @@ async function writeComponent(component, config, overwriteAll, policy, installed
518
521
  shouldWrite = false;
519
522
  } else if (policy === "per-component") {
520
523
  shouldWrite = await confirm({
521
- message: `${componentDirName} \u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F`,
524
+ message: t("ui.add.confirmOverwriteComponent", { name: componentDirName }),
522
525
  default: false
523
526
  });
524
527
  } else {
525
528
  shouldWrite = true;
526
529
  }
527
530
  if (!shouldWrite) {
528
- logger.log(` \u30B9\u30AD\u30C3\u30D7: ${componentDirName}`);
531
+ logger.log(t("ui.add.skippedComponent", { name: componentDirName }));
529
532
  } else {
530
533
  for (const file of filesToWrite) {
531
534
  const filePath = path4.join(componentDir, file.path);
@@ -541,7 +544,7 @@ async function writeComponent(component, config, overwriteAll, policy, installed
541
544
  for (let i = 0; i < helpersToInstall.length; i++) {
542
545
  const result = helperResults[i];
543
546
  if (result.status === "rejected") {
544
- logger.error(` helper "${helpersToInstall[i]}" \u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${String(result.reason)}`);
547
+ logger.error(t("ui.add.helperFetchFailed", { name: helpersToInstall[i], reason: String(result.reason) }));
545
548
  helperFailed = true;
546
549
  continue;
547
550
  }
@@ -549,16 +552,16 @@ async function writeComponent(component, config, overwriteAll, policy, installed
549
552
  const filePath = path4.join(helperDir, file.path);
550
553
  if (fs3.existsSync(filePath) && !overwriteAll) {
551
554
  if (policy === "none") {
552
- logger.log(` \u30B9\u30AD\u30C3\u30D7: ${file.path}`);
555
+ logger.log(t("ui.add.skippedFile", { path: file.path }));
553
556
  continue;
554
557
  }
555
558
  if (policy === "per-component") {
556
559
  const shouldOverwrite = await confirm({
557
- message: `${path4.relative(process.cwd(), filePath)} \u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F`,
560
+ message: t("ui.add.confirmOverwriteFile", { path: path4.relative(process.cwd(), filePath) }),
558
561
  default: false
559
562
  });
560
563
  if (!shouldOverwrite) {
561
- logger.log(` \u30B9\u30AD\u30C3\u30D7: ${file.path}`);
564
+ logger.log(t("ui.add.skippedFile", { path: file.path }));
562
565
  continue;
563
566
  }
564
567
  }
@@ -572,7 +575,7 @@ async function writeComponent(component, config, overwriteAll, policy, installed
572
575
 
573
576
  // src/commands/ui/list.ts
574
577
  async function listCommand(options = {}) {
575
- logger.info("\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u4E2D...");
578
+ logger.info(t("ui.list.fetching"));
576
579
  const fetchOpts = { ref: options.ref };
577
580
  let catalog;
578
581
  try {
@@ -580,27 +583,27 @@ async function listCommand(options = {}) {
580
583
  } catch (err) {
581
584
  const refInfo = options.ref ? ` (ref: ${options.ref})` : "";
582
585
  const reason = err instanceof Error ? err.message : String(err);
583
- logger.error(`\u30AB\u30BF\u30ED\u30B0\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F${refInfo}: ${reason}`);
586
+ logger.error(t("ui.catalogFailed", { refInfo, reason }));
584
587
  process.exit(1);
585
588
  }
586
589
  logger.log(`
587
590
  Lism UI v${catalog.version}
588
591
  `);
589
- logger.log("\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8:");
592
+ logger.log(t("ui.list.header"));
590
593
  for (const component of catalog.components) {
591
594
  const helpers = component.helpers.length > 0 ? ` (helpers: ${component.helpers.join(", ")})` : "";
592
595
  logger.log(` - ${component.name}${helpers}`);
593
596
  }
594
597
  logger.log(`
595
- \u5408\u8A08: ${catalog.components.length} \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8`);
598
+ ${t("ui.list.total", { count: catalog.components.length })}`);
596
599
  }
597
600
 
598
601
  // src/commands/ui/index.ts
599
602
  function createUiCommand() {
600
- const ui = new Command("ui").description("Lism UI \u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u8FFD\u52A0\u30FB\u7BA1\u7406");
601
- ui.command("init").description("lism.config.js \u306E cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u751F\u6210\u3059\u308B").addOption(new Option("--framework <name>", "\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF").choices(["react", "astro"])).option("--components-dir <path>", "\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA").option("--helper-dir <path>", "helper \u306E\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA").option("-f, --force", "\u65E2\u5B58\u306E cli \u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u4E0A\u66F8\u304D", false).action(initCommand);
602
- ui.command("add").description("\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8FFD\u52A0\u3059\u308B").argument("[names...]", "\u8FFD\u52A0\u3059\u308B\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u540D").option("-o, --overwrite", "\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u78BA\u8A8D\u306A\u3057\u3067\u4E0A\u66F8\u304D", false).option("-a, --all", "\u5168\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u3092\u8FFD\u52A0", false).option("--ref <ref>", "\u53D6\u5F97\u5143\u306E Git ref\uFF08\u30D6\u30E9\u30F3\u30C1 / \u30BF\u30B0 / \u30B3\u30DF\u30C3\u30C8\uFF09").action(addCommand);
603
- ui.command("list").description("\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8\u4E00\u89A7\u3092\u8868\u793A\u3059\u308B").option("--ref <ref>", "\u53D6\u5F97\u5143\u306E Git ref\uFF08\u30D6\u30E9\u30F3\u30C1 / \u30BF\u30B0 / \u30B3\u30DF\u30C3\u30C8\uFF09").action(listCommand);
603
+ const ui = new Command("ui").description(t("cli.ui.description"));
604
+ ui.command("init").description(t("cli.ui.init.description")).addOption(new Option("--framework <name>", t("cli.ui.init.opt.framework")).choices(["react", "astro"])).option("--components-dir <path>", t("cli.ui.init.opt.componentsDir")).option("--helper-dir <path>", t("cli.ui.init.opt.helperDir")).option("-f, --force", t("cli.ui.init.opt.force"), false).action(initCommand);
605
+ ui.command("add").description(t("cli.ui.add.description")).argument("[names...]", t("cli.ui.add.arg.names")).option("-o, --overwrite", t("cli.ui.add.opt.overwrite"), false).option("-a, --all", t("cli.ui.add.opt.all"), false).option("--ref <ref>", t("cli.ui.opt.ref")).action(addCommand);
606
+ ui.command("list").description(t("cli.ui.list.description")).option("--ref <ref>", t("cli.ui.opt.ref")).action(listCommand);
604
607
  return ui;
605
608
  }
606
609
 
@@ -717,7 +720,7 @@ function copyDirRecursive(src, dest) {
717
720
  // src/commands/skill/add.ts
718
721
  function resolveExplicitTools(options) {
719
722
  if (options.all) return [...ALL_SKILL_TOOLS];
720
- const explicit = ALL_SKILL_TOOLS.filter((t) => options[t]);
723
+ const explicit = ALL_SKILL_TOOLS.filter((t2) => options[t2]);
721
724
  return explicit;
722
725
  }
723
726
  function autoDetectTools(cwd) {
@@ -729,29 +732,29 @@ async function skillAddCommand(options) {
729
732
  if (targets.length === 0) {
730
733
  const detected = autoDetectTools(cwd);
731
734
  if (detected.length > 0) {
732
- logger.info(`\u691C\u51FA\u3057\u305F AI \u30C4\u30FC\u30EB: ${detected.join(", ")}`);
735
+ logger.info(t("skill.add.detected", { list: detected.join(", ") }));
733
736
  }
734
737
  targets = await checkbox({
735
- message: "\u914D\u7F6E\u5148\u306E\u30C4\u30FC\u30EB\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30B9\u30DA\u30FC\u30B9\u3067\u9078\u629E\u3001Enter \u3067\u78BA\u5B9A\uFF09:",
736
- choices: ALL_SKILL_TOOLS.map((t) => ({
737
- name: `${t} \u2192 ${SKILL_PATHS[t]}`,
738
- value: t,
739
- checked: detected.includes(t)
738
+ message: t("skill.add.promptTools"),
739
+ choices: ALL_SKILL_TOOLS.map((tool) => ({
740
+ name: `${tool} \u2192 ${SKILL_PATHS[tool]}`,
741
+ value: tool,
742
+ checked: detected.includes(tool)
740
743
  }))
741
744
  });
742
745
  }
743
746
  if (targets.length === 0) {
744
- logger.warn("\u914D\u7F6E\u5148\u304C\u9078\u629E\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002");
747
+ logger.warn(t("skill.add.noTargets"));
745
748
  return;
746
749
  }
747
750
  const ref = options.ref ?? DEFAULT_SKILL_REF;
748
- logger.info(`\u30B9\u30AD\u30EB\u3092\u53D6\u5F97\u4E2D\uFF08ref: ${ref}\uFF09...`);
751
+ logger.info(t("skill.add.fetching", { ref }));
749
752
  const { dir: srcDir } = await fetchSkillSource(ref);
750
753
  try {
751
754
  for (const tool of targets) {
752
755
  await deploySkillTo(srcDir, tool, options);
753
756
  }
754
- logger.success("\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002");
757
+ logger.success(t("common.done"));
755
758
  } finally {
756
759
  cleanupTempDir(srcDir);
757
760
  }
@@ -763,29 +766,29 @@ async function deploySkillTo(srcDir, tool, options) {
763
766
  const diff = compareSkillDirs(destDir, srcDir);
764
767
  const label = `${tool} (${SKILL_PATHS[tool]})`;
765
768
  if (!hasDiff(diff)) {
766
- logger.log(` \u30B9\u30AD\u30C3\u30D7\uFF08\u5DEE\u5206\u306A\u3057\uFF09: ${label}`);
769
+ logger.log(t("skill.add.skippedSame", { label }));
767
770
  return;
768
771
  }
769
772
  logger.log("");
770
- logger.log(` ${label} \u306B\u5DEE\u5206\u304C\u3042\u308A\u307E\u3059:`);
771
- if (diff.modified.length > 0) logger.log(` \u5909\u66F4: ${diff.modified.length} \u30D5\u30A1\u30A4\u30EB`);
772
- if (diff.added.length > 0) logger.log(` \u8FFD\u52A0: ${diff.added.length} \u30D5\u30A1\u30A4\u30EB`);
773
+ logger.log(t("skill.add.hasDiff", { label }));
774
+ if (diff.modified.length > 0) logger.log(t("skill.add.modifiedFiles", { count: diff.modified.length }));
775
+ if (diff.added.length > 0) logger.log(t("skill.add.addedFiles", { count: diff.added.length }));
773
776
  if (diff.localOnly.length > 0) {
774
- logger.log(` \u524A\u9664: ${diff.localOnly.length} \u30D5\u30A1\u30A4\u30EB\uFF08\u30ED\u30FC\u30AB\u30EB\u306E\u307F\u306B\u5B58\u5728\u3001\u4E0A\u66F8\u304D\u6642\u306B\u524A\u9664\u3055\u308C\u307E\u3059\uFF09`);
777
+ logger.log(t("skill.add.localOnlyFiles", { count: diff.localOnly.length }));
775
778
  for (const rel of diff.localOnly) logger.log(` - ${rel}`);
776
779
  }
777
780
  const go = await confirm2({
778
- message: `${SKILL_PATHS[tool]} \u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F`,
781
+ message: t("skill.add.confirmOverwrite", { path: SKILL_PATHS[tool] }),
779
782
  default: false
780
783
  });
781
784
  if (!go) {
782
- logger.log(` \u30B9\u30AD\u30C3\u30D7: ${tool}`);
785
+ logger.log(t("skill.add.skippedTool", { tool }));
783
786
  return;
784
787
  }
785
788
  }
786
789
  if (existing) fs5.rmSync(destDir, { recursive: true, force: true });
787
790
  copyDirRecursive(srcDir, destDir);
788
- logger.log(` \u914D\u7F6E: ${tool} \u2192 ${path6.relative(process.cwd(), destDir)}`);
791
+ logger.log(t("skill.add.deployed", { tool, path: path6.relative(process.cwd(), destDir) }));
789
792
  }
790
793
 
791
794
  // src/commands/skill/check.ts
@@ -795,11 +798,11 @@ async function skillCheckCommand(options = {}) {
795
798
  const cwd = process.cwd();
796
799
  const installed = ALL_SKILL_TOOLS.filter((tool) => fs6.existsSync(path7.join(cwd, SKILL_PATHS[tool], "SKILL.md")));
797
800
  if (installed.length === 0) {
798
- logger.info("\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u6E08\u307F\u306E\u30B9\u30AD\u30EB\u306F\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002`lism skill add` \u3067\u914D\u7F6E\u3067\u304D\u307E\u3059\u3002");
801
+ logger.info(t("skill.check.noneInstalled"));
799
802
  return;
800
803
  }
801
804
  const ref = options.ref ?? DEFAULT_SKILL_REF;
802
- logger.info(`\u30EA\u30E2\u30FC\u30C8\u30B9\u30AD\u30EB\u3092\u53D6\u5F97\u4E2D\uFF08ref: ${ref}\uFF09...`);
805
+ logger.info(t("skill.check.fetching", { ref }));
803
806
  const { dir: remoteDir } = await fetchSkillSource(ref);
804
807
  try {
805
808
  let outdatedCount = 0;
@@ -808,7 +811,7 @@ async function skillCheckCommand(options = {}) {
808
811
  const diff = compareSkillDirs(localDir, remoteDir);
809
812
  const label = `${tool.padEnd(9)} ${SKILL_PATHS[tool]}`;
810
813
  if (!hasDiff(diff)) {
811
- logger.log(` \u2713 ${label} (\u6700\u65B0)`);
814
+ logger.log(t("skill.check.upToDate", { label }));
812
815
  continue;
813
816
  }
814
817
  outdatedCount += 1;
@@ -818,9 +821,9 @@ async function skillCheckCommand(options = {}) {
818
821
  }
819
822
  logger.log("");
820
823
  if (outdatedCount === 0) {
821
- logger.success("\u3059\u3079\u3066\u306E\u30B9\u30AD\u30EB\u304C\u6700\u65B0\u3067\u3059\u3002");
824
+ logger.success(t("skill.check.allLatest"));
822
825
  } else {
823
- logger.info(`${outdatedCount} \u4EF6\u306E\u30C4\u30FC\u30EB\u306B\u5DEE\u5206\u304C\u3042\u308A\u307E\u3059\u3002\`lism skill update\` \u3067\u6700\u65B0\u306B\u66F4\u65B0\u3067\u304D\u307E\u3059\u3002`);
826
+ logger.info(t("skill.check.outdated", { count: outdatedCount }));
824
827
  }
825
828
  } finally {
826
829
  cleanupTempDir(remoteDir);
@@ -828,9 +831,9 @@ async function skillCheckCommand(options = {}) {
828
831
  }
829
832
  function formatDiffSummary(diff) {
830
833
  const parts = [];
831
- if (diff.modified.length > 0) parts.push(`\u5909\u66F4 ${diff.modified.length}`);
832
- if (diff.added.length > 0) parts.push(`\u8FFD\u52A0 ${diff.added.length}`);
833
- if (diff.localOnly.length > 0) parts.push(`\u524A\u9664 ${diff.localOnly.length}`);
834
+ if (diff.modified.length > 0) parts.push(t("skill.check.diffModified", { count: diff.modified.length }));
835
+ if (diff.added.length > 0) parts.push(t("skill.check.diffAdded", { count: diff.added.length }));
836
+ if (diff.localOnly.length > 0) parts.push(t("skill.check.diffDeleted", { count: diff.localOnly.length }));
834
837
  return ` ${parts.join(" / ")}`;
835
838
  }
836
839
  function formatDiffDetails(diff) {
@@ -848,28 +851,35 @@ async function skillUpdateCommand(options) {
848
851
 
849
852
  // src/commands/skill/index.ts
850
853
  function createSkillCommand() {
851
- const skill = new Command2("skill").description("AI \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u5411\u3051\u30B9\u30AD\u30EB\uFF08SKILL.md\uFF09\u306E\u914D\u7F6E\u3068\u7BA1\u7406");
852
- const toolFlags = (cmd) => cmd.option("--all", "\u5168\u30C4\u30FC\u30EB\u306B\u914D\u7F6E").option("--claude", ".claude/skills/ \u306B\u914D\u7F6E").option("--codex", ".agents/skills/ \u306B\u914D\u7F6E").option("--cursor", ".cursor/skills/ \u306B\u914D\u7F6E").option("--windsurf", ".windsurf/skills/ \u306B\u914D\u7F6E").option("--cline", ".cline/skills/ \u306B\u914D\u7F6E").option("--copilot", ".github/skills/ \u306B\u914D\u7F6E").option("--gemini", ".gemini/skills/ \u306B\u914D\u7F6E").option("--junie", ".junie/skills/ \u306B\u914D\u7F6E");
854
+ const skill = new Command2("skill").description(t("cli.skill.description"));
855
+ const toolOptDescription = (tool) => t("cli.skill.opt.toolPath", { path: SKILL_PATHS[tool] });
856
+ const toolFlags = (cmd) => cmd.option("--all", t("cli.skill.opt.all")).option("--claude", toolOptDescription("claude")).option("--codex", toolOptDescription("codex")).option("--cursor", toolOptDescription("cursor")).option("--windsurf", toolOptDescription("windsurf")).option("--cline", toolOptDescription("cline")).option("--copilot", toolOptDescription("copilot")).option("--gemini", toolOptDescription("gemini")).option("--junie", toolOptDescription("junie"));
853
857
  toolFlags(
854
- skill.command("add").description("\u30B9\u30AD\u30EB\u3092\u914D\u7F6E\u3059\u308B").option("-o, --overwrite", "\u78BA\u8A8D\u306A\u3057\u3067\u4E0A\u66F8\u304D", false).option("--ref <ref>", "GitHub \u306E\u53D6\u5F97\u5143 ref\uFF08\u30D6\u30E9\u30F3\u30C1\uFF0F\u30BF\u30B0\uFF0F\u30B3\u30DF\u30C3\u30C8\uFF09")
858
+ skill.command("add").description(t("cli.skill.add.description")).option("-o, --overwrite", t("cli.skill.add.opt.overwrite"), false).option("--ref <ref>", t("cli.skill.opt.ref"))
855
859
  ).action(skillAddCommand);
856
- skill.command("check").description("\u914D\u7F6E\u6E08\u307F\u30B9\u30AD\u30EB\u3068\u30EA\u30E2\u30FC\u30C8\u306E\u5DEE\u5206\u3092\u78BA\u8A8D\u3059\u308B").option("--ref <ref>", "GitHub \u306E\u53D6\u5F97\u5143 ref\uFF08\u30D6\u30E9\u30F3\u30C1\uFF0F\u30BF\u30B0\uFF0F\u30B3\u30DF\u30C3\u30C8\uFF09").option("-v, --verbose", "\u30D5\u30A1\u30A4\u30EB\u5358\u4F4D\u306E\u5DEE\u5206\u3092\u8868\u793A").action(skillCheckCommand);
857
- toolFlags(
858
- skill.command("update").description("\u914D\u7F6E\u6E08\u307F\u30B9\u30AD\u30EB\u3092\u6700\u65B0\u7248\u3067\u4E0A\u66F8\u304D\u3059\u308B\uFF08--overwrite \u540C\u7B49\uFF09").option("--ref <ref>", "GitHub \u306E\u53D6\u5F97\u5143 ref\uFF08\u30D6\u30E9\u30F3\u30C1\uFF0F\u30BF\u30B0\uFF0F\u30B3\u30DF\u30C3\u30C8\uFF09")
859
- ).action(skillUpdateCommand);
860
+ skill.command("check").description(t("cli.skill.check.description")).option("--ref <ref>", t("cli.skill.opt.ref")).option("-v, --verbose", t("cli.skill.check.opt.verbose")).action(skillCheckCommand);
861
+ toolFlags(skill.command("update").description(t("cli.skill.update.description")).option("--ref <ref>", t("cli.skill.opt.ref"))).action(
862
+ skillUpdateCommand
863
+ );
860
864
  return skill;
861
865
  }
862
866
 
863
867
  // src/createProgram.ts
864
868
  function createLismProgram() {
865
869
  const program2 = new Command3();
866
- program2.name("lism").description("Lism CSS / UI \u5411\u3051 CLI").version(CLI_VERSION);
867
- program2.command("create").description("examples \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304B\u3089\u65B0\u898F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u751F\u6210\u3059\u308B").argument("[targetDir]", "\u51FA\u529B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA").option("-t, --template <name>", "\u4F7F\u7528\u3059\u308B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u540D\uFF08\u4F8B: astro-minimal\uFF09").option("-f, --force", "\u65E2\u5B58\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5F37\u5236\u4E0A\u66F8\u304D", false).action(createCommand);
870
+ program2.name("lism").description(t("cli.description")).version(CLI_VERSION).option("--lang <code>", t("cli.opt.lang"));
871
+ program2.hook("preAction", (thisCommand) => {
872
+ const opts = thisCommand.optsWithGlobals();
873
+ const lang = opts.lang;
874
+ if (typeof lang === "string") setLang(lang);
875
+ });
876
+ program2.command("create").description(t("cli.create.description")).argument("[targetDir]", t("cli.create.arg.targetDir")).option("-t, --template <name>", t("cli.create.opt.template")).option("-f, --force", t("cli.create.opt.force"), false).action(createCommand);
868
877
  program2.addCommand(createUiCommand());
869
878
  program2.addCommand(createSkillCommand());
870
879
  return program2;
871
880
  }
872
881
 
873
882
  // src/index.ts
883
+ preScanLang(process.argv.slice(2));
874
884
  var program = createLismProgram();
875
885
  program.parse();