trip-optimizer 0.1.0 → 0.1.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/cli.js +15 -16
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -634,22 +634,6 @@ async function initCommand(name) {
|
|
|
634
634
|
${t("init.title")}: ${name}
|
|
635
635
|
`));
|
|
636
636
|
const profile = loadProfile();
|
|
637
|
-
const useVertex = !!(process.env.CLAUDE_CODE_USE_VERTEX === "1" || process.env.GOOGLE_CLOUD_PROJECT);
|
|
638
|
-
if (!config.api_key && !useVertex) {
|
|
639
|
-
console.log(chalk.yellow(` ${t("init.first_time")}
|
|
640
|
-
`));
|
|
641
|
-
const apiKey = await input({
|
|
642
|
-
message: t("init.api_key"),
|
|
643
|
-
validate: (v) => v.length > 0 || t("init.api_key_required")
|
|
644
|
-
});
|
|
645
|
-
config.api_key = apiKey;
|
|
646
|
-
saveConfig(config);
|
|
647
|
-
console.log(chalk.green(` ${t("init.api_key_saved")}
|
|
648
|
-
`));
|
|
649
|
-
} else if (useVertex && !config.api_key) {
|
|
650
|
-
console.log(chalk.cyan(` ${t("init.vertex_detected")}
|
|
651
|
-
`));
|
|
652
|
-
}
|
|
653
637
|
if (config.model_override) {
|
|
654
638
|
const mo = config.model_override;
|
|
655
639
|
const maskedKey = mo.api_key.length > 8 ? mo.api_key.slice(0, 4) + "..." + mo.api_key.slice(-4) : "****";
|
|
@@ -716,6 +700,21 @@ async function initCommand(name) {
|
|
|
716
700
|
console.log(chalk.green(`
|
|
717
701
|
${t("init.model_saved")}`));
|
|
718
702
|
console.log(chalk.yellow(` ${t("init.model_note")}
|
|
703
|
+
`));
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
const useVertex = !!(process.env.CLAUDE_CODE_USE_VERTEX === "1" || process.env.GOOGLE_CLOUD_PROJECT);
|
|
707
|
+
if (!config.model_override && !useVertex) {
|
|
708
|
+
if (!config.api_key) {
|
|
709
|
+
const apiKey = await input({
|
|
710
|
+
message: t("init.api_key"),
|
|
711
|
+
validate: (v) => v.length > 0 || "Required"
|
|
712
|
+
});
|
|
713
|
+
config.api_key = apiKey;
|
|
714
|
+
saveConfig(config);
|
|
715
|
+
} else {
|
|
716
|
+
const maskedKey = config.api_key.length > 8 ? config.api_key.slice(0, 4) + "..." + config.api_key.slice(-4) : "****";
|
|
717
|
+
console.log(chalk.cyan(` Anthropic API key: ${maskedKey}
|
|
719
718
|
`));
|
|
720
719
|
}
|
|
721
720
|
}
|