claudekit-cli 3.33.0-dev.2 → 3.33.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -45375,7 +45375,7 @@ var package_default;
45375
45375
  var init_package = __esm(() => {
45376
45376
  package_default = {
45377
45377
  name: "claudekit-cli",
45378
- version: "3.33.0-dev.2",
45378
+ version: "3.33.0-dev.4",
45379
45379
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
45380
45380
  type: "module",
45381
45381
  repository: {
@@ -45391,11 +45391,14 @@ var init_package = __esm(() => {
45391
45391
  },
45392
45392
  files: [
45393
45393
  "bin/ck.js",
45394
- "dist/index.js"
45394
+ "dist/index.js",
45395
+ "dist/ui/"
45395
45396
  ],
45396
45397
  scripts: {
45397
45398
  dev: "bun run src/index.ts",
45398
45399
  "dashboard:dev": "cd src/ui && bun install --silent && cd ../.. && bun --watch run src/index.ts config ui --dev",
45400
+ "ui:build": "cd src/ui && bun install --silent && bun run build",
45401
+ "ui:dev": "cd src/ui && bun run dev",
45399
45402
  build: "bun build src/index.ts --outdir dist --target node --external @octokit/rest",
45400
45403
  compile: "bun build src/index.ts --compile --outfile ck",
45401
45404
  "compile:binary": "bun build src/index.ts --compile --outfile bin/ck",
@@ -59709,19 +59712,24 @@ async function checkPort(port) {
59709
59712
  init_config();
59710
59713
  async function handleGet(key, options2) {
59711
59714
  const { global: globalOnly, json } = options2;
59712
- let config;
59713
- if (globalOnly) {
59714
- ConfigManager.setGlobalFlag(true);
59715
- config = await ConfigManager.load();
59716
- } else {
59717
- ConfigManager.setGlobalFlag(true);
59718
- const globalConfig = await ConfigManager.load();
59719
- const localConfig = await ConfigManager.loadProjectConfig(process.cwd(), false);
59720
- config = deepMerge3(globalConfig, localConfig ? { paths: localConfig } : {});
59715
+ const projectDir = process.cwd();
59716
+ let value;
59717
+ try {
59718
+ if (globalOnly) {
59719
+ const scoped = await CkConfigManager.loadScope("global", projectDir);
59720
+ value = scoped ? getNestedValue2(scoped, key) : undefined;
59721
+ } else {
59722
+ const { value: v2 } = await CkConfigManager.getFieldWithSource(key, projectDir);
59723
+ value = v2;
59724
+ }
59725
+ } catch (error) {
59726
+ console.error(`Failed to read config: ${error instanceof Error ? error.message : "Unknown error"}`);
59727
+ process.exitCode = 1;
59728
+ return;
59721
59729
  }
59722
- const value = getNestedValue2(config, key);
59723
59730
  if (value === undefined) {
59724
59731
  console.error(`Key not found: ${key}`);
59732
+ console.error(`Run: ck config show --json | jq 'keys'`);
59725
59733
  process.exitCode = 1;
59726
59734
  return;
59727
59735
  }
@@ -59739,18 +59747,6 @@ function getNestedValue2(obj, path2) {
59739
59747
  return;
59740
59748
  }, obj);
59741
59749
  }
59742
- function deepMerge3(target, source) {
59743
- const result = { ...target };
59744
- for (const key of Object.keys(source)) {
59745
- const sourceVal = source[key];
59746
- if (sourceVal && typeof sourceVal === "object" && !Array.isArray(sourceVal)) {
59747
- result[key] = deepMerge3(result[key] || {}, sourceVal);
59748
- } else {
59749
- result[key] = sourceVal;
59750
- }
59751
- }
59752
- return result;
59753
- }
59754
59750
 
59755
59751
  // src/commands/config/phases/set-handler.ts
59756
59752
  init_config();
@@ -59758,6 +59754,11 @@ init_logger();
59758
59754
  init_dist2();
59759
59755
  async function handleSet(key, value, options2) {
59760
59756
  const { global: globalOnly, local: localOnly } = options2;
59757
+ if (globalOnly && localOnly) {
59758
+ console.error("Cannot use both --global and --local flags together");
59759
+ process.exitCode = 1;
59760
+ return;
59761
+ }
59761
59762
  let parsedValue;
59762
59763
  try {
59763
59764
  parsedValue = JSON.parse(value);
@@ -59768,13 +59769,13 @@ async function handleSet(key, value, options2) {
59768
59769
  if (globalOnly) {
59769
59770
  scope = "global";
59770
59771
  } else if (localOnly) {
59771
- scope = "local";
59772
+ scope = "project";
59772
59773
  } else {
59773
59774
  const selectedScope = await ie({
59774
59775
  message: "Where do you want to save this setting?",
59775
59776
  options: [
59776
- { value: "local", label: "Local (project)", hint: ".claude/.ck.json" },
59777
- { value: "global", label: "Global (user)", hint: "~/.claudekit/config.json" }
59777
+ { value: "project", label: "Local (project)", hint: ".claude/.ck.json" },
59778
+ { value: "global", label: "Global (user)", hint: "~/.claude/.ck.json" }
59778
59779
  ]
59779
59780
  });
59780
59781
  if (lD(selectedScope)) {
@@ -59784,51 +59785,40 @@ async function handleSet(key, value, options2) {
59784
59785
  }
59785
59786
  scope = selectedScope;
59786
59787
  }
59787
- if (scope === "global") {
59788
- ConfigManager.setGlobalFlag(true);
59789
- await ConfigManager.set(key, parsedValue);
59790
- logger.success(`Set ${key} = ${JSON.stringify(parsedValue)} (global)`);
59791
- } else {
59792
- const projectDir = process.cwd();
59793
- const existing = await ConfigManager.loadProjectConfig(projectDir, false) || {};
59794
- setNestedValue2(existing, key, parsedValue);
59795
- await ConfigManager.saveProjectConfig(projectDir, existing, false);
59796
- logger.success(`Set ${key} = ${JSON.stringify(parsedValue)} (local)`);
59797
- }
59798
- }
59799
- function setNestedValue2(obj, path2, value) {
59800
- const keys = path2.split(".");
59801
- let current = obj;
59802
- for (let i = 0;i < keys.length - 1; i++) {
59803
- const k2 = keys[i];
59804
- if (!(k2 in current) || typeof current[k2] !== "object") {
59805
- current[k2] = {};
59806
- }
59807
- current = current[k2];
59788
+ const projectDir = process.cwd();
59789
+ try {
59790
+ await CkConfigManager.updateField(key, parsedValue, scope, projectDir);
59791
+ logger.success(`Set ${key} = ${JSON.stringify(parsedValue)} (${scope === "project" ? "local" : "global"})`);
59792
+ } catch (error) {
59793
+ logger.error(`Invalid value for ${key}: ${error instanceof Error ? error.message : "Unknown"}`);
59794
+ process.exitCode = 1;
59795
+ return;
59808
59796
  }
59809
- current[keys[keys.length - 1]] = value;
59810
59797
  }
59811
59798
 
59812
59799
  // src/commands/config/phases/show-handler.ts
59813
59800
  init_config();
59814
59801
  async function handleShow(options2) {
59815
59802
  const { global: globalOnly, local: localOnly, json } = options2;
59803
+ const projectDir = process.cwd();
59804
+ if (globalOnly && localOnly) {
59805
+ console.error("Cannot use both --global and --local flags together");
59806
+ process.exitCode = 1;
59807
+ return;
59808
+ }
59816
59809
  let config;
59817
59810
  let label;
59818
59811
  if (globalOnly) {
59819
- ConfigManager.setGlobalFlag(true);
59820
- config = await ConfigManager.load();
59812
+ const scoped = await CkConfigManager.loadScope("global", projectDir);
59813
+ config = scoped || {};
59821
59814
  label = "Global config";
59822
59815
  } else if (localOnly) {
59823
- const projectDir = process.cwd();
59824
- const projectConfig = await ConfigManager.loadProjectConfig(projectDir, false);
59825
- config = projectConfig ? { paths: projectConfig } : {};
59816
+ const scoped = await CkConfigManager.loadScope("project", projectDir);
59817
+ config = scoped || {};
59826
59818
  label = "Local config";
59827
59819
  } else {
59828
- ConfigManager.setGlobalFlag(true);
59829
- const globalConfig = await ConfigManager.load();
59830
- const localConfig = await ConfigManager.loadProjectConfig(process.cwd(), false);
59831
- config = deepMerge4(globalConfig, localConfig ? { paths: localConfig } : {});
59820
+ const { config: merged } = await CkConfigManager.loadFull(projectDir);
59821
+ config = merged;
59832
59822
  label = "Merged config";
59833
59823
  }
59834
59824
  if (json) {
@@ -59837,35 +59827,30 @@ async function handleShow(options2) {
59837
59827
  console.log(`
59838
59828
  ${label}:
59839
59829
  `);
59840
- console.log(formatConfig(config));
59841
- }
59842
- }
59843
- function deepMerge4(target, source) {
59844
- const result = { ...target };
59845
- for (const key of Object.keys(source)) {
59846
- const sourceVal = source[key];
59847
- if (sourceVal && typeof sourceVal === "object" && !Array.isArray(sourceVal)) {
59848
- result[key] = deepMerge4(result[key] || {}, sourceVal);
59849
- } else {
59850
- result[key] = sourceVal;
59851
- }
59830
+ console.log(JSON.stringify(config, null, 2));
59852
59831
  }
59853
- return result;
59854
- }
59855
- function formatConfig(config) {
59856
- return JSON.stringify(config, null, 2);
59857
59832
  }
59858
59833
 
59859
59834
  // src/commands/config/config-command.ts
59860
59835
  async function configCommand(action, keyOrOptions, valueOrOptions, options2) {
59861
59836
  if (action === "ui") {
59862
- const uiOpts = options2 || (typeof keyOrOptions === "object" ? keyOrOptions : {});
59863
- return configUICommand(uiOpts);
59837
+ const uiOpts2 = options2 || (typeof keyOrOptions === "object" ? keyOrOptions : {});
59838
+ return configUICommand(uiOpts2);
59864
59839
  }
59865
- if (action === "get" && typeof keyOrOptions === "string") {
59840
+ if (action === "get") {
59841
+ if (typeof keyOrOptions !== "string" || !keyOrOptions.trim()) {
59842
+ console.error("Usage: ck config get <key>");
59843
+ process.exitCode = 1;
59844
+ return;
59845
+ }
59866
59846
  return handleGet(keyOrOptions, options2 || {});
59867
59847
  }
59868
- if (action === "set" && typeof keyOrOptions === "string") {
59848
+ if (action === "set") {
59849
+ if (typeof keyOrOptions !== "string" || !keyOrOptions.trim()) {
59850
+ console.error("Usage: ck config set <key> <value>");
59851
+ process.exitCode = 1;
59852
+ return;
59853
+ }
59869
59854
  if (typeof valueOrOptions !== "string") {
59870
59855
  console.error("Usage: ck config set <key> <value>");
59871
59856
  process.exitCode = 1;
@@ -59873,8 +59858,23 @@ async function configCommand(action, keyOrOptions, valueOrOptions, options2) {
59873
59858
  }
59874
59859
  return handleSet(keyOrOptions, valueOrOptions, options2 || {});
59875
59860
  }
59876
- const opts = typeof keyOrOptions === "object" ? keyOrOptions : options2 || {};
59877
- return handleShow(opts);
59861
+ if (action === "show") {
59862
+ const opts = typeof keyOrOptions === "object" ? keyOrOptions : options2 || {};
59863
+ return handleShow(opts);
59864
+ }
59865
+ if (action && !["ui", "get", "set", "show"].includes(action)) {
59866
+ console.error(`Unknown action: ${action}`);
59867
+ console.error("Valid actions: get, set, show, ui");
59868
+ process.exitCode = 1;
59869
+ return;
59870
+ }
59871
+ const rawOpts = options2 || (typeof keyOrOptions === "object" ? keyOrOptions : {});
59872
+ const uiOpts = {
59873
+ port: rawOpts?.port,
59874
+ noOpen: rawOpts?.noOpen,
59875
+ dev: rawOpts?.dev
59876
+ };
59877
+ return configUICommand(uiOpts);
59878
59878
  }
59879
59879
  // src/domains/health-checks/types.ts
59880
59880
  init_zod();
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="512" height="512"><svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="512" height="512" fill="#131010"></rect>
3
+ <path d="M320 224V352H192V224H320Z" fill="#5A5858"></path>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M384 416H128V96H384V416ZM320 160H192V352H320V160Z" fill="white"></path>
5
+ </svg><style>@media (prefers-color-scheme: light) { :root { filter: none; } }
6
+ @media (prefers-color-scheme: dark) { :root { filter: none; } }
7
+ </style></svg>
Binary file
Binary file
Binary file