@wbern/claude-instructions 1.13.0 → 1.14.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.
Files changed (2) hide show
  1. package/bin/cli.js +91 -73
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -722,6 +722,88 @@ ${allowedToolsYaml}
722
722
  };
723
723
  }
724
724
 
725
+ // scripts/cli-options.ts
726
+ init_esm_shims();
727
+ var CLI_OPTIONS = [
728
+ {
729
+ flag: "--variant",
730
+ key: "variant",
731
+ type: "string",
732
+ description: "Command variant (with-beads, without-beads)",
733
+ example: "--variant=with-beads",
734
+ requiredForNonInteractive: true
735
+ },
736
+ {
737
+ flag: "--scope",
738
+ key: "scope",
739
+ type: "string",
740
+ description: "Installation scope (project, user)",
741
+ example: "--scope=project",
742
+ requiredForNonInteractive: true
743
+ },
744
+ {
745
+ flag: "--prefix",
746
+ key: "prefix",
747
+ type: "string",
748
+ description: "Add prefix to command names",
749
+ example: "--prefix=my-",
750
+ requiredForNonInteractive: true
751
+ },
752
+ {
753
+ flag: "--commands",
754
+ key: "commands",
755
+ type: "array",
756
+ description: "Install only specific commands",
757
+ example: "--commands=commit,red,green"
758
+ },
759
+ {
760
+ flag: "--skip-template-injection",
761
+ key: "skipTemplateInjection",
762
+ type: "boolean",
763
+ description: "Skip injecting project CLAUDE.md customizations"
764
+ },
765
+ {
766
+ flag: "--update-existing",
767
+ key: "updateExisting",
768
+ type: "boolean",
769
+ description: "Only update already-installed commands"
770
+ },
771
+ {
772
+ flag: "--overwrite",
773
+ key: "overwrite",
774
+ type: "boolean",
775
+ description: "Overwrite conflicting files without prompting"
776
+ },
777
+ {
778
+ flag: "--skip-on-conflict",
779
+ key: "skipOnConflict",
780
+ type: "boolean",
781
+ description: "Skip conflicting files without prompting"
782
+ }
783
+ ];
784
+ function generateHelpText() {
785
+ const lines = [
786
+ "Usage: npx @wbern/claude-instructions [options]",
787
+ "",
788
+ "Options:"
789
+ ];
790
+ for (const opt of CLI_OPTIONS) {
791
+ const suffix = opt.type === "string" ? "=<value>" : opt.type === "array" ? "=<list>" : "";
792
+ const padding = 28 - (opt.flag.length + suffix.length);
793
+ lines.push(
794
+ ` ${opt.flag}${suffix}${" ".repeat(Math.max(1, padding))}${opt.description}`
795
+ );
796
+ }
797
+ lines.push(" --help, -h Show this help message");
798
+ return lines.join("\n");
799
+ }
800
+
801
+ // scripts/tty.ts
802
+ init_esm_shims();
803
+ function isInteractiveTTY() {
804
+ return process.stdout.isTTY === true;
805
+ }
806
+
725
807
  // scripts/cli.ts
726
808
  var pc = process.env.FORCE_COLOR ? import_picocolors.default.createColors(true) : import_picocolors.default;
727
809
  function splitChangeIntoLines(value) {
@@ -866,6 +948,13 @@ async function main(args) {
866
948
  }
867
949
  }
868
950
  } else {
951
+ if (!isInteractiveTTY()) {
952
+ const requiredFlags = CLI_OPTIONS.filter(
953
+ (opt) => opt.requiredForNonInteractive
954
+ ).map((opt) => opt.flag).join(", ");
955
+ log.warn(`Non-interactive mode requires ${requiredFlags} arguments`);
956
+ return;
957
+ }
869
958
  variant = await select({
870
959
  message: "Select variant",
871
960
  options: [...VARIANT_OPTIONS]
@@ -1028,83 +1117,12 @@ async function main(args) {
1028
1117
 
1029
1118
  If Claude Code is already running, restart it to pick up the new commands.
1030
1119
 
1120
+ Try it out: /red clicking submit with empty email shows validation error
1121
+
1031
1122
  Happy TDD'ing!`
1032
1123
  );
1033
1124
  }
1034
1125
 
1035
- // scripts/cli-options.ts
1036
- init_esm_shims();
1037
- var CLI_OPTIONS = [
1038
- {
1039
- flag: "--variant",
1040
- key: "variant",
1041
- type: "string",
1042
- description: "Command variant (with-beads, without-beads)",
1043
- example: "--variant=with-beads"
1044
- },
1045
- {
1046
- flag: "--scope",
1047
- key: "scope",
1048
- type: "string",
1049
- description: "Installation scope (project, user)",
1050
- example: "--scope=project"
1051
- },
1052
- {
1053
- flag: "--prefix",
1054
- key: "prefix",
1055
- type: "string",
1056
- description: "Add prefix to command names",
1057
- example: "--prefix=my-"
1058
- },
1059
- {
1060
- flag: "--commands",
1061
- key: "commands",
1062
- type: "array",
1063
- description: "Install only specific commands",
1064
- example: "--commands=commit,red,green"
1065
- },
1066
- {
1067
- flag: "--skip-template-injection",
1068
- key: "skipTemplateInjection",
1069
- type: "boolean",
1070
- description: "Skip injecting project CLAUDE.md customizations"
1071
- },
1072
- {
1073
- flag: "--update-existing",
1074
- key: "updateExisting",
1075
- type: "boolean",
1076
- description: "Only update already-installed commands"
1077
- },
1078
- {
1079
- flag: "--overwrite",
1080
- key: "overwrite",
1081
- type: "boolean",
1082
- description: "Overwrite conflicting files without prompting"
1083
- },
1084
- {
1085
- flag: "--skip-on-conflict",
1086
- key: "skipOnConflict",
1087
- type: "boolean",
1088
- description: "Skip conflicting files without prompting"
1089
- }
1090
- ];
1091
- function generateHelpText() {
1092
- const lines = [
1093
- "Usage: npx @wbern/claude-instructions [options]",
1094
- "",
1095
- "Options:"
1096
- ];
1097
- for (const opt of CLI_OPTIONS) {
1098
- const suffix = opt.type === "string" ? "=<value>" : opt.type === "array" ? "=<list>" : "";
1099
- const padding = 28 - (opt.flag.length + suffix.length);
1100
- lines.push(
1101
- ` ${opt.flag}${suffix}${" ".repeat(Math.max(1, padding))}${opt.description}`
1102
- );
1103
- }
1104
- lines.push(" --help, -h Show this help message");
1105
- return lines.join("\n");
1106
- }
1107
-
1108
1126
  // scripts/bin.ts
1109
1127
  function parseArgs(argv) {
1110
1128
  const args = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wbern/claude-instructions",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "TDD workflow commands for Claude Code CLI",
5
5
  "type": "module",
6
6
  "bin": "./bin/cli.js",