@memberjunction/cli 5.1.0 → 5.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.
@@ -427,7 +427,7 @@
427
427
  "codegen:5-0-fix-entity-names": {
428
428
  "aliases": [],
429
429
  "args": {},
430
- "description": "[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.\n\nThree strategies are applied:\n 1. Class name renames (regex) — ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema, etc.\n 2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'\n 3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,\n navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.\n\nThe rename map (272 entries) is built from entity_subclasses.ts @RegisterClass decorators plus\nan embedded rename map for class name prefixes. Runs in dry-run mode by default; use --fix to apply.",
430
+ "description": "[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.\n\nThree strategies are applied:\n 1. Class name renames (regex) — ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema,\n ActionEntityExtended -> MJActionEntityExtended (extended subclasses),\n ActionEntityServerEntity -> MJActionEntityServer (server subclass suffix standardization),\n ActionFormComponentExtended -> MJActionFormComponentExtended (Angular form components).\n Explicit subclass mappings (57 entries from subclass-rename-map.json) take priority over\n auto-generated suffix rules, enabling suffix changes (e.g., _Server -> Server, ServerEntity -> Server).\n 2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'\n 3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,\n navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.\n\nThe rename map (272 entity entries + 57 subclass entries) is built from entity_subclasses.ts @RegisterClass\ndecorators plus embedded rename maps. Runs in dry-run mode by default; use --fix to apply.",
431
431
  "examples": [
432
432
  {
433
433
  "description": "Dry-run scan of the packages directory",
@@ -774,38 +774,25 @@
774
774
  "manifest.js"
775
775
  ]
776
776
  },
777
- "dbdoc:analyze": {
777
+ "install": {
778
778
  "aliases": [],
779
779
  "args": {},
780
- "description": "Analyze database and generate documentation (delegates to db-auto-doc analyze)",
780
+ "description": "Install MemberJunction",
781
781
  "examples": [
782
- "<%= config.bin %> <%= command.id %>",
783
- "<%= config.bin %> <%= command.id %> --resume ./output/run-6/state.json",
784
- "<%= config.bin %> <%= command.id %> --config ./my-config.json"
782
+ "<%= config.bin %> <%= command.id %>\n"
785
783
  ],
786
784
  "flags": {
787
- "resume": {
788
- "char": "r",
789
- "description": "Resume from an existing state file",
790
- "name": "resume",
791
- "required": false,
792
- "hasDynamicHelp": false,
793
- "multiple": false,
794
- "type": "option"
795
- },
796
- "config": {
797
- "char": "c",
798
- "description": "Path to config file",
799
- "name": "config",
800
- "default": "./config.json",
801
- "hasDynamicHelp": false,
802
- "multiple": false,
803
- "type": "option"
785
+ "verbose": {
786
+ "char": "v",
787
+ "description": "Enable additional logging",
788
+ "name": "verbose",
789
+ "allowNo": false,
790
+ "type": "boolean"
804
791
  }
805
792
  },
806
793
  "hasDynamicHelp": false,
807
794
  "hiddenAliases": [],
808
- "id": "dbdoc:analyze",
795
+ "id": "install",
809
796
  "pluginAlias": "@memberjunction/cli",
810
797
  "pluginName": "@memberjunction/cli",
811
798
  "pluginType": "core",
@@ -815,105 +802,54 @@
815
802
  "relativePath": [
816
803
  "dist",
817
804
  "commands",
818
- "dbdoc",
819
- "analyze.js"
805
+ "install",
806
+ "index.js"
820
807
  ]
821
808
  },
822
- "dbdoc:export-sample-queries": {
809
+ "migrate": {
823
810
  "aliases": [],
824
811
  "args": {},
825
- "description": "Export sample queries to MemberJunction metadata format (delegates to db-auto-doc export-sample-queries)",
812
+ "description": "Migrate MemberJunction database to latest version",
826
813
  "examples": [
827
- "<%= config.bin %> <%= command.id %> --input ./output/sample-queries.json --output ./metadata/queries/.queries.json",
828
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./metadata/queries/.queries.json --separate-sql-files",
829
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --category \"Database Documentation\"",
830
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --status Pending --min-confidence 0.8"
814
+ "<%= config.bin %> <%= command.id %>\n",
815
+ "<%= config.bin %> <%= command.id %> --schema __BCSaaS --dir ./migrations/v1\n",
816
+ "<%= config.bin %> <%= command.id %> --schema __BCSaaS --tag v1.0.0\n"
831
817
  ],
832
818
  "flags": {
833
- "input": {
834
- "char": "i",
835
- "description": "Path to sample-queries.json file generated by generate-queries command",
836
- "name": "input",
837
- "required": true,
838
- "hasDynamicHelp": false,
839
- "multiple": false,
840
- "type": "option"
841
- },
842
- "output": {
843
- "char": "o",
844
- "description": "Output path for the .queries.json metadata file",
845
- "name": "output",
846
- "required": true,
847
- "hasDynamicHelp": false,
848
- "multiple": false,
849
- "type": "option"
850
- },
851
- "separate-sql-files": {
852
- "description": "Write SQL to separate files and use @file: references",
853
- "name": "separate-sql-files",
819
+ "verbose": {
820
+ "char": "v",
821
+ "description": "Enable additional logging",
822
+ "name": "verbose",
854
823
  "allowNo": false,
855
824
  "type": "boolean"
856
825
  },
857
- "sql-dir": {
858
- "description": "Directory for SQL files when using --separate-sql-files (relative to output file)",
859
- "name": "sql-dir",
860
- "default": "SQL",
861
- "hasDynamicHelp": false,
862
- "multiple": false,
863
- "type": "option"
864
- },
865
- "category": {
866
- "description": "Category name for @lookup reference (e.g., \"Database Documentation\")",
867
- "name": "category",
868
- "required": false,
826
+ "tag": {
827
+ "char": "t",
828
+ "description": "Version tag to use for running remote migrations",
829
+ "name": "tag",
869
830
  "hasDynamicHelp": false,
870
831
  "multiple": false,
871
832
  "type": "option"
872
833
  },
873
- "status": {
874
- "description": "Status to assign to exported queries",
875
- "name": "status",
876
- "default": "Pending",
834
+ "schema": {
835
+ "char": "s",
836
+ "description": "Target schema (overrides coreSchema from config)",
837
+ "name": "schema",
877
838
  "hasDynamicHelp": false,
878
839
  "multiple": false,
879
- "options": [
880
- "Approved",
881
- "Pending",
882
- "Rejected",
883
- "Expired"
884
- ],
885
840
  "type": "option"
886
841
  },
887
- "min-confidence": {
888
- "description": "Minimum confidence threshold to export (0-1)",
889
- "name": "min-confidence",
890
- "default": "0",
842
+ "dir": {
843
+ "description": "Migration source directory (overrides migrationsLocation from config)",
844
+ "name": "dir",
891
845
  "hasDynamicHelp": false,
892
846
  "multiple": false,
893
847
  "type": "option"
894
- },
895
- "validated-only": {
896
- "description": "Only export queries that were successfully validated",
897
- "name": "validated-only",
898
- "allowNo": false,
899
- "type": "boolean"
900
- },
901
- "append": {
902
- "description": "Append to existing metadata file instead of overwriting",
903
- "name": "append",
904
- "allowNo": false,
905
- "type": "boolean"
906
- },
907
- "include-primary-key": {
908
- "description": "Include primaryKey and sync fields (for updating existing records)",
909
- "name": "include-primary-key",
910
- "allowNo": false,
911
- "type": "boolean"
912
848
  }
913
849
  },
914
850
  "hasDynamicHelp": false,
915
851
  "hiddenAliases": [],
916
- "id": "dbdoc:export-sample-queries",
852
+ "id": "migrate",
917
853
  "pluginAlias": "@memberjunction/cli",
918
854
  "pluginName": "@memberjunction/cli",
919
855
  "pluginType": "core",
@@ -923,100 +859,40 @@
923
859
  "relativePath": [
924
860
  "dist",
925
861
  "commands",
926
- "dbdoc",
927
- "export-sample-queries.js"
862
+ "migrate",
863
+ "index.js"
928
864
  ]
929
865
  },
930
- "dbdoc:export": {
866
+ "querygen:export": {
931
867
  "aliases": [],
932
868
  "args": {},
933
- "description": "Export documentation in multiple formats (delegates to db-auto-doc export)",
869
+ "description": "Export queries from database to metadata files",
934
870
  "examples": [
935
- "<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json",
936
- "<%= config.bin %> <%= command.id %> --sql",
937
- "<%= config.bin %> <%= command.id %> --markdown",
938
- "<%= config.bin %> <%= command.id %> --html",
939
- "<%= config.bin %> <%= command.id %> --csv",
940
- "<%= config.bin %> <%= command.id %> --mermaid",
941
- "<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply"
871
+ "<%= config.bin %> <%= command.id %>",
872
+ "<%= config.bin %> <%= command.id %> --output ./metadata/queries",
873
+ "<%= config.bin %> <%= command.id %> --verbose"
942
874
  ],
943
875
  "flags": {
944
- "state-file": {
945
- "char": "s",
946
- "description": "Path to state JSON file",
947
- "name": "state-file",
948
- "hasDynamicHelp": false,
949
- "multiple": false,
950
- "type": "option"
951
- },
952
- "output-dir": {
876
+ "output": {
953
877
  "char": "o",
954
- "description": "Output directory for generated files",
955
- "name": "output-dir",
878
+ "description": "Output directory",
879
+ "name": "output",
880
+ "default": "./metadata/queries",
956
881
  "hasDynamicHelp": false,
957
882
  "multiple": false,
958
883
  "type": "option"
959
884
  },
960
- "sql": {
961
- "description": "Generate SQL script",
962
- "name": "sql",
963
- "allowNo": false,
964
- "type": "boolean"
965
- },
966
- "markdown": {
967
- "description": "Generate Markdown documentation",
968
- "name": "markdown",
969
- "allowNo": false,
970
- "type": "boolean"
971
- },
972
- "html": {
973
- "description": "Generate interactive HTML documentation",
974
- "name": "html",
975
- "allowNo": false,
976
- "type": "boolean"
977
- },
978
- "csv": {
979
- "description": "Generate CSV exports (tables and columns)",
980
- "name": "csv",
981
- "allowNo": false,
982
- "type": "boolean"
983
- },
984
- "mermaid": {
985
- "description": "Generate Mermaid ERD diagram files",
986
- "name": "mermaid",
987
- "allowNo": false,
988
- "type": "boolean"
989
- },
990
- "report": {
991
- "description": "Generate analysis report",
992
- "name": "report",
993
- "allowNo": false,
994
- "type": "boolean"
995
- },
996
- "apply": {
997
- "description": "Apply SQL to database",
998
- "name": "apply",
999
- "allowNo": false,
1000
- "type": "boolean"
1001
- },
1002
- "approved-only": {
1003
- "description": "Only export approved items",
1004
- "name": "approved-only",
885
+ "verbose": {
886
+ "char": "v",
887
+ "description": "Verbose output",
888
+ "name": "verbose",
1005
889
  "allowNo": false,
1006
890
  "type": "boolean"
1007
- },
1008
- "confidence-threshold": {
1009
- "description": "Minimum confidence threshold",
1010
- "name": "confidence-threshold",
1011
- "default": "0",
1012
- "hasDynamicHelp": false,
1013
- "multiple": false,
1014
- "type": "option"
1015
891
  }
1016
892
  },
1017
893
  "hasDynamicHelp": false,
1018
894
  "hiddenAliases": [],
1019
- "id": "dbdoc:export",
895
+ "id": "querygen:export",
1020
896
  "pluginAlias": "@memberjunction/cli",
1021
897
  "pluginName": "@memberjunction/cli",
1022
898
  "pluginType": "core",
@@ -1026,111 +902,126 @@
1026
902
  "relativePath": [
1027
903
  "dist",
1028
904
  "commands",
1029
- "dbdoc",
905
+ "querygen",
1030
906
  "export.js"
1031
907
  ]
1032
908
  },
1033
- "dbdoc:generate-queries": {
909
+ "querygen:generate": {
1034
910
  "aliases": [],
1035
911
  "args": {},
1036
- "description": "Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)",
912
+ "description": "Generate SQL query templates for entities using AI",
1037
913
  "examples": [
1038
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json",
1039
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries",
1040
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10"
914
+ "<%= config.bin %> <%= command.id %>",
915
+ "<%= config.bin %> <%= command.id %> --entities \"Customers,Orders\"",
916
+ "<%= config.bin %> <%= command.id %> --max-entities 5 --verbose",
917
+ "<%= config.bin %> <%= command.id %> --mode database"
1041
918
  ],
1042
919
  "flags": {
1043
- "from-state": {
1044
- "description": "Path to existing state.json file from previous analysis",
1045
- "name": "from-state",
1046
- "required": true,
920
+ "entities": {
921
+ "char": "e",
922
+ "description": "Specific entities to generate queries for (comma-separated)",
923
+ "name": "entities",
1047
924
  "hasDynamicHelp": false,
1048
925
  "multiple": false,
1049
926
  "type": "option"
1050
927
  },
1051
- "output-dir": {
1052
- "description": "Output directory for generated queries",
1053
- "name": "output-dir",
1054
- "required": false,
928
+ "exclude-entities": {
929
+ "char": "x",
930
+ "description": "Entities to exclude (comma-separated)",
931
+ "name": "exclude-entities",
1055
932
  "hasDynamicHelp": false,
1056
933
  "multiple": false,
1057
934
  "type": "option"
1058
935
  },
1059
- "config": {
1060
- "char": "c",
1061
- "description": "Path to config file (for database connection and AI settings)",
1062
- "name": "config",
1063
- "default": "./config.json",
936
+ "exclude-schemas": {
937
+ "char": "s",
938
+ "description": "Schemas to exclude (comma-separated)",
939
+ "name": "exclude-schemas",
1064
940
  "hasDynamicHelp": false,
1065
941
  "multiple": false,
1066
942
  "type": "option"
1067
943
  },
1068
- "queries-per-table": {
1069
- "description": "Number of queries to generate per table",
1070
- "name": "queries-per-table",
1071
- "required": false,
944
+ "max-entities": {
945
+ "char": "m",
946
+ "description": "Max entities per group",
947
+ "name": "max-entities",
948
+ "default": 3,
1072
949
  "hasDynamicHelp": false,
1073
950
  "multiple": false,
1074
951
  "type": "option"
1075
952
  },
1076
- "max-execution-time": {
1077
- "description": "Maximum execution time for query validation (ms)",
1078
- "name": "max-execution-time",
1079
- "required": false,
953
+ "target-groups": {
954
+ "char": "t",
955
+ "description": "Target number of entity groups to generate",
956
+ "name": "target-groups",
957
+ "default": 75,
958
+ "hasDynamicHelp": false,
959
+ "multiple": false,
960
+ "type": "option"
961
+ },
962
+ "max-refinements": {
963
+ "char": "r",
964
+ "description": "Max refinement iterations",
965
+ "name": "max-refinements",
966
+ "default": 3,
967
+ "hasDynamicHelp": false,
968
+ "multiple": false,
969
+ "type": "option"
970
+ },
971
+ "max-fixes": {
972
+ "char": "f",
973
+ "description": "Max error-fixing attempts",
974
+ "name": "max-fixes",
975
+ "default": 5,
976
+ "hasDynamicHelp": false,
977
+ "multiple": false,
978
+ "type": "option"
979
+ },
980
+ "model": {
981
+ "description": "Preferred AI model",
982
+ "name": "model",
983
+ "hasDynamicHelp": false,
984
+ "multiple": false,
985
+ "type": "option"
986
+ },
987
+ "vendor": {
988
+ "description": "Preferred AI vendor",
989
+ "name": "vendor",
990
+ "hasDynamicHelp": false,
991
+ "multiple": false,
992
+ "type": "option"
993
+ },
994
+ "output": {
995
+ "char": "o",
996
+ "description": "Output directory",
997
+ "name": "output",
998
+ "hasDynamicHelp": false,
999
+ "multiple": false,
1000
+ "type": "option"
1001
+ },
1002
+ "mode": {
1003
+ "description": "Output mode: metadata|database|both",
1004
+ "name": "mode",
1080
1005
  "hasDynamicHelp": false,
1081
1006
  "multiple": false,
1007
+ "options": [
1008
+ "metadata",
1009
+ "database",
1010
+ "both"
1011
+ ],
1082
1012
  "type": "option"
1013
+ },
1014
+ "verbose": {
1015
+ "char": "v",
1016
+ "description": "Verbose output",
1017
+ "name": "verbose",
1018
+ "allowNo": false,
1019
+ "type": "boolean"
1083
1020
  }
1084
1021
  },
1085
1022
  "hasDynamicHelp": false,
1086
1023
  "hiddenAliases": [],
1087
- "id": "dbdoc:generate-queries",
1088
- "pluginAlias": "@memberjunction/cli",
1089
- "pluginName": "@memberjunction/cli",
1090
- "pluginType": "core",
1091
- "strict": true,
1092
- "enableJsonFlag": false,
1093
- "isESM": true,
1094
- "relativePath": [
1095
- "dist",
1096
- "commands",
1097
- "dbdoc",
1098
- "generate-queries.js"
1099
- ]
1100
- },
1101
- "dbdoc": {
1102
- "aliases": [],
1103
- "args": {},
1104
- "description": "AI-powered database documentation generator",
1105
- "flags": {},
1106
- "hasDynamicHelp": false,
1107
- "hidden": false,
1108
- "hiddenAliases": [],
1109
- "id": "dbdoc",
1110
- "pluginAlias": "@memberjunction/cli",
1111
- "pluginName": "@memberjunction/cli",
1112
- "pluginType": "core",
1113
- "strict": true,
1114
- "enableJsonFlag": false,
1115
- "isESM": true,
1116
- "relativePath": [
1117
- "dist",
1118
- "commands",
1119
- "dbdoc",
1120
- "index.js"
1121
- ]
1122
- },
1123
- "dbdoc:init": {
1124
- "aliases": [],
1125
- "args": {},
1126
- "description": "Initialize DBAutoDoc project (delegates to db-auto-doc init)",
1127
- "examples": [
1128
- "<%= config.bin %> <%= command.id %>"
1129
- ],
1130
- "flags": {},
1131
- "hasDynamicHelp": false,
1132
- "hiddenAliases": [],
1133
- "id": "dbdoc:init",
1024
+ "id": "querygen:generate",
1134
1025
  "pluginAlias": "@memberjunction/cli",
1135
1026
  "pluginName": "@memberjunction/cli",
1136
1027
  "pluginType": "core",
@@ -1140,30 +1031,40 @@
1140
1031
  "relativePath": [
1141
1032
  "dist",
1142
1033
  "commands",
1143
- "dbdoc",
1144
- "init.js"
1034
+ "querygen",
1035
+ "generate.js"
1145
1036
  ]
1146
1037
  },
1147
- "dbdoc:reset": {
1038
+ "querygen:validate": {
1148
1039
  "aliases": [],
1149
1040
  "args": {},
1150
- "description": "Reset analysis state (delegates to db-auto-doc reset)",
1041
+ "description": "Validate existing query templates",
1151
1042
  "examples": [
1152
1043
  "<%= config.bin %> <%= command.id %>",
1153
- "<%= config.bin %> <%= command.id %> --force"
1044
+ "<%= config.bin %> <%= command.id %> --path ./metadata/queries",
1045
+ "<%= config.bin %> <%= command.id %> --verbose"
1154
1046
  ],
1155
1047
  "flags": {
1156
- "force": {
1157
- "char": "f",
1158
- "description": "Force reset without confirmation",
1159
- "name": "force",
1048
+ "path": {
1049
+ "char": "p",
1050
+ "description": "Path to queries metadata file or directory",
1051
+ "name": "path",
1052
+ "default": "./metadata/queries",
1053
+ "hasDynamicHelp": false,
1054
+ "multiple": false,
1055
+ "type": "option"
1056
+ },
1057
+ "verbose": {
1058
+ "char": "v",
1059
+ "description": "Verbose output",
1060
+ "name": "verbose",
1160
1061
  "allowNo": false,
1161
1062
  "type": "boolean"
1162
1063
  }
1163
1064
  },
1164
1065
  "hasDynamicHelp": false,
1165
1066
  "hiddenAliases": [],
1166
- "id": "dbdoc:reset",
1067
+ "id": "querygen:validate",
1167
1068
  "pluginAlias": "@memberjunction/cli",
1168
1069
  "pluginName": "@memberjunction/cli",
1169
1070
  "pluginType": "core",
@@ -1173,31 +1074,64 @@
1173
1074
  "relativePath": [
1174
1075
  "dist",
1175
1076
  "commands",
1176
- "dbdoc",
1177
- "reset.js"
1077
+ "querygen",
1078
+ "validate.js"
1178
1079
  ]
1179
1080
  },
1180
- "dbdoc:status": {
1081
+ "sync:file-reset": {
1181
1082
  "aliases": [],
1182
1083
  "args": {},
1183
- "description": "Show analysis status and progress (delegates to db-auto-doc status)",
1084
+ "description": "Reset file metadata sections",
1184
1085
  "examples": [
1185
1086
  "<%= config.bin %> <%= command.id %>",
1186
- "<%= config.bin %> <%= command.id %> --state-file ./custom-state.json"
1087
+ "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1088
+ "<%= config.bin %> <%= command.id %> --sections=\"dependencies,references\"",
1089
+ "<%= config.bin %> <%= command.id %> --all"
1187
1090
  ],
1188
1091
  "flags": {
1189
- "state-file": {
1190
- "char": "s",
1191
- "description": "Path to state JSON file",
1192
- "name": "state-file",
1092
+ "dir": {
1093
+ "description": "Specific entity directory to reset",
1094
+ "name": "dir",
1095
+ "hasDynamicHelp": false,
1096
+ "multiple": false,
1097
+ "type": "option"
1098
+ },
1099
+ "sections": {
1100
+ "description": "Comma-separated list of sections to reset (dependencies,references,related,lookup)",
1101
+ "name": "sections",
1193
1102
  "hasDynamicHelp": false,
1194
1103
  "multiple": false,
1195
1104
  "type": "option"
1105
+ },
1106
+ "all": {
1107
+ "description": "Reset all metadata sections",
1108
+ "name": "all",
1109
+ "allowNo": false,
1110
+ "type": "boolean"
1111
+ },
1112
+ "dry-run": {
1113
+ "description": "Show what would be reset without actually resetting",
1114
+ "name": "dry-run",
1115
+ "allowNo": false,
1116
+ "type": "boolean"
1117
+ },
1118
+ "force": {
1119
+ "description": "Skip confirmation prompts",
1120
+ "name": "force",
1121
+ "allowNo": false,
1122
+ "type": "boolean"
1123
+ },
1124
+ "verbose": {
1125
+ "char": "v",
1126
+ "description": "Show detailed output",
1127
+ "name": "verbose",
1128
+ "allowNo": false,
1129
+ "type": "boolean"
1196
1130
  }
1197
1131
  },
1198
1132
  "hasDynamicHelp": false,
1199
1133
  "hiddenAliases": [],
1200
- "id": "dbdoc:status",
1134
+ "id": "sync:file-reset",
1201
1135
  "pluginAlias": "@memberjunction/cli",
1202
1136
  "pluginName": "@memberjunction/cli",
1203
1137
  "pluginType": "core",
@@ -1207,29 +1141,21 @@
1207
1141
  "relativePath": [
1208
1142
  "dist",
1209
1143
  "commands",
1210
- "dbdoc",
1211
- "status.js"
1144
+ "sync",
1145
+ "file-reset.js"
1212
1146
  ]
1213
1147
  },
1214
- "install": {
1148
+ "sync:init": {
1215
1149
  "aliases": [],
1216
1150
  "args": {},
1217
- "description": "Install MemberJunction",
1151
+ "description": "Initialize a directory for metadata synchronization",
1218
1152
  "examples": [
1219
- "<%= config.bin %> <%= command.id %>\n"
1153
+ "<%= config.bin %> <%= command.id %>"
1220
1154
  ],
1221
- "flags": {
1222
- "verbose": {
1223
- "char": "v",
1224
- "description": "Enable additional logging",
1225
- "name": "verbose",
1226
- "allowNo": false,
1227
- "type": "boolean"
1228
- }
1229
- },
1155
+ "flags": {},
1230
1156
  "hasDynamicHelp": false,
1231
1157
  "hiddenAliases": [],
1232
- "id": "install",
1158
+ "id": "sync:init",
1233
1159
  "pluginAlias": "@memberjunction/cli",
1234
1160
  "pluginName": "@memberjunction/cli",
1235
1161
  "pluginType": "core",
@@ -1239,46 +1165,119 @@
1239
1165
  "relativePath": [
1240
1166
  "dist",
1241
1167
  "commands",
1242
- "install",
1243
- "index.js"
1168
+ "sync",
1169
+ "init.js"
1244
1170
  ]
1245
1171
  },
1246
- "migrate": {
1172
+ "sync:pull": {
1247
1173
  "aliases": [],
1248
1174
  "args": {},
1249
- "description": "Migrate MemberJunction database to latest version",
1175
+ "description": "Pull metadata from database to local files",
1250
1176
  "examples": [
1251
- "<%= config.bin %> <%= command.id %>\n",
1252
- "<%= config.bin %> <%= command.id %> --schema __BCSaaS --dir ./migrations/v1\n",
1253
- "<%= config.bin %> <%= command.id %> --schema __BCSaaS --tag v1.0.0\n"
1177
+ "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Prompts\"",
1178
+ "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Prompts\" --filter=\"CategoryID='customer-service-id'\"",
1179
+ "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Agents\" --merge-strategy=overwrite",
1180
+ "<%= config.bin %> <%= command.id %> --entity=\"Actions\" --target-dir=./custom-actions --no-validate",
1181
+ "<%= config.bin %> <%= command.id %> --entity=\"Templates\" --dry-run --verbose",
1182
+ "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Prompts\" --exclude-fields=InternalNotes,DebugInfo"
1254
1183
  ],
1255
1184
  "flags": {
1256
- "verbose": {
1257
- "char": "v",
1258
- "description": "Enable additional logging",
1259
- "name": "verbose",
1260
- "allowNo": false,
1185
+ "entity": {
1186
+ "description": "Entity name to pull",
1187
+ "name": "entity",
1188
+ "required": true,
1189
+ "hasDynamicHelp": false,
1190
+ "multiple": false,
1191
+ "type": "option"
1192
+ },
1193
+ "filter": {
1194
+ "description": "Additional filter for pulling specific records",
1195
+ "name": "filter",
1196
+ "hasDynamicHelp": false,
1197
+ "multiple": false,
1198
+ "type": "option"
1199
+ },
1200
+ "dry-run": {
1201
+ "description": "Show what would be pulled without actually pulling",
1202
+ "name": "dry-run",
1203
+ "allowNo": false,
1261
1204
  "type": "boolean"
1262
1205
  },
1263
- "tag": {
1264
- "char": "t",
1265
- "description": "Version tag to use for running remote migrations",
1266
- "name": "tag",
1206
+ "multi-file": {
1207
+ "description": "Create a single file with multiple records (provide filename)",
1208
+ "name": "multi-file",
1267
1209
  "hasDynamicHelp": false,
1268
1210
  "multiple": false,
1269
1211
  "type": "option"
1270
1212
  },
1271
- "schema": {
1272
- "char": "s",
1273
- "description": "Target schema (overrides coreSchema from config)",
1274
- "name": "schema",
1213
+ "verbose": {
1214
+ "char": "v",
1215
+ "description": "Show detailed output",
1216
+ "name": "verbose",
1217
+ "allowNo": false,
1218
+ "type": "boolean"
1219
+ },
1220
+ "no-validate": {
1221
+ "description": "Skip validation before pull",
1222
+ "name": "no-validate",
1223
+ "allowNo": false,
1224
+ "type": "boolean"
1225
+ },
1226
+ "update-existing": {
1227
+ "description": "Update existing records during pull",
1228
+ "name": "update-existing",
1229
+ "allowNo": false,
1230
+ "type": "boolean"
1231
+ },
1232
+ "create-new": {
1233
+ "description": "Create new files for records not found locally",
1234
+ "name": "create-new",
1235
+ "allowNo": false,
1236
+ "type": "boolean"
1237
+ },
1238
+ "backup-before-update": {
1239
+ "description": "Create backups before updating files",
1240
+ "name": "backup-before-update",
1241
+ "allowNo": false,
1242
+ "type": "boolean"
1243
+ },
1244
+ "merge-strategy": {
1245
+ "description": "Merge strategy for updates",
1246
+ "name": "merge-strategy",
1247
+ "default": "merge",
1275
1248
  "hasDynamicHelp": false,
1276
1249
  "multiple": false,
1250
+ "options": [
1251
+ "merge",
1252
+ "overwrite",
1253
+ "skip"
1254
+ ],
1277
1255
  "type": "option"
1278
1256
  },
1279
- "dir": {
1280
- "description": "Migration source directory (overrides migrationsLocation from config)",
1281
- "name": "dir",
1257
+ "backup-directory": {
1258
+ "description": "Custom backup directory (default: .backups)",
1259
+ "name": "backup-directory",
1260
+ "hasDynamicHelp": false,
1261
+ "multiple": false,
1262
+ "type": "option"
1263
+ },
1264
+ "preserve-fields": {
1265
+ "description": "Comma-separated list of fields to preserve during updates",
1266
+ "name": "preserve-fields",
1267
+ "hasDynamicHelp": false,
1268
+ "multiple": true,
1269
+ "type": "option"
1270
+ },
1271
+ "exclude-fields": {
1272
+ "description": "Comma-separated list of fields to exclude from pull",
1273
+ "name": "exclude-fields",
1274
+ "hasDynamicHelp": false,
1275
+ "multiple": true,
1276
+ "type": "option"
1277
+ },
1278
+ "target-dir": {
1279
+ "description": "Specific target directory (overrides auto-discovery)",
1280
+ "name": "target-dir",
1282
1281
  "hasDynamicHelp": false,
1283
1282
  "multiple": false,
1284
1283
  "type": "option"
@@ -1286,7 +1285,7 @@
1286
1285
  },
1287
1286
  "hasDynamicHelp": false,
1288
1287
  "hiddenAliases": [],
1289
- "id": "migrate",
1288
+ "id": "sync:pull",
1290
1289
  "pluginAlias": "@memberjunction/cli",
1291
1290
  "pluginName": "@memberjunction/cli",
1292
1291
  "pluginType": "core",
@@ -1296,40 +1295,85 @@
1296
1295
  "relativePath": [
1297
1296
  "dist",
1298
1297
  "commands",
1299
- "migrate",
1300
- "index.js"
1298
+ "sync",
1299
+ "pull.js"
1301
1300
  ]
1302
1301
  },
1303
- "querygen:export": {
1302
+ "sync:push": {
1304
1303
  "aliases": [],
1305
1304
  "args": {},
1306
- "description": "Export queries from database to metadata files",
1305
+ "description": "Push local file changes to the database",
1307
1306
  "examples": [
1308
1307
  "<%= config.bin %> <%= command.id %>",
1309
- "<%= config.bin %> <%= command.id %> --output ./metadata/queries",
1310
- "<%= config.bin %> <%= command.id %> --verbose"
1308
+ "<%= config.bin %> <%= command.id %> --dry-run",
1309
+ "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1310
+ "<%= config.bin %> <%= command.id %> --ci"
1311
1311
  ],
1312
1312
  "flags": {
1313
- "output": {
1314
- "char": "o",
1315
- "description": "Output directory",
1316
- "name": "output",
1317
- "default": "./metadata/queries",
1313
+ "dir": {
1314
+ "description": "Specific entity directory to push",
1315
+ "name": "dir",
1318
1316
  "hasDynamicHelp": false,
1319
1317
  "multiple": false,
1320
1318
  "type": "option"
1321
1319
  },
1320
+ "dry-run": {
1321
+ "description": "Show what would be pushed without actually pushing",
1322
+ "name": "dry-run",
1323
+ "allowNo": false,
1324
+ "type": "boolean"
1325
+ },
1326
+ "ci": {
1327
+ "description": "CI mode - no prompts, fail on issues",
1328
+ "name": "ci",
1329
+ "allowNo": false,
1330
+ "type": "boolean"
1331
+ },
1322
1332
  "verbose": {
1323
1333
  "char": "v",
1324
- "description": "Verbose output",
1334
+ "description": "Show detailed field-level output",
1325
1335
  "name": "verbose",
1326
1336
  "allowNo": false,
1327
1337
  "type": "boolean"
1338
+ },
1339
+ "no-validate": {
1340
+ "description": "Skip validation before push",
1341
+ "name": "no-validate",
1342
+ "allowNo": false,
1343
+ "type": "boolean"
1344
+ },
1345
+ "delete-db-only": {
1346
+ "description": "Delete database-only records that reference records being deleted (prevents FK errors)",
1347
+ "name": "delete-db-only",
1348
+ "allowNo": false,
1349
+ "type": "boolean"
1350
+ },
1351
+ "parallel-batch-size": {
1352
+ "description": "Number of records to process in parallel (default: 10)",
1353
+ "name": "parallel-batch-size",
1354
+ "default": 10,
1355
+ "hasDynamicHelp": false,
1356
+ "multiple": false,
1357
+ "type": "option"
1358
+ },
1359
+ "include": {
1360
+ "description": "Only process these directories (comma-separated, supports patterns)",
1361
+ "name": "include",
1362
+ "hasDynamicHelp": false,
1363
+ "multiple": false,
1364
+ "type": "option"
1365
+ },
1366
+ "exclude": {
1367
+ "description": "Skip these directories (comma-separated, supports patterns)",
1368
+ "name": "exclude",
1369
+ "hasDynamicHelp": false,
1370
+ "multiple": false,
1371
+ "type": "option"
1328
1372
  }
1329
1373
  },
1330
1374
  "hasDynamicHelp": false,
1331
1375
  "hiddenAliases": [],
1332
- "id": "querygen:export",
1376
+ "id": "sync:push",
1333
1377
  "pluginAlias": "@memberjunction/cli",
1334
1378
  "pluginName": "@memberjunction/cli",
1335
1379
  "pluginType": "core",
@@ -1339,118 +1383,154 @@
1339
1383
  "relativePath": [
1340
1384
  "dist",
1341
1385
  "commands",
1342
- "querygen",
1343
- "export.js"
1386
+ "sync",
1387
+ "push.js"
1344
1388
  ]
1345
1389
  },
1346
- "querygen:generate": {
1390
+ "sync:status": {
1347
1391
  "aliases": [],
1348
1392
  "args": {},
1349
- "description": "Generate SQL query templates for entities using AI",
1393
+ "description": "Show status of local files vs database",
1350
1394
  "examples": [
1351
1395
  "<%= config.bin %> <%= command.id %>",
1352
- "<%= config.bin %> <%= command.id %> --entities \"Customers,Orders\"",
1353
- "<%= config.bin %> <%= command.id %> --max-entities 5 --verbose",
1354
- "<%= config.bin %> <%= command.id %> --mode database"
1396
+ "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1397
+ "<%= config.bin %> <%= command.id %> --verbose"
1355
1398
  ],
1356
1399
  "flags": {
1357
- "entities": {
1358
- "char": "e",
1359
- "description": "Specific entities to generate queries for (comma-separated)",
1360
- "name": "entities",
1400
+ "dir": {
1401
+ "description": "Specific entity directory to check status",
1402
+ "name": "dir",
1361
1403
  "hasDynamicHelp": false,
1362
1404
  "multiple": false,
1363
1405
  "type": "option"
1364
1406
  },
1365
- "exclude-entities": {
1366
- "char": "x",
1367
- "description": "Entities to exclude (comma-separated)",
1368
- "name": "exclude-entities",
1369
- "hasDynamicHelp": false,
1370
- "multiple": false,
1371
- "type": "option"
1407
+ "verbose": {
1408
+ "char": "v",
1409
+ "description": "Show detailed field-level differences",
1410
+ "name": "verbose",
1411
+ "allowNo": false,
1412
+ "type": "boolean"
1372
1413
  },
1373
- "exclude-schemas": {
1374
- "char": "s",
1375
- "description": "Schemas to exclude (comma-separated)",
1376
- "name": "exclude-schemas",
1414
+ "include": {
1415
+ "description": "Only process these directories (comma-separated, supports patterns)",
1416
+ "name": "include",
1377
1417
  "hasDynamicHelp": false,
1378
1418
  "multiple": false,
1379
1419
  "type": "option"
1380
1420
  },
1381
- "max-entities": {
1382
- "char": "m",
1383
- "description": "Max entities per group",
1384
- "name": "max-entities",
1385
- "default": 3,
1421
+ "exclude": {
1422
+ "description": "Skip these directories (comma-separated, supports patterns)",
1423
+ "name": "exclude",
1386
1424
  "hasDynamicHelp": false,
1387
1425
  "multiple": false,
1388
1426
  "type": "option"
1389
- },
1390
- "target-groups": {
1391
- "char": "t",
1392
- "description": "Target number of entity groups to generate",
1393
- "name": "target-groups",
1394
- "default": 75,
1427
+ }
1428
+ },
1429
+ "hasDynamicHelp": false,
1430
+ "hiddenAliases": [],
1431
+ "id": "sync:status",
1432
+ "pluginAlias": "@memberjunction/cli",
1433
+ "pluginName": "@memberjunction/cli",
1434
+ "pluginType": "core",
1435
+ "strict": true,
1436
+ "enableJsonFlag": false,
1437
+ "isESM": true,
1438
+ "relativePath": [
1439
+ "dist",
1440
+ "commands",
1441
+ "sync",
1442
+ "status.js"
1443
+ ]
1444
+ },
1445
+ "sync:validate": {
1446
+ "aliases": [],
1447
+ "args": {},
1448
+ "description": "Validate metadata files",
1449
+ "examples": [
1450
+ "<%= config.bin %> <%= command.id %>",
1451
+ "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1452
+ "<%= config.bin %> <%= command.id %> --save-report",
1453
+ "<%= config.bin %> <%= command.id %> --verbose"
1454
+ ],
1455
+ "flags": {
1456
+ "dir": {
1457
+ "description": "Specific entity directory to validate",
1458
+ "name": "dir",
1395
1459
  "hasDynamicHelp": false,
1396
1460
  "multiple": false,
1397
1461
  "type": "option"
1398
1462
  },
1399
- "max-refinements": {
1400
- "char": "r",
1401
- "description": "Max refinement iterations",
1402
- "name": "max-refinements",
1403
- "default": 3,
1404
- "hasDynamicHelp": false,
1405
- "multiple": false,
1406
- "type": "option"
1463
+ "verbose": {
1464
+ "char": "v",
1465
+ "description": "Show detailed validation output",
1466
+ "name": "verbose",
1467
+ "allowNo": false,
1468
+ "type": "boolean"
1407
1469
  },
1408
- "max-fixes": {
1409
- "char": "f",
1410
- "description": "Max error-fixing attempts",
1411
- "name": "max-fixes",
1412
- "default": 5,
1413
- "hasDynamicHelp": false,
1414
- "multiple": false,
1415
- "type": "option"
1470
+ "save-report": {
1471
+ "description": "Save validation report as markdown file",
1472
+ "name": "save-report",
1473
+ "allowNo": false,
1474
+ "type": "boolean"
1416
1475
  },
1417
- "model": {
1418
- "description": "Preferred AI model",
1419
- "name": "model",
1476
+ "output": {
1477
+ "description": "Output file path for validation report (default: validation-report.md)",
1478
+ "name": "output",
1420
1479
  "hasDynamicHelp": false,
1421
1480
  "multiple": false,
1422
1481
  "type": "option"
1423
- },
1424
- "vendor": {
1425
- "description": "Preferred AI vendor",
1426
- "name": "vendor",
1482
+ }
1483
+ },
1484
+ "hasDynamicHelp": false,
1485
+ "hiddenAliases": [],
1486
+ "id": "sync:validate",
1487
+ "pluginAlias": "@memberjunction/cli",
1488
+ "pluginName": "@memberjunction/cli",
1489
+ "pluginType": "core",
1490
+ "strict": true,
1491
+ "enableJsonFlag": false,
1492
+ "isESM": true,
1493
+ "relativePath": [
1494
+ "dist",
1495
+ "commands",
1496
+ "sync",
1497
+ "validate.js"
1498
+ ]
1499
+ },
1500
+ "sync:watch": {
1501
+ "aliases": [],
1502
+ "args": {},
1503
+ "description": "Watch for file changes and sync automatically",
1504
+ "examples": [
1505
+ "<%= config.bin %> <%= command.id %>",
1506
+ "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1507
+ "<%= config.bin %> <%= command.id %> --debounce=1000",
1508
+ "<%= config.bin %> <%= command.id %> --no-validate"
1509
+ ],
1510
+ "flags": {
1511
+ "dir": {
1512
+ "description": "Specific entity directory to watch",
1513
+ "name": "dir",
1427
1514
  "hasDynamicHelp": false,
1428
1515
  "multiple": false,
1429
1516
  "type": "option"
1430
1517
  },
1431
- "output": {
1432
- "char": "o",
1433
- "description": "Output directory",
1434
- "name": "output",
1518
+ "debounce": {
1519
+ "description": "Debounce delay in milliseconds (default: 500)",
1520
+ "name": "debounce",
1435
1521
  "hasDynamicHelp": false,
1436
1522
  "multiple": false,
1437
1523
  "type": "option"
1438
1524
  },
1439
- "mode": {
1440
- "description": "Output mode: metadata|database|both",
1441
- "name": "mode",
1442
- "hasDynamicHelp": false,
1443
- "multiple": false,
1444
- "options": [
1445
- "metadata",
1446
- "database",
1447
- "both"
1448
- ],
1449
- "type": "option"
1525
+ "no-validate": {
1526
+ "description": "Skip validation before sync",
1527
+ "name": "no-validate",
1528
+ "allowNo": false,
1529
+ "type": "boolean"
1450
1530
  },
1451
1531
  "verbose": {
1452
1532
  "char": "v",
1453
- "description": "Verbose output",
1533
+ "description": "Show detailed output",
1454
1534
  "name": "verbose",
1455
1535
  "allowNo": false,
1456
1536
  "type": "boolean"
@@ -1458,7 +1538,7 @@
1458
1538
  },
1459
1539
  "hasDynamicHelp": false,
1460
1540
  "hiddenAliases": [],
1461
- "id": "querygen:generate",
1541
+ "id": "sync:watch",
1462
1542
  "pluginAlias": "@memberjunction/cli",
1463
1543
  "pluginName": "@memberjunction/cli",
1464
1544
  "pluginType": "core",
@@ -1468,32 +1548,78 @@
1468
1548
  "relativePath": [
1469
1549
  "dist",
1470
1550
  "commands",
1471
- "querygen",
1472
- "generate.js"
1551
+ "sync",
1552
+ "watch.js"
1473
1553
  ]
1474
1554
  },
1475
- "querygen:validate": {
1555
+ "test:compare": {
1476
1556
  "aliases": [],
1477
- "args": {},
1478
- "description": "Validate existing query templates",
1557
+ "args": {
1558
+ "runId1": {
1559
+ "description": "First test run ID to compare",
1560
+ "name": "runId1",
1561
+ "required": false
1562
+ },
1563
+ "runId2": {
1564
+ "description": "Second test run ID to compare",
1565
+ "name": "runId2",
1566
+ "required": false
1567
+ }
1568
+ },
1569
+ "description": "Compare test runs for regression detection",
1479
1570
  "examples": [
1480
- "<%= config.bin %> <%= command.id %>",
1481
- "<%= config.bin %> <%= command.id %> --path ./metadata/queries",
1482
- "<%= config.bin %> <%= command.id %> --verbose"
1571
+ "<%= config.bin %> <%= command.id %> <run-id-1> <run-id-2>",
1572
+ "<%= config.bin %> <%= command.id %> --baseline=<run-id> --current=<run-id>",
1573
+ "<%= config.bin %> <%= command.id %> --suite=<suite-id> --since=\"2024-01-01\"",
1574
+ "<%= config.bin %> <%= command.id %> <run-id-1> <run-id-2> --format=json"
1483
1575
  ],
1484
1576
  "flags": {
1485
- "path": {
1486
- "char": "p",
1487
- "description": "Path to queries metadata file or directory",
1488
- "name": "path",
1489
- "default": "./metadata/queries",
1577
+ "version": {
1578
+ "char": "v",
1579
+ "description": "Compare runs by version",
1580
+ "name": "version",
1581
+ "hasDynamicHelp": false,
1582
+ "multiple": true,
1583
+ "type": "option"
1584
+ },
1585
+ "commit": {
1586
+ "char": "c",
1587
+ "description": "Compare runs by git commit",
1588
+ "name": "commit",
1589
+ "hasDynamicHelp": false,
1590
+ "multiple": true,
1591
+ "type": "option"
1592
+ },
1593
+ "diff-only": {
1594
+ "description": "Show only differences",
1595
+ "name": "diff-only",
1596
+ "allowNo": false,
1597
+ "type": "boolean"
1598
+ },
1599
+ "format": {
1600
+ "char": "f",
1601
+ "description": "Output format",
1602
+ "name": "format",
1603
+ "default": "console",
1604
+ "hasDynamicHelp": false,
1605
+ "multiple": false,
1606
+ "options": [
1607
+ "console",
1608
+ "json",
1609
+ "markdown"
1610
+ ],
1611
+ "type": "option"
1612
+ },
1613
+ "output": {
1614
+ "char": "o",
1615
+ "description": "Output file path",
1616
+ "name": "output",
1490
1617
  "hasDynamicHelp": false,
1491
1618
  "multiple": false,
1492
1619
  "type": "option"
1493
1620
  },
1494
1621
  "verbose": {
1495
- "char": "v",
1496
- "description": "Verbose output",
1622
+ "description": "Show detailed information",
1497
1623
  "name": "verbose",
1498
1624
  "allowNo": false,
1499
1625
  "type": "boolean"
@@ -1501,7 +1627,7 @@
1501
1627
  },
1502
1628
  "hasDynamicHelp": false,
1503
1629
  "hiddenAliases": [],
1504
- "id": "querygen:validate",
1630
+ "id": "test:compare",
1505
1631
  "pluginAlias": "@memberjunction/cli",
1506
1632
  "pluginName": "@memberjunction/cli",
1507
1633
  "pluginType": "core",
@@ -1511,56 +1637,78 @@
1511
1637
  "relativePath": [
1512
1638
  "dist",
1513
1639
  "commands",
1514
- "querygen",
1515
- "validate.js"
1640
+ "test",
1641
+ "compare.js"
1516
1642
  ]
1517
1643
  },
1518
- "sync:file-reset": {
1644
+ "test:history": {
1519
1645
  "aliases": [],
1520
1646
  "args": {},
1521
- "description": "Reset file metadata sections",
1647
+ "description": "View test execution history",
1522
1648
  "examples": [
1523
1649
  "<%= config.bin %> <%= command.id %>",
1524
- "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1525
- "<%= config.bin %> <%= command.id %> --sections=\"dependencies,references\"",
1526
- "<%= config.bin %> <%= command.id %> --all"
1650
+ "<%= config.bin %> <%= command.id %> --test=<test-id>",
1651
+ "<%= config.bin %> <%= command.id %> --suite=<suite-id>",
1652
+ "<%= config.bin %> <%= command.id %> --since=\"2024-01-01\"",
1653
+ "<%= config.bin %> <%= command.id %> --limit=50"
1527
1654
  ],
1528
1655
  "flags": {
1529
- "dir": {
1530
- "description": "Specific entity directory to reset",
1531
- "name": "dir",
1656
+ "test": {
1657
+ "char": "t",
1658
+ "description": "Filter by test ID",
1659
+ "name": "test",
1532
1660
  "hasDynamicHelp": false,
1533
1661
  "multiple": false,
1534
1662
  "type": "option"
1535
1663
  },
1536
- "sections": {
1537
- "description": "Comma-separated list of sections to reset (dependencies,references,related,lookup)",
1538
- "name": "sections",
1664
+ "recent": {
1665
+ "char": "r",
1666
+ "description": "Number of recent runs to show",
1667
+ "name": "recent",
1539
1668
  "hasDynamicHelp": false,
1540
1669
  "multiple": false,
1541
1670
  "type": "option"
1542
1671
  },
1543
- "all": {
1544
- "description": "Reset all metadata sections",
1545
- "name": "all",
1546
- "allowNo": false,
1547
- "type": "boolean"
1672
+ "from": {
1673
+ "description": "Show history from date (YYYY-MM-DD)",
1674
+ "name": "from",
1675
+ "hasDynamicHelp": false,
1676
+ "multiple": false,
1677
+ "type": "option"
1548
1678
  },
1549
- "dry-run": {
1550
- "description": "Show what would be reset without actually resetting",
1551
- "name": "dry-run",
1552
- "allowNo": false,
1553
- "type": "boolean"
1679
+ "status": {
1680
+ "char": "s",
1681
+ "description": "Filter by status",
1682
+ "name": "status",
1683
+ "hasDynamicHelp": false,
1684
+ "multiple": false,
1685
+ "type": "option"
1554
1686
  },
1555
- "force": {
1556
- "description": "Skip confirmation prompts",
1557
- "name": "force",
1558
- "allowNo": false,
1559
- "type": "boolean"
1687
+ "format": {
1688
+ "char": "f",
1689
+ "description": "Output format",
1690
+ "name": "format",
1691
+ "default": "console",
1692
+ "hasDynamicHelp": false,
1693
+ "multiple": false,
1694
+ "options": [
1695
+ "console",
1696
+ "json",
1697
+ "markdown"
1698
+ ],
1699
+ "type": "option"
1700
+ },
1701
+ "output": {
1702
+ "char": "o",
1703
+ "description": "Output file path",
1704
+ "name": "output",
1705
+ "hasDynamicHelp": false,
1706
+ "multiple": false,
1707
+ "type": "option"
1560
1708
  },
1561
1709
  "verbose": {
1562
1710
  "char": "v",
1563
- "description": "Show detailed output",
1711
+ "description": "Show detailed information",
1564
1712
  "name": "verbose",
1565
1713
  "allowNo": false,
1566
1714
  "type": "boolean"
@@ -1568,7 +1716,7 @@
1568
1716
  },
1569
1717
  "hasDynamicHelp": false,
1570
1718
  "hiddenAliases": [],
1571
- "id": "sync:file-reset",
1719
+ "id": "test:history",
1572
1720
  "pluginAlias": "@memberjunction/cli",
1573
1721
  "pluginName": "@memberjunction/cli",
1574
1722
  "pluginType": "core",
@@ -1578,21 +1726,26 @@
1578
1726
  "relativePath": [
1579
1727
  "dist",
1580
1728
  "commands",
1581
- "sync",
1582
- "file-reset.js"
1729
+ "test",
1730
+ "history.js"
1583
1731
  ]
1584
1732
  },
1585
- "sync:init": {
1733
+ "test": {
1586
1734
  "aliases": [],
1587
1735
  "args": {},
1588
- "description": "Initialize a directory for metadata synchronization",
1736
+ "description": "MemberJunction Testing Framework - Execute and manage tests",
1589
1737
  "examples": [
1590
- "<%= config.bin %> <%= command.id %>"
1738
+ "<%= config.bin %> <%= command.id %> run <test-id>",
1739
+ "<%= config.bin %> <%= command.id %> run --name=\"Active Members Count\"",
1740
+ "<%= config.bin %> <%= command.id %> suite <suite-id>",
1741
+ "<%= config.bin %> <%= command.id %> list",
1742
+ "<%= config.bin %> <%= command.id %> list --suites",
1743
+ "<%= config.bin %> <%= command.id %> validate --all"
1591
1744
  ],
1592
1745
  "flags": {},
1593
1746
  "hasDynamicHelp": false,
1594
1747
  "hiddenAliases": [],
1595
- "id": "sync:init",
1748
+ "id": "test",
1596
1749
  "pluginAlias": "@memberjunction/cli",
1597
1750
  "pluginName": "@memberjunction/cli",
1598
1751
  "pluginType": "core",
@@ -1602,127 +1755,177 @@
1602
1755
  "relativePath": [
1603
1756
  "dist",
1604
1757
  "commands",
1605
- "sync",
1606
- "init.js"
1758
+ "test",
1759
+ "index.js"
1607
1760
  ]
1608
1761
  },
1609
- "sync:pull": {
1762
+ "test:list": {
1610
1763
  "aliases": [],
1611
1764
  "args": {},
1612
- "description": "Pull metadata from database to local files",
1765
+ "description": "List available tests, suites, and types",
1613
1766
  "examples": [
1614
- "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Prompts\"",
1615
- "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Prompts\" --filter=\"CategoryID='customer-service-id'\"",
1616
- "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Agents\" --merge-strategy=overwrite",
1617
- "<%= config.bin %> <%= command.id %> --entity=\"Actions\" --target-dir=./custom-actions --no-validate",
1618
- "<%= config.bin %> <%= command.id %> --entity=\"Templates\" --dry-run --verbose",
1619
- "<%= config.bin %> <%= command.id %> --entity=\"MJ: AI Prompts\" --exclude-fields=InternalNotes,DebugInfo"
1767
+ "<%= config.bin %> <%= command.id %>",
1768
+ "<%= config.bin %> <%= command.id %> --suites",
1769
+ "<%= config.bin %> <%= command.id %> --types",
1770
+ "<%= config.bin %> <%= command.id %> --type=agent-eval",
1771
+ "<%= config.bin %> <%= command.id %> --tag=smoke",
1772
+ "<%= config.bin %> <%= command.id %> --status=active --verbose"
1620
1773
  ],
1621
1774
  "flags": {
1622
- "entity": {
1623
- "description": "Entity name to pull",
1624
- "name": "entity",
1625
- "required": true,
1775
+ "suites": {
1776
+ "description": "List test suites instead of tests",
1777
+ "name": "suites",
1778
+ "allowNo": false,
1779
+ "type": "boolean"
1780
+ },
1781
+ "types": {
1782
+ "description": "List test types",
1783
+ "name": "types",
1784
+ "allowNo": false,
1785
+ "type": "boolean"
1786
+ },
1787
+ "type": {
1788
+ "char": "t",
1789
+ "description": "Filter by test type",
1790
+ "name": "type",
1626
1791
  "hasDynamicHelp": false,
1627
1792
  "multiple": false,
1628
1793
  "type": "option"
1629
1794
  },
1630
- "filter": {
1631
- "description": "Additional filter for pulling specific records",
1632
- "name": "filter",
1795
+ "tag": {
1796
+ "description": "Filter by tag",
1797
+ "name": "tag",
1633
1798
  "hasDynamicHelp": false,
1634
1799
  "multiple": false,
1635
1800
  "type": "option"
1636
1801
  },
1637
- "dry-run": {
1638
- "description": "Show what would be pulled without actually pulling",
1639
- "name": "dry-run",
1640
- "allowNo": false,
1641
- "type": "boolean"
1802
+ "status": {
1803
+ "char": "s",
1804
+ "description": "Filter by status",
1805
+ "name": "status",
1806
+ "hasDynamicHelp": false,
1807
+ "multiple": false,
1808
+ "type": "option"
1642
1809
  },
1643
- "multi-file": {
1644
- "description": "Create a single file with multiple records (provide filename)",
1645
- "name": "multi-file",
1810
+ "format": {
1811
+ "char": "f",
1812
+ "description": "Output format",
1813
+ "name": "format",
1814
+ "default": "console",
1815
+ "hasDynamicHelp": false,
1816
+ "multiple": false,
1817
+ "options": [
1818
+ "console",
1819
+ "json",
1820
+ "markdown"
1821
+ ],
1822
+ "type": "option"
1823
+ },
1824
+ "output": {
1825
+ "char": "o",
1826
+ "description": "Output file path",
1827
+ "name": "output",
1646
1828
  "hasDynamicHelp": false,
1647
1829
  "multiple": false,
1648
1830
  "type": "option"
1649
1831
  },
1650
1832
  "verbose": {
1651
1833
  "char": "v",
1652
- "description": "Show detailed output",
1834
+ "description": "Show detailed information",
1653
1835
  "name": "verbose",
1654
1836
  "allowNo": false,
1655
1837
  "type": "boolean"
1656
- },
1657
- "no-validate": {
1658
- "description": "Skip validation before pull",
1659
- "name": "no-validate",
1660
- "allowNo": false,
1661
- "type": "boolean"
1662
- },
1663
- "update-existing": {
1664
- "description": "Update existing records during pull",
1665
- "name": "update-existing",
1666
- "allowNo": false,
1667
- "type": "boolean"
1668
- },
1669
- "create-new": {
1670
- "description": "Create new files for records not found locally",
1671
- "name": "create-new",
1672
- "allowNo": false,
1673
- "type": "boolean"
1674
- },
1675
- "backup-before-update": {
1676
- "description": "Create backups before updating files",
1677
- "name": "backup-before-update",
1678
- "allowNo": false,
1679
- "type": "boolean"
1680
- },
1681
- "merge-strategy": {
1682
- "description": "Merge strategy for updates",
1683
- "name": "merge-strategy",
1684
- "default": "merge",
1838
+ }
1839
+ },
1840
+ "hasDynamicHelp": false,
1841
+ "hiddenAliases": [],
1842
+ "id": "test:list",
1843
+ "pluginAlias": "@memberjunction/cli",
1844
+ "pluginName": "@memberjunction/cli",
1845
+ "pluginType": "core",
1846
+ "strict": true,
1847
+ "enableJsonFlag": false,
1848
+ "isESM": true,
1849
+ "relativePath": [
1850
+ "dist",
1851
+ "commands",
1852
+ "test",
1853
+ "list.js"
1854
+ ]
1855
+ },
1856
+ "test:run": {
1857
+ "aliases": [],
1858
+ "args": {
1859
+ "testId": {
1860
+ "description": "Test ID to execute",
1861
+ "name": "testId",
1862
+ "required": false
1863
+ }
1864
+ },
1865
+ "description": "Execute a single test by ID or name",
1866
+ "examples": [
1867
+ "<%= config.bin %> <%= command.id %> <test-id>",
1868
+ "<%= config.bin %> <%= command.id %> --name=\"Active Members Count\"",
1869
+ "<%= config.bin %> <%= command.id %> <test-id> --environment=staging",
1870
+ "<%= config.bin %> <%= command.id %> <test-id> --format=json --output=results.json",
1871
+ "<%= config.bin %> <%= command.id %> <test-id> --dry-run"
1872
+ ],
1873
+ "flags": {
1874
+ "name": {
1875
+ "char": "n",
1876
+ "description": "Test name to execute",
1877
+ "name": "name",
1685
1878
  "hasDynamicHelp": false,
1686
1879
  "multiple": false,
1687
- "options": [
1688
- "merge",
1689
- "overwrite",
1690
- "skip"
1691
- ],
1692
1880
  "type": "option"
1693
1881
  },
1694
- "backup-directory": {
1695
- "description": "Custom backup directory (default: .backups)",
1696
- "name": "backup-directory",
1882
+ "environment": {
1883
+ "char": "e",
1884
+ "description": "Environment context (dev, staging, prod)",
1885
+ "name": "environment",
1697
1886
  "hasDynamicHelp": false,
1698
1887
  "multiple": false,
1699
1888
  "type": "option"
1700
1889
  },
1701
- "preserve-fields": {
1702
- "description": "Comma-separated list of fields to preserve during updates",
1703
- "name": "preserve-fields",
1704
- "hasDynamicHelp": false,
1705
- "multiple": true,
1706
- "type": "option"
1707
- },
1708
- "exclude-fields": {
1709
- "description": "Comma-separated list of fields to exclude from pull",
1710
- "name": "exclude-fields",
1890
+ "format": {
1891
+ "char": "f",
1892
+ "description": "Output format",
1893
+ "name": "format",
1894
+ "default": "console",
1711
1895
  "hasDynamicHelp": false,
1712
- "multiple": true,
1896
+ "multiple": false,
1897
+ "options": [
1898
+ "console",
1899
+ "json",
1900
+ "markdown"
1901
+ ],
1713
1902
  "type": "option"
1714
1903
  },
1715
- "target-dir": {
1716
- "description": "Specific target directory (overrides auto-discovery)",
1717
- "name": "target-dir",
1904
+ "output": {
1905
+ "char": "o",
1906
+ "description": "Output file path",
1907
+ "name": "output",
1718
1908
  "hasDynamicHelp": false,
1719
1909
  "multiple": false,
1720
1910
  "type": "option"
1911
+ },
1912
+ "dry-run": {
1913
+ "description": "Validate without executing",
1914
+ "name": "dry-run",
1915
+ "allowNo": false,
1916
+ "type": "boolean"
1917
+ },
1918
+ "verbose": {
1919
+ "char": "v",
1920
+ "description": "Show detailed execution information",
1921
+ "name": "verbose",
1922
+ "allowNo": false,
1923
+ "type": "boolean"
1721
1924
  }
1722
1925
  },
1723
1926
  "hasDynamicHelp": false,
1724
1927
  "hiddenAliases": [],
1725
- "id": "sync:pull",
1928
+ "id": "test:run",
1726
1929
  "pluginAlias": "@memberjunction/cli",
1727
1930
  "pluginName": "@memberjunction/cli",
1728
1931
  "pluginType": "core",
@@ -1732,85 +1935,68 @@
1732
1935
  "relativePath": [
1733
1936
  "dist",
1734
1937
  "commands",
1735
- "sync",
1736
- "pull.js"
1938
+ "test",
1939
+ "run.js"
1737
1940
  ]
1738
1941
  },
1739
- "sync:push": {
1942
+ "test:suite": {
1740
1943
  "aliases": [],
1741
- "args": {},
1742
- "description": "Push local file changes to the database",
1944
+ "args": {
1945
+ "suiteId": {
1946
+ "description": "Test suite ID to execute",
1947
+ "name": "suiteId",
1948
+ "required": false
1949
+ }
1950
+ },
1951
+ "description": "Execute a test suite",
1743
1952
  "examples": [
1744
- "<%= config.bin %> <%= command.id %>",
1745
- "<%= config.bin %> <%= command.id %> --dry-run",
1746
- "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1747
- "<%= config.bin %> <%= command.id %> --ci"
1953
+ "<%= config.bin %> <%= command.id %> <suite-id>",
1954
+ "<%= config.bin %> <%= command.id %> --name=\"Agent Quality Suite\"",
1955
+ "<%= config.bin %> <%= command.id %> <suite-id> --format=json",
1956
+ "<%= config.bin %> <%= command.id %> <suite-id> --output=suite-results.json"
1748
1957
  ],
1749
1958
  "flags": {
1750
- "dir": {
1751
- "description": "Specific entity directory to push",
1752
- "name": "dir",
1959
+ "name": {
1960
+ "char": "n",
1961
+ "description": "Test suite name to execute",
1962
+ "name": "name",
1753
1963
  "hasDynamicHelp": false,
1754
1964
  "multiple": false,
1755
1965
  "type": "option"
1756
1966
  },
1757
- "dry-run": {
1758
- "description": "Show what would be pushed without actually pushing",
1759
- "name": "dry-run",
1760
- "allowNo": false,
1761
- "type": "boolean"
1762
- },
1763
- "ci": {
1764
- "description": "CI mode - no prompts, fail on issues",
1765
- "name": "ci",
1766
- "allowNo": false,
1767
- "type": "boolean"
1768
- },
1769
- "verbose": {
1770
- "char": "v",
1771
- "description": "Show detailed field-level output",
1772
- "name": "verbose",
1773
- "allowNo": false,
1774
- "type": "boolean"
1775
- },
1776
- "no-validate": {
1777
- "description": "Skip validation before push",
1778
- "name": "no-validate",
1779
- "allowNo": false,
1780
- "type": "boolean"
1781
- },
1782
- "delete-db-only": {
1783
- "description": "Delete database-only records that reference records being deleted (prevents FK errors)",
1784
- "name": "delete-db-only",
1785
- "allowNo": false,
1786
- "type": "boolean"
1787
- },
1788
- "parallel-batch-size": {
1789
- "description": "Number of records to process in parallel (default: 10)",
1790
- "name": "parallel-batch-size",
1791
- "default": 10,
1967
+ "format": {
1968
+ "char": "f",
1969
+ "description": "Output format",
1970
+ "name": "format",
1971
+ "default": "console",
1792
1972
  "hasDynamicHelp": false,
1793
1973
  "multiple": false,
1974
+ "options": [
1975
+ "console",
1976
+ "json",
1977
+ "markdown"
1978
+ ],
1794
1979
  "type": "option"
1795
1980
  },
1796
- "include": {
1797
- "description": "Only process these directories (comma-separated, supports patterns)",
1798
- "name": "include",
1981
+ "output": {
1982
+ "char": "o",
1983
+ "description": "Output file path",
1984
+ "name": "output",
1799
1985
  "hasDynamicHelp": false,
1800
1986
  "multiple": false,
1801
1987
  "type": "option"
1802
1988
  },
1803
- "exclude": {
1804
- "description": "Skip these directories (comma-separated, supports patterns)",
1805
- "name": "exclude",
1806
- "hasDynamicHelp": false,
1807
- "multiple": false,
1808
- "type": "option"
1989
+ "verbose": {
1990
+ "char": "v",
1991
+ "description": "Show detailed execution information",
1992
+ "name": "verbose",
1993
+ "allowNo": false,
1994
+ "type": "boolean"
1809
1995
  }
1810
1996
  },
1811
1997
  "hasDynamicHelp": false,
1812
1998
  "hiddenAliases": [],
1813
- "id": "sync:push",
1999
+ "id": "test:suite",
1814
2000
  "pluginAlias": "@memberjunction/cli",
1815
2001
  "pluginName": "@memberjunction/cli",
1816
2002
  "pluginType": "core",
@@ -1820,52 +2006,82 @@
1820
2006
  "relativePath": [
1821
2007
  "dist",
1822
2008
  "commands",
1823
- "sync",
1824
- "push.js"
2009
+ "test",
2010
+ "suite.js"
1825
2011
  ]
1826
2012
  },
1827
- "sync:status": {
2013
+ "test:validate": {
1828
2014
  "aliases": [],
1829
- "args": {},
1830
- "description": "Show status of local files vs database",
2015
+ "args": {
2016
+ "testId": {
2017
+ "description": "Test ID to validate",
2018
+ "name": "testId",
2019
+ "required": false
2020
+ }
2021
+ },
2022
+ "description": "Validate test definitions without executing",
1831
2023
  "examples": [
1832
- "<%= config.bin %> <%= command.id %>",
1833
- "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1834
- "<%= config.bin %> <%= command.id %> --verbose"
2024
+ "<%= config.bin %> <%= command.id %> <test-id>",
2025
+ "<%= config.bin %> <%= command.id %> --all",
2026
+ "<%= config.bin %> <%= command.id %> --type=agent-eval",
2027
+ "<%= config.bin %> <%= command.id %> --all --save-report",
2028
+ "<%= config.bin %> <%= command.id %> --all --output=validation-report.md"
1835
2029
  ],
1836
2030
  "flags": {
1837
- "dir": {
1838
- "description": "Specific entity directory to check status",
1839
- "name": "dir",
2031
+ "all": {
2032
+ "char": "a",
2033
+ "description": "Validate all tests",
2034
+ "name": "all",
2035
+ "allowNo": false,
2036
+ "type": "boolean"
2037
+ },
2038
+ "type": {
2039
+ "char": "t",
2040
+ "description": "Validate tests by type",
2041
+ "name": "type",
1840
2042
  "hasDynamicHelp": false,
1841
2043
  "multiple": false,
1842
2044
  "type": "option"
1843
2045
  },
1844
- "verbose": {
1845
- "char": "v",
1846
- "description": "Show detailed field-level differences",
1847
- "name": "verbose",
2046
+ "save-report": {
2047
+ "description": "Save validation report to file",
2048
+ "name": "save-report",
1848
2049
  "allowNo": false,
1849
2050
  "type": "boolean"
1850
2051
  },
1851
- "include": {
1852
- "description": "Only process these directories (comma-separated, supports patterns)",
1853
- "name": "include",
2052
+ "format": {
2053
+ "char": "f",
2054
+ "description": "Output format",
2055
+ "name": "format",
2056
+ "default": "console",
1854
2057
  "hasDynamicHelp": false,
1855
2058
  "multiple": false,
2059
+ "options": [
2060
+ "console",
2061
+ "json",
2062
+ "markdown"
2063
+ ],
1856
2064
  "type": "option"
1857
2065
  },
1858
- "exclude": {
1859
- "description": "Skip these directories (comma-separated, supports patterns)",
1860
- "name": "exclude",
2066
+ "output": {
2067
+ "char": "o",
2068
+ "description": "Output file path",
2069
+ "name": "output",
1861
2070
  "hasDynamicHelp": false,
1862
2071
  "multiple": false,
1863
2072
  "type": "option"
2073
+ },
2074
+ "verbose": {
2075
+ "char": "v",
2076
+ "description": "Show detailed information",
2077
+ "name": "verbose",
2078
+ "allowNo": false,
2079
+ "type": "boolean"
1864
2080
  }
1865
2081
  },
1866
2082
  "hasDynamicHelp": false,
1867
2083
  "hiddenAliases": [],
1868
- "id": "sync:status",
2084
+ "id": "test:validate",
1869
2085
  "pluginAlias": "@memberjunction/cli",
1870
2086
  "pluginName": "@memberjunction/cli",
1871
2087
  "pluginType": "core",
@@ -1875,44 +2091,34 @@
1875
2091
  "relativePath": [
1876
2092
  "dist",
1877
2093
  "commands",
1878
- "sync",
1879
- "status.js"
2094
+ "test",
2095
+ "validate.js"
1880
2096
  ]
1881
2097
  },
1882
- "sync:validate": {
2098
+ "dbdoc:analyze": {
1883
2099
  "aliases": [],
1884
2100
  "args": {},
1885
- "description": "Validate metadata files",
2101
+ "description": "Analyze database and generate documentation (delegates to db-auto-doc analyze)",
1886
2102
  "examples": [
1887
2103
  "<%= config.bin %> <%= command.id %>",
1888
- "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1889
- "<%= config.bin %> <%= command.id %> --save-report",
1890
- "<%= config.bin %> <%= command.id %> --verbose"
2104
+ "<%= config.bin %> <%= command.id %> --resume ./output/run-6/state.json",
2105
+ "<%= config.bin %> <%= command.id %> --config ./my-config.json"
1891
2106
  ],
1892
2107
  "flags": {
1893
- "dir": {
1894
- "description": "Specific entity directory to validate",
1895
- "name": "dir",
2108
+ "resume": {
2109
+ "char": "r",
2110
+ "description": "Resume from an existing state file",
2111
+ "name": "resume",
2112
+ "required": false,
1896
2113
  "hasDynamicHelp": false,
1897
2114
  "multiple": false,
1898
2115
  "type": "option"
1899
2116
  },
1900
- "verbose": {
1901
- "char": "v",
1902
- "description": "Show detailed validation output",
1903
- "name": "verbose",
1904
- "allowNo": false,
1905
- "type": "boolean"
1906
- },
1907
- "save-report": {
1908
- "description": "Save validation report as markdown file",
1909
- "name": "save-report",
1910
- "allowNo": false,
1911
- "type": "boolean"
1912
- },
1913
- "output": {
1914
- "description": "Output file path for validation report (default: validation-report.md)",
1915
- "name": "output",
2117
+ "config": {
2118
+ "char": "c",
2119
+ "description": "Path to config file",
2120
+ "name": "config",
2121
+ "default": "./config.json",
1916
2122
  "hasDynamicHelp": false,
1917
2123
  "multiple": false,
1918
2124
  "type": "option"
@@ -1920,7 +2126,7 @@
1920
2126
  },
1921
2127
  "hasDynamicHelp": false,
1922
2128
  "hiddenAliases": [],
1923
- "id": "sync:validate",
2129
+ "id": "dbdoc:analyze",
1924
2130
  "pluginAlias": "@memberjunction/cli",
1925
2131
  "pluginName": "@memberjunction/cli",
1926
2132
  "pluginType": "core",
@@ -1930,52 +2136,105 @@
1930
2136
  "relativePath": [
1931
2137
  "dist",
1932
2138
  "commands",
1933
- "sync",
1934
- "validate.js"
2139
+ "dbdoc",
2140
+ "analyze.js"
1935
2141
  ]
1936
2142
  },
1937
- "sync:watch": {
2143
+ "dbdoc:export-sample-queries": {
1938
2144
  "aliases": [],
1939
2145
  "args": {},
1940
- "description": "Watch for file changes and sync automatically",
2146
+ "description": "Export sample queries to MemberJunction metadata format (delegates to db-auto-doc export-sample-queries)",
1941
2147
  "examples": [
1942
- "<%= config.bin %> <%= command.id %>",
1943
- "<%= config.bin %> <%= command.id %> --dir=\"ai-prompts\"",
1944
- "<%= config.bin %> <%= command.id %> --debounce=1000",
1945
- "<%= config.bin %> <%= command.id %> --no-validate"
2148
+ "<%= config.bin %> <%= command.id %> --input ./output/sample-queries.json --output ./metadata/queries/.queries.json",
2149
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./metadata/queries/.queries.json --separate-sql-files",
2150
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --category \"Database Documentation\"",
2151
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --status Pending --min-confidence 0.8"
1946
2152
  ],
1947
2153
  "flags": {
1948
- "dir": {
1949
- "description": "Specific entity directory to watch",
1950
- "name": "dir",
2154
+ "input": {
2155
+ "char": "i",
2156
+ "description": "Path to sample-queries.json file generated by generate-queries command",
2157
+ "name": "input",
2158
+ "required": true,
2159
+ "hasDynamicHelp": false,
2160
+ "multiple": false,
2161
+ "type": "option"
2162
+ },
2163
+ "output": {
2164
+ "char": "o",
2165
+ "description": "Output path for the .queries.json metadata file",
2166
+ "name": "output",
2167
+ "required": true,
2168
+ "hasDynamicHelp": false,
2169
+ "multiple": false,
2170
+ "type": "option"
2171
+ },
2172
+ "separate-sql-files": {
2173
+ "description": "Write SQL to separate files and use @file: references",
2174
+ "name": "separate-sql-files",
2175
+ "allowNo": false,
2176
+ "type": "boolean"
2177
+ },
2178
+ "sql-dir": {
2179
+ "description": "Directory for SQL files when using --separate-sql-files (relative to output file)",
2180
+ "name": "sql-dir",
2181
+ "default": "SQL",
2182
+ "hasDynamicHelp": false,
2183
+ "multiple": false,
2184
+ "type": "option"
2185
+ },
2186
+ "category": {
2187
+ "description": "Category name for @lookup reference (e.g., \"Database Documentation\")",
2188
+ "name": "category",
2189
+ "required": false,
2190
+ "hasDynamicHelp": false,
2191
+ "multiple": false,
2192
+ "type": "option"
2193
+ },
2194
+ "status": {
2195
+ "description": "Status to assign to exported queries",
2196
+ "name": "status",
2197
+ "default": "Pending",
1951
2198
  "hasDynamicHelp": false,
1952
2199
  "multiple": false,
2200
+ "options": [
2201
+ "Approved",
2202
+ "Pending",
2203
+ "Rejected",
2204
+ "Expired"
2205
+ ],
1953
2206
  "type": "option"
1954
2207
  },
1955
- "debounce": {
1956
- "description": "Debounce delay in milliseconds (default: 500)",
1957
- "name": "debounce",
2208
+ "min-confidence": {
2209
+ "description": "Minimum confidence threshold to export (0-1)",
2210
+ "name": "min-confidence",
2211
+ "default": "0",
1958
2212
  "hasDynamicHelp": false,
1959
2213
  "multiple": false,
1960
2214
  "type": "option"
1961
2215
  },
1962
- "no-validate": {
1963
- "description": "Skip validation before sync",
1964
- "name": "no-validate",
2216
+ "validated-only": {
2217
+ "description": "Only export queries that were successfully validated",
2218
+ "name": "validated-only",
1965
2219
  "allowNo": false,
1966
2220
  "type": "boolean"
1967
2221
  },
1968
- "verbose": {
1969
- "char": "v",
1970
- "description": "Show detailed output",
1971
- "name": "verbose",
2222
+ "append": {
2223
+ "description": "Append to existing metadata file instead of overwriting",
2224
+ "name": "append",
2225
+ "allowNo": false,
2226
+ "type": "boolean"
2227
+ },
2228
+ "include-primary-key": {
2229
+ "description": "Include primaryKey and sync fields (for updating existing records)",
2230
+ "name": "include-primary-key",
1972
2231
  "allowNo": false,
1973
2232
  "type": "boolean"
1974
2233
  }
1975
2234
  },
1976
2235
  "hasDynamicHelp": false,
1977
2236
  "hiddenAliases": [],
1978
- "id": "sync:watch",
2237
+ "id": "dbdoc:export-sample-queries",
1979
2238
  "pluginAlias": "@memberjunction/cli",
1980
2239
  "pluginName": "@memberjunction/cli",
1981
2240
  "pluginType": "core",
@@ -1985,86 +2244,100 @@
1985
2244
  "relativePath": [
1986
2245
  "dist",
1987
2246
  "commands",
1988
- "sync",
1989
- "watch.js"
2247
+ "dbdoc",
2248
+ "export-sample-queries.js"
1990
2249
  ]
1991
2250
  },
1992
- "test:compare": {
2251
+ "dbdoc:export": {
1993
2252
  "aliases": [],
1994
- "args": {
1995
- "runId1": {
1996
- "description": "First test run ID to compare",
1997
- "name": "runId1",
1998
- "required": false
1999
- },
2000
- "runId2": {
2001
- "description": "Second test run ID to compare",
2002
- "name": "runId2",
2003
- "required": false
2004
- }
2005
- },
2006
- "description": "Compare test runs for regression detection",
2253
+ "args": {},
2254
+ "description": "Export documentation in multiple formats (delegates to db-auto-doc export)",
2007
2255
  "examples": [
2008
- "<%= config.bin %> <%= command.id %> <run-id-1> <run-id-2>",
2009
- "<%= config.bin %> <%= command.id %> --baseline=<run-id> --current=<run-id>",
2010
- "<%= config.bin %> <%= command.id %> --suite=<suite-id> --since=\"2024-01-01\"",
2011
- "<%= config.bin %> <%= command.id %> <run-id-1> <run-id-2> --format=json"
2256
+ "<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json",
2257
+ "<%= config.bin %> <%= command.id %> --sql",
2258
+ "<%= config.bin %> <%= command.id %> --markdown",
2259
+ "<%= config.bin %> <%= command.id %> --html",
2260
+ "<%= config.bin %> <%= command.id %> --csv",
2261
+ "<%= config.bin %> <%= command.id %> --mermaid",
2262
+ "<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply"
2012
2263
  ],
2013
2264
  "flags": {
2014
- "version": {
2015
- "char": "v",
2016
- "description": "Compare runs by version",
2017
- "name": "version",
2265
+ "state-file": {
2266
+ "char": "s",
2267
+ "description": "Path to state JSON file",
2268
+ "name": "state-file",
2018
2269
  "hasDynamicHelp": false,
2019
- "multiple": true,
2270
+ "multiple": false,
2020
2271
  "type": "option"
2021
2272
  },
2022
- "commit": {
2023
- "char": "c",
2024
- "description": "Compare runs by git commit",
2025
- "name": "commit",
2273
+ "output-dir": {
2274
+ "char": "o",
2275
+ "description": "Output directory for generated files",
2276
+ "name": "output-dir",
2026
2277
  "hasDynamicHelp": false,
2027
- "multiple": true,
2278
+ "multiple": false,
2028
2279
  "type": "option"
2029
2280
  },
2030
- "diff-only": {
2031
- "description": "Show only differences",
2032
- "name": "diff-only",
2281
+ "sql": {
2282
+ "description": "Generate SQL script",
2283
+ "name": "sql",
2033
2284
  "allowNo": false,
2034
2285
  "type": "boolean"
2035
2286
  },
2036
- "format": {
2037
- "char": "f",
2038
- "description": "Output format",
2039
- "name": "format",
2040
- "default": "console",
2041
- "hasDynamicHelp": false,
2042
- "multiple": false,
2043
- "options": [
2044
- "console",
2045
- "json",
2046
- "markdown"
2047
- ],
2048
- "type": "option"
2287
+ "markdown": {
2288
+ "description": "Generate Markdown documentation",
2289
+ "name": "markdown",
2290
+ "allowNo": false,
2291
+ "type": "boolean"
2049
2292
  },
2050
- "output": {
2051
- "char": "o",
2052
- "description": "Output file path",
2053
- "name": "output",
2054
- "hasDynamicHelp": false,
2055
- "multiple": false,
2056
- "type": "option"
2293
+ "html": {
2294
+ "description": "Generate interactive HTML documentation",
2295
+ "name": "html",
2296
+ "allowNo": false,
2297
+ "type": "boolean"
2057
2298
  },
2058
- "verbose": {
2059
- "description": "Show detailed information",
2060
- "name": "verbose",
2299
+ "csv": {
2300
+ "description": "Generate CSV exports (tables and columns)",
2301
+ "name": "csv",
2302
+ "allowNo": false,
2303
+ "type": "boolean"
2304
+ },
2305
+ "mermaid": {
2306
+ "description": "Generate Mermaid ERD diagram files",
2307
+ "name": "mermaid",
2308
+ "allowNo": false,
2309
+ "type": "boolean"
2310
+ },
2311
+ "report": {
2312
+ "description": "Generate analysis report",
2313
+ "name": "report",
2314
+ "allowNo": false,
2315
+ "type": "boolean"
2316
+ },
2317
+ "apply": {
2318
+ "description": "Apply SQL to database",
2319
+ "name": "apply",
2320
+ "allowNo": false,
2321
+ "type": "boolean"
2322
+ },
2323
+ "approved-only": {
2324
+ "description": "Only export approved items",
2325
+ "name": "approved-only",
2061
2326
  "allowNo": false,
2062
2327
  "type": "boolean"
2328
+ },
2329
+ "confidence-threshold": {
2330
+ "description": "Minimum confidence threshold",
2331
+ "name": "confidence-threshold",
2332
+ "default": "0",
2333
+ "hasDynamicHelp": false,
2334
+ "multiple": false,
2335
+ "type": "option"
2063
2336
  }
2064
2337
  },
2065
2338
  "hasDynamicHelp": false,
2066
2339
  "hiddenAliases": [],
2067
- "id": "test:compare",
2340
+ "id": "dbdoc:export",
2068
2341
  "pluginAlias": "@memberjunction/cli",
2069
2342
  "pluginName": "@memberjunction/cli",
2070
2343
  "pluginType": "core",
@@ -2074,86 +2347,87 @@
2074
2347
  "relativePath": [
2075
2348
  "dist",
2076
2349
  "commands",
2077
- "test",
2078
- "compare.js"
2350
+ "dbdoc",
2351
+ "export.js"
2079
2352
  ]
2080
2353
  },
2081
- "test:history": {
2354
+ "dbdoc:generate-queries": {
2082
2355
  "aliases": [],
2083
2356
  "args": {},
2084
- "description": "View test execution history",
2357
+ "description": "Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)",
2085
2358
  "examples": [
2086
- "<%= config.bin %> <%= command.id %>",
2087
- "<%= config.bin %> <%= command.id %> --test=<test-id>",
2088
- "<%= config.bin %> <%= command.id %> --suite=<suite-id>",
2089
- "<%= config.bin %> <%= command.id %> --since=\"2024-01-01\"",
2090
- "<%= config.bin %> <%= command.id %> --limit=50"
2359
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json",
2360
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries",
2361
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10"
2091
2362
  ],
2092
2363
  "flags": {
2093
- "test": {
2094
- "char": "t",
2095
- "description": "Filter by test ID",
2096
- "name": "test",
2097
- "hasDynamicHelp": false,
2098
- "multiple": false,
2099
- "type": "option"
2100
- },
2101
- "recent": {
2102
- "char": "r",
2103
- "description": "Number of recent runs to show",
2104
- "name": "recent",
2364
+ "from-state": {
2365
+ "description": "Path to existing state.json file from previous analysis",
2366
+ "name": "from-state",
2367
+ "required": true,
2105
2368
  "hasDynamicHelp": false,
2106
2369
  "multiple": false,
2107
2370
  "type": "option"
2108
2371
  },
2109
- "from": {
2110
- "description": "Show history from date (YYYY-MM-DD)",
2111
- "name": "from",
2372
+ "output-dir": {
2373
+ "description": "Output directory for generated queries",
2374
+ "name": "output-dir",
2375
+ "required": false,
2112
2376
  "hasDynamicHelp": false,
2113
2377
  "multiple": false,
2114
2378
  "type": "option"
2115
2379
  },
2116
- "status": {
2117
- "char": "s",
2118
- "description": "Filter by status",
2119
- "name": "status",
2380
+ "config": {
2381
+ "char": "c",
2382
+ "description": "Path to config file (for database connection and AI settings)",
2383
+ "name": "config",
2384
+ "default": "./config.json",
2120
2385
  "hasDynamicHelp": false,
2121
2386
  "multiple": false,
2122
2387
  "type": "option"
2123
2388
  },
2124
- "format": {
2125
- "char": "f",
2126
- "description": "Output format",
2127
- "name": "format",
2128
- "default": "console",
2389
+ "queries-per-table": {
2390
+ "description": "Number of queries to generate per table",
2391
+ "name": "queries-per-table",
2392
+ "required": false,
2129
2393
  "hasDynamicHelp": false,
2130
2394
  "multiple": false,
2131
- "options": [
2132
- "console",
2133
- "json",
2134
- "markdown"
2135
- ],
2136
2395
  "type": "option"
2137
2396
  },
2138
- "output": {
2139
- "char": "o",
2140
- "description": "Output file path",
2141
- "name": "output",
2397
+ "max-execution-time": {
2398
+ "description": "Maximum execution time for query validation (ms)",
2399
+ "name": "max-execution-time",
2400
+ "required": false,
2142
2401
  "hasDynamicHelp": false,
2143
2402
  "multiple": false,
2144
2403
  "type": "option"
2145
- },
2146
- "verbose": {
2147
- "char": "v",
2148
- "description": "Show detailed information",
2149
- "name": "verbose",
2150
- "allowNo": false,
2151
- "type": "boolean"
2152
2404
  }
2153
2405
  },
2154
2406
  "hasDynamicHelp": false,
2155
2407
  "hiddenAliases": [],
2156
- "id": "test:history",
2408
+ "id": "dbdoc:generate-queries",
2409
+ "pluginAlias": "@memberjunction/cli",
2410
+ "pluginName": "@memberjunction/cli",
2411
+ "pluginType": "core",
2412
+ "strict": true,
2413
+ "enableJsonFlag": false,
2414
+ "isESM": true,
2415
+ "relativePath": [
2416
+ "dist",
2417
+ "commands",
2418
+ "dbdoc",
2419
+ "generate-queries.js"
2420
+ ]
2421
+ },
2422
+ "dbdoc": {
2423
+ "aliases": [],
2424
+ "args": {},
2425
+ "description": "AI-powered database documentation generator",
2426
+ "flags": {},
2427
+ "hasDynamicHelp": false,
2428
+ "hidden": false,
2429
+ "hiddenAliases": [],
2430
+ "id": "dbdoc",
2157
2431
  "pluginAlias": "@memberjunction/cli",
2158
2432
  "pluginName": "@memberjunction/cli",
2159
2433
  "pluginType": "core",
@@ -2163,26 +2437,21 @@
2163
2437
  "relativePath": [
2164
2438
  "dist",
2165
2439
  "commands",
2166
- "test",
2167
- "history.js"
2440
+ "dbdoc",
2441
+ "index.js"
2168
2442
  ]
2169
2443
  },
2170
- "test": {
2444
+ "dbdoc:init": {
2171
2445
  "aliases": [],
2172
2446
  "args": {},
2173
- "description": "MemberJunction Testing Framework - Execute and manage tests",
2447
+ "description": "Initialize DBAutoDoc project (delegates to db-auto-doc init)",
2174
2448
  "examples": [
2175
- "<%= config.bin %> <%= command.id %> run <test-id>",
2176
- "<%= config.bin %> <%= command.id %> run --name=\"Active Members Count\"",
2177
- "<%= config.bin %> <%= command.id %> suite <suite-id>",
2178
- "<%= config.bin %> <%= command.id %> list",
2179
- "<%= config.bin %> <%= command.id %> list --suites",
2180
- "<%= config.bin %> <%= command.id %> validate --all"
2449
+ "<%= config.bin %> <%= command.id %>"
2181
2450
  ],
2182
2451
  "flags": {},
2183
2452
  "hasDynamicHelp": false,
2184
2453
  "hiddenAliases": [],
2185
- "id": "test",
2454
+ "id": "dbdoc:init",
2186
2455
  "pluginAlias": "@memberjunction/cli",
2187
2456
  "pluginName": "@memberjunction/cli",
2188
2457
  "pluginType": "core",
@@ -2192,91 +2461,30 @@
2192
2461
  "relativePath": [
2193
2462
  "dist",
2194
2463
  "commands",
2195
- "test",
2196
- "index.js"
2464
+ "dbdoc",
2465
+ "init.js"
2197
2466
  ]
2198
2467
  },
2199
- "test:list": {
2468
+ "dbdoc:reset": {
2200
2469
  "aliases": [],
2201
2470
  "args": {},
2202
- "description": "List available tests, suites, and types",
2471
+ "description": "Reset analysis state (delegates to db-auto-doc reset)",
2203
2472
  "examples": [
2204
2473
  "<%= config.bin %> <%= command.id %>",
2205
- "<%= config.bin %> <%= command.id %> --suites",
2206
- "<%= config.bin %> <%= command.id %> --types",
2207
- "<%= config.bin %> <%= command.id %> --type=agent-eval",
2208
- "<%= config.bin %> <%= command.id %> --tag=smoke",
2209
- "<%= config.bin %> <%= command.id %> --status=active --verbose"
2474
+ "<%= config.bin %> <%= command.id %> --force"
2210
2475
  ],
2211
2476
  "flags": {
2212
- "suites": {
2213
- "description": "List test suites instead of tests",
2214
- "name": "suites",
2215
- "allowNo": false,
2216
- "type": "boolean"
2217
- },
2218
- "types": {
2219
- "description": "List test types",
2220
- "name": "types",
2221
- "allowNo": false,
2222
- "type": "boolean"
2223
- },
2224
- "type": {
2225
- "char": "t",
2226
- "description": "Filter by test type",
2227
- "name": "type",
2228
- "hasDynamicHelp": false,
2229
- "multiple": false,
2230
- "type": "option"
2231
- },
2232
- "tag": {
2233
- "description": "Filter by tag",
2234
- "name": "tag",
2235
- "hasDynamicHelp": false,
2236
- "multiple": false,
2237
- "type": "option"
2238
- },
2239
- "status": {
2240
- "char": "s",
2241
- "description": "Filter by status",
2242
- "name": "status",
2243
- "hasDynamicHelp": false,
2244
- "multiple": false,
2245
- "type": "option"
2246
- },
2247
- "format": {
2477
+ "force": {
2248
2478
  "char": "f",
2249
- "description": "Output format",
2250
- "name": "format",
2251
- "default": "console",
2252
- "hasDynamicHelp": false,
2253
- "multiple": false,
2254
- "options": [
2255
- "console",
2256
- "json",
2257
- "markdown"
2258
- ],
2259
- "type": "option"
2260
- },
2261
- "output": {
2262
- "char": "o",
2263
- "description": "Output file path",
2264
- "name": "output",
2265
- "hasDynamicHelp": false,
2266
- "multiple": false,
2267
- "type": "option"
2268
- },
2269
- "verbose": {
2270
- "char": "v",
2271
- "description": "Show detailed information",
2272
- "name": "verbose",
2479
+ "description": "Force reset without confirmation",
2480
+ "name": "force",
2273
2481
  "allowNo": false,
2274
2482
  "type": "boolean"
2275
2483
  }
2276
2484
  },
2277
2485
  "hasDynamicHelp": false,
2278
2486
  "hiddenAliases": [],
2279
- "id": "test:list",
2487
+ "id": "dbdoc:reset",
2280
2488
  "pluginAlias": "@memberjunction/cli",
2281
2489
  "pluginName": "@memberjunction/cli",
2282
2490
  "pluginType": "core",
@@ -2286,83 +2494,31 @@
2286
2494
  "relativePath": [
2287
2495
  "dist",
2288
2496
  "commands",
2289
- "test",
2290
- "list.js"
2497
+ "dbdoc",
2498
+ "reset.js"
2291
2499
  ]
2292
2500
  },
2293
- "test:run": {
2501
+ "dbdoc:status": {
2294
2502
  "aliases": [],
2295
- "args": {
2296
- "testId": {
2297
- "description": "Test ID to execute",
2298
- "name": "testId",
2299
- "required": false
2300
- }
2301
- },
2302
- "description": "Execute a single test by ID or name",
2503
+ "args": {},
2504
+ "description": "Show analysis status and progress (delegates to db-auto-doc status)",
2303
2505
  "examples": [
2304
- "<%= config.bin %> <%= command.id %> <test-id>",
2305
- "<%= config.bin %> <%= command.id %> --name=\"Active Members Count\"",
2306
- "<%= config.bin %> <%= command.id %> <test-id> --environment=staging",
2307
- "<%= config.bin %> <%= command.id %> <test-id> --format=json --output=results.json",
2308
- "<%= config.bin %> <%= command.id %> <test-id> --dry-run"
2506
+ "<%= config.bin %> <%= command.id %>",
2507
+ "<%= config.bin %> <%= command.id %> --state-file ./custom-state.json"
2309
2508
  ],
2310
2509
  "flags": {
2311
- "name": {
2312
- "char": "n",
2313
- "description": "Test name to execute",
2314
- "name": "name",
2315
- "hasDynamicHelp": false,
2316
- "multiple": false,
2317
- "type": "option"
2318
- },
2319
- "environment": {
2320
- "char": "e",
2321
- "description": "Environment context (dev, staging, prod)",
2322
- "name": "environment",
2323
- "hasDynamicHelp": false,
2324
- "multiple": false,
2325
- "type": "option"
2326
- },
2327
- "format": {
2328
- "char": "f",
2329
- "description": "Output format",
2330
- "name": "format",
2331
- "default": "console",
2332
- "hasDynamicHelp": false,
2333
- "multiple": false,
2334
- "options": [
2335
- "console",
2336
- "json",
2337
- "markdown"
2338
- ],
2339
- "type": "option"
2340
- },
2341
- "output": {
2342
- "char": "o",
2343
- "description": "Output file path",
2344
- "name": "output",
2510
+ "state-file": {
2511
+ "char": "s",
2512
+ "description": "Path to state JSON file",
2513
+ "name": "state-file",
2345
2514
  "hasDynamicHelp": false,
2346
2515
  "multiple": false,
2347
2516
  "type": "option"
2348
- },
2349
- "dry-run": {
2350
- "description": "Validate without executing",
2351
- "name": "dry-run",
2352
- "allowNo": false,
2353
- "type": "boolean"
2354
- },
2355
- "verbose": {
2356
- "char": "v",
2357
- "description": "Show detailed execution information",
2358
- "name": "verbose",
2359
- "allowNo": false,
2360
- "type": "boolean"
2361
2517
  }
2362
2518
  },
2363
2519
  "hasDynamicHelp": false,
2364
2520
  "hiddenAliases": [],
2365
- "id": "test:run",
2521
+ "id": "dbdoc:status",
2366
2522
  "pluginAlias": "@memberjunction/cli",
2367
2523
  "pluginName": "@memberjunction/cli",
2368
2524
  "pluginType": "core",
@@ -2372,68 +2528,38 @@
2372
2528
  "relativePath": [
2373
2529
  "dist",
2374
2530
  "commands",
2375
- "test",
2376
- "run.js"
2531
+ "dbdoc",
2532
+ "status.js"
2377
2533
  ]
2378
2534
  },
2379
- "test:suite": {
2535
+ "ai:actions:list": {
2380
2536
  "aliases": [],
2381
- "args": {
2382
- "suiteId": {
2383
- "description": "Test suite ID to execute",
2384
- "name": "suiteId",
2385
- "required": false
2386
- }
2387
- },
2388
- "description": "Execute a test suite",
2537
+ "args": {},
2538
+ "description": "List available AI actions",
2389
2539
  "examples": [
2390
- "<%= config.bin %> <%= command.id %> <suite-id>",
2391
- "<%= config.bin %> <%= command.id %> --name=\"Agent Quality Suite\"",
2392
- "<%= config.bin %> <%= command.id %> <suite-id> --format=json",
2393
- "<%= config.bin %> <%= command.id %> <suite-id> --output=suite-results.json"
2540
+ "<%= config.bin %> <%= command.id %>",
2541
+ "<%= config.bin %> <%= command.id %> --output=table",
2542
+ "<%= config.bin %> <%= command.id %> --output=json"
2394
2543
  ],
2395
2544
  "flags": {
2396
- "name": {
2397
- "char": "n",
2398
- "description": "Test suite name to execute",
2399
- "name": "name",
2400
- "hasDynamicHelp": false,
2401
- "multiple": false,
2402
- "type": "option"
2403
- },
2404
- "format": {
2405
- "char": "f",
2545
+ "output": {
2546
+ "char": "o",
2406
2547
  "description": "Output format",
2407
- "name": "format",
2408
- "default": "console",
2548
+ "name": "output",
2549
+ "default": "compact",
2409
2550
  "hasDynamicHelp": false,
2410
2551
  "multiple": false,
2411
2552
  "options": [
2412
- "console",
2553
+ "compact",
2413
2554
  "json",
2414
- "markdown"
2555
+ "table"
2415
2556
  ],
2416
2557
  "type": "option"
2417
- },
2418
- "output": {
2419
- "char": "o",
2420
- "description": "Output file path",
2421
- "name": "output",
2422
- "hasDynamicHelp": false,
2423
- "multiple": false,
2424
- "type": "option"
2425
- },
2426
- "verbose": {
2427
- "char": "v",
2428
- "description": "Show detailed execution information",
2429
- "name": "verbose",
2430
- "allowNo": false,
2431
- "type": "boolean"
2432
2558
  }
2433
2559
  },
2434
2560
  "hasDynamicHelp": false,
2435
2561
  "hiddenAliases": [],
2436
- "id": "test:suite",
2562
+ "id": "ai:actions:list",
2437
2563
  "pluginAlias": "@memberjunction/cli",
2438
2564
  "pluginName": "@memberjunction/cli",
2439
2565
  "pluginType": "core",
@@ -2443,82 +2569,78 @@
2443
2569
  "relativePath": [
2444
2570
  "dist",
2445
2571
  "commands",
2446
- "test",
2447
- "suite.js"
2572
+ "ai",
2573
+ "actions",
2574
+ "list.js"
2448
2575
  ]
2449
2576
  },
2450
- "test:validate": {
2451
- "aliases": [],
2452
- "args": {
2453
- "testId": {
2454
- "description": "Test ID to validate",
2455
- "name": "testId",
2456
- "required": false
2457
- }
2458
- },
2459
- "description": "Validate test definitions without executing",
2460
- "examples": [
2461
- "<%= config.bin %> <%= command.id %> <test-id>",
2462
- "<%= config.bin %> <%= command.id %> --all",
2463
- "<%= config.bin %> <%= command.id %> --type=agent-eval",
2464
- "<%= config.bin %> <%= command.id %> --all --save-report",
2465
- "<%= config.bin %> <%= command.id %> --all --output=validation-report.md"
2577
+ "ai:actions:run": {
2578
+ "aliases": [],
2579
+ "args": {},
2580
+ "description": "Execute an AI action with parameters",
2581
+ "examples": [
2582
+ "<%= config.bin %> <%= command.id %> -n \"Get Weather\" --param \"Location=Boston\"",
2583
+ "<%= config.bin %> <%= command.id %> -n \"Get Stock Price\" --param \"Ticker=AAPL\"",
2584
+ "<%= config.bin %> <%= command.id %> -n \"Send Single Message\" --param \"To=user@example.com\" --param \"Subject=Test\" --param \"Body=Hello\" --param \"MessageType=Email\" --param \"Provider=SendGrid\"",
2585
+ "<%= config.bin %> <%= command.id %> -n \"Calculate Expression\" --param \"Expression=2+2*3\" --dry-run"
2466
2586
  ],
2467
2587
  "flags": {
2468
- "all": {
2469
- "char": "a",
2470
- "description": "Validate all tests",
2471
- "name": "all",
2472
- "allowNo": false,
2473
- "type": "boolean"
2474
- },
2475
- "type": {
2476
- "char": "t",
2477
- "description": "Validate tests by type",
2478
- "name": "type",
2588
+ "name": {
2589
+ "char": "n",
2590
+ "description": "Action name",
2591
+ "name": "name",
2592
+ "required": true,
2479
2593
  "hasDynamicHelp": false,
2480
2594
  "multiple": false,
2481
2595
  "type": "option"
2482
2596
  },
2483
- "save-report": {
2484
- "description": "Save validation report to file",
2485
- "name": "save-report",
2597
+ "param": {
2598
+ "char": "p",
2599
+ "description": "Action parameters in key=value format",
2600
+ "name": "param",
2601
+ "hasDynamicHelp": false,
2602
+ "multiple": true,
2603
+ "type": "option"
2604
+ },
2605
+ "dry-run": {
2606
+ "description": "Validate without executing",
2607
+ "name": "dry-run",
2486
2608
  "allowNo": false,
2487
2609
  "type": "boolean"
2488
2610
  },
2489
- "format": {
2490
- "char": "f",
2611
+ "output": {
2612
+ "char": "o",
2491
2613
  "description": "Output format",
2492
- "name": "format",
2493
- "default": "console",
2614
+ "name": "output",
2615
+ "default": "compact",
2494
2616
  "hasDynamicHelp": false,
2495
2617
  "multiple": false,
2496
2618
  "options": [
2497
- "console",
2619
+ "compact",
2498
2620
  "json",
2499
- "markdown"
2621
+ "table"
2500
2622
  ],
2501
2623
  "type": "option"
2502
2624
  },
2503
- "output": {
2504
- "char": "o",
2505
- "description": "Output file path",
2506
- "name": "output",
2507
- "hasDynamicHelp": false,
2508
- "multiple": false,
2509
- "type": "option"
2510
- },
2511
2625
  "verbose": {
2512
2626
  "char": "v",
2513
- "description": "Show detailed information",
2627
+ "description": "Show detailed execution information",
2514
2628
  "name": "verbose",
2515
2629
  "allowNo": false,
2516
2630
  "type": "boolean"
2631
+ },
2632
+ "timeout": {
2633
+ "description": "Execution timeout in milliseconds",
2634
+ "name": "timeout",
2635
+ "default": 300000,
2636
+ "hasDynamicHelp": false,
2637
+ "multiple": false,
2638
+ "type": "option"
2517
2639
  }
2518
2640
  },
2519
2641
  "hasDynamicHelp": false,
2520
2642
  "hiddenAliases": [],
2521
- "id": "test:validate",
2643
+ "id": "ai:actions:run",
2522
2644
  "pluginAlias": "@memberjunction/cli",
2523
2645
  "pluginName": "@memberjunction/cli",
2524
2646
  "pluginType": "core",
@@ -2528,14 +2650,15 @@
2528
2650
  "relativePath": [
2529
2651
  "dist",
2530
2652
  "commands",
2531
- "test",
2532
- "validate.js"
2653
+ "ai",
2654
+ "actions",
2655
+ "run.js"
2533
2656
  ]
2534
2657
  },
2535
- "ai:actions:list": {
2658
+ "ai:agents:list": {
2536
2659
  "aliases": [],
2537
2660
  "args": {},
2538
- "description": "List available AI actions",
2661
+ "description": "List available AI agents",
2539
2662
  "examples": [
2540
2663
  "<%= config.bin %> <%= command.id %>",
2541
2664
  "<%= config.bin %> <%= command.id %> --output=table",
@@ -2559,7 +2682,7 @@
2559
2682
  },
2560
2683
  "hasDynamicHelp": false,
2561
2684
  "hiddenAliases": [],
2562
- "id": "ai:actions:list",
2685
+ "id": "ai:agents:list",
2563
2686
  "pluginAlias": "@memberjunction/cli",
2564
2687
  "pluginName": "@memberjunction/cli",
2565
2688
  "pluginType": "core",
@@ -2570,41 +2693,47 @@
2570
2693
  "dist",
2571
2694
  "commands",
2572
2695
  "ai",
2573
- "actions",
2696
+ "agents",
2574
2697
  "list.js"
2575
2698
  ]
2576
2699
  },
2577
- "ai:actions:run": {
2700
+ "ai:agents:run": {
2578
2701
  "aliases": [],
2579
2702
  "args": {},
2580
- "description": "Execute an AI action with parameters",
2703
+ "description": "Execute an AI agent with a prompt or start interactive chat",
2581
2704
  "examples": [
2582
- "<%= config.bin %> <%= command.id %> -n \"Get Weather\" --param \"Location=Boston\"",
2583
- "<%= config.bin %> <%= command.id %> -n \"Get Stock Price\" --param \"Ticker=AAPL\"",
2584
- "<%= config.bin %> <%= command.id %> -n \"Send Single Message\" --param \"To=user@example.com\" --param \"Subject=Test\" --param \"Body=Hello\" --param \"MessageType=Email\" --param \"Provider=SendGrid\"",
2585
- "<%= config.bin %> <%= command.id %> -n \"Calculate Expression\" --param \"Expression=2+2*3\" --dry-run"
2705
+ "<%= config.bin %> <%= command.id %> -a \"Skip: Requirements Expert\" -p \"Create a dashboard for sales metrics\"",
2706
+ "<%= config.bin %> <%= command.id %> -a \"Child Component Generator Sub-agent\" --chat",
2707
+ "<%= config.bin %> <%= command.id %> -a \"Skip: Technical Design Expert\" -p \"Build a React component\" --verbose --timeout=600000"
2586
2708
  ],
2587
2709
  "flags": {
2588
- "name": {
2589
- "char": "n",
2590
- "description": "Action name",
2591
- "name": "name",
2710
+ "agent": {
2711
+ "char": "a",
2712
+ "description": "Agent name",
2713
+ "name": "agent",
2592
2714
  "required": true,
2593
2715
  "hasDynamicHelp": false,
2594
2716
  "multiple": false,
2595
2717
  "type": "option"
2596
2718
  },
2597
- "param": {
2719
+ "prompt": {
2598
2720
  "char": "p",
2599
- "description": "Action parameters in key=value format",
2600
- "name": "param",
2721
+ "description": "Prompt to execute",
2722
+ "exclusive": [
2723
+ "chat"
2724
+ ],
2725
+ "name": "prompt",
2601
2726
  "hasDynamicHelp": false,
2602
- "multiple": true,
2727
+ "multiple": false,
2603
2728
  "type": "option"
2604
2729
  },
2605
- "dry-run": {
2606
- "description": "Validate without executing",
2607
- "name": "dry-run",
2730
+ "chat": {
2731
+ "char": "c",
2732
+ "description": "Start interactive chat mode",
2733
+ "exclusive": [
2734
+ "prompt"
2735
+ ],
2736
+ "name": "chat",
2608
2737
  "allowNo": false,
2609
2738
  "type": "boolean"
2610
2739
  },
@@ -2640,7 +2769,7 @@
2640
2769
  },
2641
2770
  "hasDynamicHelp": false,
2642
2771
  "hiddenAliases": [],
2643
- "id": "ai:actions:run",
2772
+ "id": "ai:agents:run",
2644
2773
  "pluginAlias": "@memberjunction/cli",
2645
2774
  "pluginName": "@memberjunction/cli",
2646
2775
  "pluginType": "core",
@@ -2651,7 +2780,7 @@
2651
2780
  "dist",
2652
2781
  "commands",
2653
2782
  "ai",
2654
- "actions",
2783
+ "agents",
2655
2784
  "run.js"
2656
2785
  ]
2657
2786
  },
@@ -2871,135 +3000,6 @@
2871
3000
  "index.js"
2872
3001
  ]
2873
3002
  },
2874
- "ai:agents:list": {
2875
- "aliases": [],
2876
- "args": {},
2877
- "description": "List available AI agents",
2878
- "examples": [
2879
- "<%= config.bin %> <%= command.id %>",
2880
- "<%= config.bin %> <%= command.id %> --output=table",
2881
- "<%= config.bin %> <%= command.id %> --output=json"
2882
- ],
2883
- "flags": {
2884
- "output": {
2885
- "char": "o",
2886
- "description": "Output format",
2887
- "name": "output",
2888
- "default": "compact",
2889
- "hasDynamicHelp": false,
2890
- "multiple": false,
2891
- "options": [
2892
- "compact",
2893
- "json",
2894
- "table"
2895
- ],
2896
- "type": "option"
2897
- }
2898
- },
2899
- "hasDynamicHelp": false,
2900
- "hiddenAliases": [],
2901
- "id": "ai:agents:list",
2902
- "pluginAlias": "@memberjunction/cli",
2903
- "pluginName": "@memberjunction/cli",
2904
- "pluginType": "core",
2905
- "strict": true,
2906
- "enableJsonFlag": false,
2907
- "isESM": true,
2908
- "relativePath": [
2909
- "dist",
2910
- "commands",
2911
- "ai",
2912
- "agents",
2913
- "list.js"
2914
- ]
2915
- },
2916
- "ai:agents:run": {
2917
- "aliases": [],
2918
- "args": {},
2919
- "description": "Execute an AI agent with a prompt or start interactive chat",
2920
- "examples": [
2921
- "<%= config.bin %> <%= command.id %> -a \"Skip: Requirements Expert\" -p \"Create a dashboard for sales metrics\"",
2922
- "<%= config.bin %> <%= command.id %> -a \"Child Component Generator Sub-agent\" --chat",
2923
- "<%= config.bin %> <%= command.id %> -a \"Skip: Technical Design Expert\" -p \"Build a React component\" --verbose --timeout=600000"
2924
- ],
2925
- "flags": {
2926
- "agent": {
2927
- "char": "a",
2928
- "description": "Agent name",
2929
- "name": "agent",
2930
- "required": true,
2931
- "hasDynamicHelp": false,
2932
- "multiple": false,
2933
- "type": "option"
2934
- },
2935
- "prompt": {
2936
- "char": "p",
2937
- "description": "Prompt to execute",
2938
- "exclusive": [
2939
- "chat"
2940
- ],
2941
- "name": "prompt",
2942
- "hasDynamicHelp": false,
2943
- "multiple": false,
2944
- "type": "option"
2945
- },
2946
- "chat": {
2947
- "char": "c",
2948
- "description": "Start interactive chat mode",
2949
- "exclusive": [
2950
- "prompt"
2951
- ],
2952
- "name": "chat",
2953
- "allowNo": false,
2954
- "type": "boolean"
2955
- },
2956
- "output": {
2957
- "char": "o",
2958
- "description": "Output format",
2959
- "name": "output",
2960
- "default": "compact",
2961
- "hasDynamicHelp": false,
2962
- "multiple": false,
2963
- "options": [
2964
- "compact",
2965
- "json",
2966
- "table"
2967
- ],
2968
- "type": "option"
2969
- },
2970
- "verbose": {
2971
- "char": "v",
2972
- "description": "Show detailed execution information",
2973
- "name": "verbose",
2974
- "allowNo": false,
2975
- "type": "boolean"
2976
- },
2977
- "timeout": {
2978
- "description": "Execution timeout in milliseconds",
2979
- "name": "timeout",
2980
- "default": 300000,
2981
- "hasDynamicHelp": false,
2982
- "multiple": false,
2983
- "type": "option"
2984
- }
2985
- },
2986
- "hasDynamicHelp": false,
2987
- "hiddenAliases": [],
2988
- "id": "ai:agents:run",
2989
- "pluginAlias": "@memberjunction/cli",
2990
- "pluginName": "@memberjunction/cli",
2991
- "pluginType": "core",
2992
- "strict": true,
2993
- "enableJsonFlag": false,
2994
- "isESM": true,
2995
- "relativePath": [
2996
- "dist",
2997
- "commands",
2998
- "ai",
2999
- "agents",
3000
- "run.js"
3001
- ]
3002
- },
3003
3003
  "ai:prompts:list": {
3004
3004
  "aliases": [],
3005
3005
  "args": {},
@@ -3140,5 +3140,5 @@
3140
3140
  ]
3141
3141
  }
3142
3142
  },
3143
- "version": "5.1.0"
3143
+ "version": "5.3.0"
3144
3144
  }