claudekit-cli 3.41.3-dev.3 → 3.41.4-dev.1
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 +177 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45409,6 +45409,9 @@ var VALIDATION_PATTERNS;
|
|
|
45409
45409
|
var init_config_validator = __esm(() => {
|
|
45410
45410
|
VALIDATION_PATTERNS = {
|
|
45411
45411
|
GEMINI_API_KEY: /^AIza[0-9A-Za-z_-]{35}$/,
|
|
45412
|
+
OPENROUTER_API_KEY: /^sk-or-v1-[A-Za-z0-9_-]+$/,
|
|
45413
|
+
MINIMAX_API_KEY: /^[A-Za-z0-9_-]{16,}$/,
|
|
45414
|
+
IMAGE_GEN_PROVIDER: /^(auto|google|openrouter|minimax)$/,
|
|
45412
45415
|
DISCORD_WEBHOOK_URL: /^https:\/\/discord\.com\/api\/webhooks\//,
|
|
45413
45416
|
TELEGRAM_BOT_TOKEN: /^\d+:[A-Za-z0-9_-]{35}$/
|
|
45414
45417
|
};
|
|
@@ -57323,7 +57326,7 @@ var package_default;
|
|
|
57323
57326
|
var init_package = __esm(() => {
|
|
57324
57327
|
package_default = {
|
|
57325
57328
|
name: "claudekit-cli",
|
|
57326
|
-
version: "3.41.
|
|
57329
|
+
version: "3.41.4-dev.1",
|
|
57327
57330
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57328
57331
|
type: "module",
|
|
57329
57332
|
repository: {
|
|
@@ -72021,13 +72024,17 @@ var setupCommandHelp;
|
|
|
72021
72024
|
var init_setup_command_help = __esm(() => {
|
|
72022
72025
|
setupCommandHelp = {
|
|
72023
72026
|
name: "setup",
|
|
72024
|
-
description: "Run guided setup for API keys and optional packages",
|
|
72027
|
+
description: "Run guided setup for provider API keys, preferred image provider, and optional packages",
|
|
72025
72028
|
usage: "ck setup [options]",
|
|
72026
72029
|
examples: [
|
|
72027
72030
|
{
|
|
72028
72031
|
command: "ck setup",
|
|
72029
72032
|
description: "Run setup wizard in current project"
|
|
72030
72033
|
},
|
|
72034
|
+
{
|
|
72035
|
+
command: "ck setup --global",
|
|
72036
|
+
description: "Configure global provider keys and a preferred image-generation path"
|
|
72037
|
+
},
|
|
72031
72038
|
{
|
|
72032
72039
|
command: "ck setup --global --skip-packages",
|
|
72033
72040
|
description: "Configure global setup without package installation"
|
|
@@ -78650,42 +78657,131 @@ init_path_resolver();
|
|
|
78650
78657
|
init_dist2();
|
|
78651
78658
|
var import_fs_extra9 = __toESM(require_lib(), 1);
|
|
78652
78659
|
import { join as join65 } from "node:path";
|
|
78660
|
+
var IMAGE_PROVIDER_ENV_KEYS = [
|
|
78661
|
+
"GEMINI_API_KEY",
|
|
78662
|
+
"OPENROUTER_API_KEY",
|
|
78663
|
+
"MINIMAX_API_KEY"
|
|
78664
|
+
];
|
|
78665
|
+
var IMAGE_PROVIDER_KEY_MAP = {
|
|
78666
|
+
GEMINI_API_KEY: "google",
|
|
78667
|
+
OPENROUTER_API_KEY: "openrouter",
|
|
78668
|
+
MINIMAX_API_KEY: "minimax"
|
|
78669
|
+
};
|
|
78670
|
+
var IMAGE_PROVIDER_VALIDATION_PATTERNS = {
|
|
78671
|
+
GEMINI_API_KEY: VALIDATION_PATTERNS.GEMINI_API_KEY,
|
|
78672
|
+
OPENROUTER_API_KEY: VALIDATION_PATTERNS.OPENROUTER_API_KEY,
|
|
78673
|
+
MINIMAX_API_KEY: VALIDATION_PATTERNS.MINIMAX_API_KEY
|
|
78674
|
+
};
|
|
78675
|
+
var IMAGE_PROVIDER_META = {
|
|
78676
|
+
auto: {
|
|
78677
|
+
label: "Auto-detect provider",
|
|
78678
|
+
hint: "Prefer Gemini when configured; otherwise fall back through your remaining provider path"
|
|
78679
|
+
},
|
|
78680
|
+
google: {
|
|
78681
|
+
label: "Google Gemini",
|
|
78682
|
+
hint: "Best fit when you want Gemini analysis plus Google image generation"
|
|
78683
|
+
},
|
|
78684
|
+
openrouter: {
|
|
78685
|
+
label: "OpenRouter",
|
|
78686
|
+
hint: "Use routed image models through OpenRouter"
|
|
78687
|
+
},
|
|
78688
|
+
minimax: {
|
|
78689
|
+
label: "MiniMax",
|
|
78690
|
+
hint: "Use MiniMax as the default image/media provider path"
|
|
78691
|
+
}
|
|
78692
|
+
};
|
|
78653
78693
|
var REQUIRED_ENV_KEYS = [
|
|
78654
|
-
{
|
|
78694
|
+
{
|
|
78695
|
+
key: "IMAGE_PROVIDER_API_KEY",
|
|
78696
|
+
label: "Image generation provider API key",
|
|
78697
|
+
alternativeKeys: [...IMAGE_PROVIDER_ENV_KEYS]
|
|
78698
|
+
}
|
|
78655
78699
|
];
|
|
78700
|
+
function isImageProviderEnvKey(key) {
|
|
78701
|
+
return IMAGE_PROVIDER_ENV_KEYS.includes(key);
|
|
78702
|
+
}
|
|
78703
|
+
function hasValidImageProviderValue(key, value) {
|
|
78704
|
+
if (!value || value.trim() === "") {
|
|
78705
|
+
return false;
|
|
78706
|
+
}
|
|
78707
|
+
return validateApiKey2(value.trim(), IMAGE_PROVIDER_VALIDATION_PATTERNS[key]);
|
|
78708
|
+
}
|
|
78656
78709
|
async function checkRequiredKeysExist(envPath) {
|
|
78657
78710
|
const envExists = await import_fs_extra9.pathExists(envPath);
|
|
78658
78711
|
if (!envExists) {
|
|
78659
|
-
return {
|
|
78712
|
+
return {
|
|
78713
|
+
allPresent: false,
|
|
78714
|
+
missing: REQUIRED_ENV_KEYS,
|
|
78715
|
+
envExists: false,
|
|
78716
|
+
configuredProviders: []
|
|
78717
|
+
};
|
|
78660
78718
|
}
|
|
78661
78719
|
const env2 = await parseEnvFile(envPath);
|
|
78720
|
+
const configuredProviders = getConfiguredImageProviders(env2);
|
|
78662
78721
|
const missing = [];
|
|
78663
78722
|
for (const required of REQUIRED_ENV_KEYS) {
|
|
78664
|
-
const
|
|
78665
|
-
|
|
78723
|
+
const candidateKeys = required.alternativeKeys ?? [required.key];
|
|
78724
|
+
const hasConfiguredValue = candidateKeys.some((candidateKey) => {
|
|
78725
|
+
if (isImageProviderEnvKey(candidateKey)) {
|
|
78726
|
+
return hasValidImageProviderValue(candidateKey, env2[candidateKey]);
|
|
78727
|
+
}
|
|
78728
|
+
const value = env2[candidateKey];
|
|
78729
|
+
return !!value && value.trim() !== "";
|
|
78730
|
+
});
|
|
78731
|
+
if (!hasConfiguredValue) {
|
|
78666
78732
|
missing.push(required);
|
|
78667
78733
|
}
|
|
78668
78734
|
}
|
|
78669
78735
|
return {
|
|
78670
78736
|
allPresent: missing.length === 0,
|
|
78671
78737
|
missing,
|
|
78672
|
-
envExists: true
|
|
78738
|
+
envExists: true,
|
|
78739
|
+
configuredProviders
|
|
78673
78740
|
};
|
|
78674
78741
|
}
|
|
78742
|
+
function getConfiguredImageProviders(env2) {
|
|
78743
|
+
return IMAGE_PROVIDER_ENV_KEYS.filter((key) => hasValidImageProviderValue(key, env2[key])).map((key) => IMAGE_PROVIDER_KEY_MAP[key]);
|
|
78744
|
+
}
|
|
78745
|
+
function getDefaultImageProviderSelection(configuredProviders, existingPreference) {
|
|
78746
|
+
if (existingPreference && validateApiKey2(existingPreference, VALIDATION_PATTERNS.IMAGE_GEN_PROVIDER)) {
|
|
78747
|
+
if (existingPreference === "auto" && configuredProviders.includes("google")) {
|
|
78748
|
+
return "auto";
|
|
78749
|
+
}
|
|
78750
|
+
if (configuredProviders.includes(existingPreference)) {
|
|
78751
|
+
return existingPreference;
|
|
78752
|
+
}
|
|
78753
|
+
}
|
|
78754
|
+
if (configuredProviders.includes("google")) {
|
|
78755
|
+
return "auto";
|
|
78756
|
+
}
|
|
78757
|
+
return configuredProviders[0] ?? "auto";
|
|
78758
|
+
}
|
|
78675
78759
|
var ESSENTIAL_CONFIGS = [
|
|
78676
78760
|
{
|
|
78677
78761
|
key: "GEMINI_API_KEY",
|
|
78678
78762
|
label: "Google Gemini API Key",
|
|
78679
|
-
hint: "
|
|
78680
|
-
required: true,
|
|
78763
|
+
hint: "Optional. Recommended for full ai-multimodal analysis and Google image generation.",
|
|
78681
78764
|
validate: VALIDATION_PATTERNS.GEMINI_API_KEY,
|
|
78682
78765
|
mask: true
|
|
78683
78766
|
},
|
|
78767
|
+
{
|
|
78768
|
+
key: "OPENROUTER_API_KEY",
|
|
78769
|
+
label: "OpenRouter API Key",
|
|
78770
|
+
hint: "Optional. Alternative image-generation provider. Get from: https://openrouter.ai/settings/keys",
|
|
78771
|
+
validate: VALIDATION_PATTERNS.OPENROUTER_API_KEY,
|
|
78772
|
+
mask: true
|
|
78773
|
+
},
|
|
78774
|
+
{
|
|
78775
|
+
key: "MINIMAX_API_KEY",
|
|
78776
|
+
label: "MiniMax API Key",
|
|
78777
|
+
hint: "Optional. Alternative image/video/speech/music provider.",
|
|
78778
|
+
validate: VALIDATION_PATTERNS.MINIMAX_API_KEY,
|
|
78779
|
+
mask: true
|
|
78780
|
+
},
|
|
78684
78781
|
{
|
|
78685
78782
|
key: "DISCORD_WEBHOOK_URL",
|
|
78686
78783
|
label: "Discord Webhook URL (optional)",
|
|
78687
78784
|
hint: "For Discord notifications. Leave empty to skip.",
|
|
78688
|
-
required: false,
|
|
78689
78785
|
validate: VALIDATION_PATTERNS.DISCORD_WEBHOOK_URL,
|
|
78690
78786
|
mask: false
|
|
78691
78787
|
},
|
|
@@ -78693,7 +78789,6 @@ var ESSENTIAL_CONFIGS = [
|
|
|
78693
78789
|
key: "TELEGRAM_BOT_TOKEN",
|
|
78694
78790
|
label: "Telegram Bot Token (optional)",
|
|
78695
78791
|
hint: "For Telegram notifications. Leave empty to skip.",
|
|
78696
|
-
required: false,
|
|
78697
78792
|
validate: VALIDATION_PATTERNS.TELEGRAM_BOT_TOKEN,
|
|
78698
78793
|
mask: true
|
|
78699
78794
|
}
|
|
@@ -78750,6 +78845,7 @@ async function runSetupWizard(options2) {
|
|
|
78750
78845
|
if (hasGlobalConfig && Object.keys(globalEnv).length > 0) {
|
|
78751
78846
|
f2.success("Global config detected - values will be inherited automatically");
|
|
78752
78847
|
}
|
|
78848
|
+
f2.info("Configure at least one image-generation provider. Leave unused provider fields blank.");
|
|
78753
78849
|
const values = {};
|
|
78754
78850
|
for (const config of ESSENTIAL_CONFIGS) {
|
|
78755
78851
|
const globalValue = globalEnv[config.key] || "";
|
|
@@ -78774,12 +78870,9 @@ async function runSetupWizard(options2) {
|
|
|
78774
78870
|
message: config.label,
|
|
78775
78871
|
placeholder: config.hint,
|
|
78776
78872
|
validate: (value) => {
|
|
78777
|
-
if (!value
|
|
78873
|
+
if (!value) {
|
|
78778
78874
|
return;
|
|
78779
78875
|
}
|
|
78780
|
-
if (!value && config.required) {
|
|
78781
|
-
return "This field is required";
|
|
78782
|
-
}
|
|
78783
78876
|
if (value && config.validate && !validateApiKey2(value, config.validate)) {
|
|
78784
78877
|
return "Invalid format. Please check and try again.";
|
|
78785
78878
|
}
|
|
@@ -78794,6 +78887,11 @@ async function runSetupWizard(options2) {
|
|
|
78794
78887
|
values[config.key] = result;
|
|
78795
78888
|
}
|
|
78796
78889
|
}
|
|
78890
|
+
const configuredProviders = getConfiguredImageProviders(values);
|
|
78891
|
+
if (configuredProviders.length === 0) {
|
|
78892
|
+
f2.error("At least one image-generation provider key is required: GEMINI_API_KEY, OPENROUTER_API_KEY, or MINIMAX_API_KEY.");
|
|
78893
|
+
return false;
|
|
78894
|
+
}
|
|
78797
78895
|
if (values.GEMINI_API_KEY) {
|
|
78798
78896
|
const additionalKeys = await promptForAdditionalGeminiKeys(values.GEMINI_API_KEY);
|
|
78799
78897
|
for (let i = 0;i < additionalKeys.length; i++) {
|
|
@@ -78804,6 +78902,38 @@ async function runSetupWizard(options2) {
|
|
|
78804
78902
|
f2.success(`✓ Configured ${totalKeys} Gemini API keys for rotation`);
|
|
78805
78903
|
}
|
|
78806
78904
|
}
|
|
78905
|
+
if (configuredProviders.length === 1) {
|
|
78906
|
+
const [onlyProvider] = configuredProviders;
|
|
78907
|
+
if (onlyProvider !== "google") {
|
|
78908
|
+
values.IMAGE_GEN_PROVIDER = onlyProvider;
|
|
78909
|
+
f2.info(`Set IMAGE_GEN_PROVIDER=${onlyProvider} to match your configured provider path`);
|
|
78910
|
+
} else {
|
|
78911
|
+
f2.info("Using auto mode for Gemini (default; no IMAGE_GEN_PROVIDER needed)");
|
|
78912
|
+
}
|
|
78913
|
+
} else {
|
|
78914
|
+
const selectedProvider = await ie({
|
|
78915
|
+
message: "Which image-generation provider should ClaudeKit prefer by default?",
|
|
78916
|
+
options: [
|
|
78917
|
+
{
|
|
78918
|
+
value: "auto",
|
|
78919
|
+
label: IMAGE_PROVIDER_META.auto.label,
|
|
78920
|
+
hint: IMAGE_PROVIDER_META.auto.hint
|
|
78921
|
+
},
|
|
78922
|
+
...configuredProviders.map((provider) => ({
|
|
78923
|
+
value: provider,
|
|
78924
|
+
label: IMAGE_PROVIDER_META[provider].label,
|
|
78925
|
+
hint: IMAGE_PROVIDER_META[provider].hint
|
|
78926
|
+
}))
|
|
78927
|
+
],
|
|
78928
|
+
initialValue: getDefaultImageProviderSelection(configuredProviders, globalEnv.IMAGE_GEN_PROVIDER)
|
|
78929
|
+
});
|
|
78930
|
+
if (lD(selectedProvider)) {
|
|
78931
|
+
f2.warning("Setup cancelled");
|
|
78932
|
+
return false;
|
|
78933
|
+
}
|
|
78934
|
+
values.IMAGE_GEN_PROVIDER = selectedProvider;
|
|
78935
|
+
f2.info(`Set IMAGE_GEN_PROVIDER=${selectedProvider}`);
|
|
78936
|
+
}
|
|
78807
78937
|
await generateEnvFile(targetDir, values);
|
|
78808
78938
|
f2.success(`Configuration saved to ${join65(targetDir, ".env")}`);
|
|
78809
78939
|
return true;
|
|
@@ -78862,7 +78992,7 @@ async function promptSetupWizardIfNeeded(options2) {
|
|
|
78862
78992
|
return;
|
|
78863
78993
|
}
|
|
78864
78994
|
const missingKeys = missing.map((m2) => m2.label).join(", ");
|
|
78865
|
-
const promptMessage = envExists ? `Missing required: ${missingKeys}. Set up now?` : "Set up API keys now? (Gemini
|
|
78995
|
+
const promptMessage = envExists ? `Missing required: ${missingKeys}. Set up now?` : "Set up API keys now? (Choose Gemini, OpenRouter, or MiniMax for ai-multimodal image generation, then optionally set a preferred provider; webhooks optional)";
|
|
78866
78996
|
const shouldSetup = await prompts.confirm(promptMessage);
|
|
78867
78997
|
if (shouldSetup) {
|
|
78868
78998
|
await runSetupWizard({
|
|
@@ -78871,12 +79001,32 @@ async function promptSetupWizardIfNeeded(options2) {
|
|
|
78871
79001
|
});
|
|
78872
79002
|
} else {
|
|
78873
79003
|
prompts.note(`Create ${envPath} manually or run 'ck init' again.
|
|
78874
|
-
Required: GEMINI_API_KEY
|
|
78875
|
-
Optional: DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN`, "Configuration skipped");
|
|
79004
|
+
Required: one of GEMINI_API_KEY, OPENROUTER_API_KEY, MINIMAX_API_KEY
|
|
79005
|
+
Optional: IMAGE_GEN_PROVIDER, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN`, "Configuration skipped");
|
|
78876
79006
|
}
|
|
78877
79007
|
}
|
|
78878
79008
|
|
|
78879
79009
|
// src/domains/health-checks/checkers/env-keys-checker.ts
|
|
79010
|
+
var GLOBAL_PROVIDER_SETUP_SUGGESTION = "Run: ck init --global (configure Gemini, OpenRouter, or MiniMax)";
|
|
79011
|
+
var PROVIDER_SETUP_SUGGESTION = "Run: ck init (configure Gemini, OpenRouter, or MiniMax)";
|
|
79012
|
+
function formatConfiguredProviderMessage(providers2) {
|
|
79013
|
+
if (providers2.length === 0) {
|
|
79014
|
+
return "No supported image-generation provider keys configured";
|
|
79015
|
+
}
|
|
79016
|
+
const labels = providers2.map((provider) => {
|
|
79017
|
+
switch (provider) {
|
|
79018
|
+
case "google":
|
|
79019
|
+
return "Gemini";
|
|
79020
|
+
case "openrouter":
|
|
79021
|
+
return "OpenRouter";
|
|
79022
|
+
case "minimax":
|
|
79023
|
+
return "MiniMax";
|
|
79024
|
+
default:
|
|
79025
|
+
return provider;
|
|
79026
|
+
}
|
|
79027
|
+
});
|
|
79028
|
+
return `Configured image providers: ${labels.join(", ")}`;
|
|
79029
|
+
}
|
|
78880
79030
|
async function checkEnvKeys(setup) {
|
|
78881
79031
|
const results = [];
|
|
78882
79032
|
if (setup.global.path) {
|
|
@@ -78892,7 +79042,7 @@ async function checkEnvKeys(setup) {
|
|
|
78892
79042
|
status: "warn",
|
|
78893
79043
|
message: globalCheck.envExists ? `Missing: ${missingKeys}` : ".env file not found",
|
|
78894
79044
|
details: globalEnvPath,
|
|
78895
|
-
suggestion:
|
|
79045
|
+
suggestion: GLOBAL_PROVIDER_SETUP_SUGGESTION,
|
|
78896
79046
|
autoFixable: false
|
|
78897
79047
|
});
|
|
78898
79048
|
} else {
|
|
@@ -78902,7 +79052,7 @@ async function checkEnvKeys(setup) {
|
|
|
78902
79052
|
group: "claudekit",
|
|
78903
79053
|
priority: "standard",
|
|
78904
79054
|
status: "pass",
|
|
78905
|
-
message:
|
|
79055
|
+
message: formatConfiguredProviderMessage(globalCheck.configuredProviders),
|
|
78906
79056
|
details: globalEnvPath,
|
|
78907
79057
|
autoFixable: false
|
|
78908
79058
|
});
|
|
@@ -78921,7 +79071,7 @@ async function checkEnvKeys(setup) {
|
|
|
78921
79071
|
status: "warn",
|
|
78922
79072
|
message: projectCheck.envExists ? `Missing: ${missingKeys}` : ".env file not found",
|
|
78923
79073
|
details: projectEnvPath,
|
|
78924
|
-
suggestion:
|
|
79074
|
+
suggestion: PROVIDER_SETUP_SUGGESTION,
|
|
78925
79075
|
autoFixable: false
|
|
78926
79076
|
});
|
|
78927
79077
|
} else {
|
|
@@ -78931,7 +79081,7 @@ async function checkEnvKeys(setup) {
|
|
|
78931
79081
|
group: "claudekit",
|
|
78932
79082
|
priority: "standard",
|
|
78933
79083
|
status: "pass",
|
|
78934
|
-
message:
|
|
79084
|
+
message: formatConfiguredProviderMessage(projectCheck.configuredProviders),
|
|
78935
79085
|
details: projectEnvPath,
|
|
78936
79086
|
autoFixable: false
|
|
78937
79087
|
});
|
|
@@ -83920,8 +84070,11 @@ import { platform as platform9 } from "node:os";
|
|
|
83920
84070
|
// src/types/skills-dependencies.ts
|
|
83921
84071
|
var SKILLS_DEPENDENCIES = {
|
|
83922
84072
|
python: [
|
|
83923
|
-
{ name: "google-genai", description: "Required for ai-multimodal
|
|
83924
|
-
{
|
|
84073
|
+
{ name: "google-genai", description: "Required for ai-multimodal Gemini provider support" },
|
|
84074
|
+
{
|
|
84075
|
+
name: "pillow, pypdf, requests",
|
|
84076
|
+
description: "Image/PDF processing and provider HTTP clients"
|
|
84077
|
+
},
|
|
83925
84078
|
{ name: "python-dotenv", description: "Environment variable management" }
|
|
83926
84079
|
],
|
|
83927
84080
|
system: [
|