wispy-cli 2.6.2 → 2.6.3
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/bin/wispy.mjs +58 -10
- package/package.json +1 -1
package/bin/wispy.mjs
CHANGED
|
@@ -890,18 +890,66 @@ if (args[0] === "config") {
|
|
|
890
890
|
const config = await loadConfig();
|
|
891
891
|
|
|
892
892
|
if (!sub || sub === "show") {
|
|
893
|
-
// wispy config —
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
893
|
+
// wispy config — interactive config menu
|
|
894
|
+
const { select: cfgSelect } = await import("@inquirer/prompts");
|
|
895
|
+
|
|
896
|
+
// Show current status first
|
|
897
|
+
const providers = config.providers ? Object.keys(config.providers) : (config.provider ? [config.provider] : []);
|
|
898
|
+
const providerStr = providers.length > 0 ? providers.join(", ") : _dim("not set");
|
|
899
|
+
const defaultProv = config.defaultProvider ?? config.provider ?? _dim("not set");
|
|
900
|
+
const security = config.security ?? config.securityLevel ?? _dim("not set");
|
|
901
|
+
const language = config.language ?? _dim("auto");
|
|
902
|
+
const wsName = config.workstream ?? "default";
|
|
903
|
+
|
|
904
|
+
console.log(`\n${_bold("Wispy Config")}\n`);
|
|
905
|
+
console.log(` Providers: ${providerStr}`);
|
|
906
|
+
console.log(` Default: ${defaultProv}`);
|
|
907
|
+
console.log(` Security: ${security}`);
|
|
908
|
+
console.log(` Language: ${language}`);
|
|
909
|
+
console.log(` Workstream: ${wsName}`);
|
|
910
|
+
console.log(` Config file: ${_dim(CONFIG_PATH)}`);
|
|
911
|
+
console.log("");
|
|
912
|
+
|
|
913
|
+
const action = await cfgSelect({
|
|
914
|
+
message: "What do you want to change?",
|
|
915
|
+
choices: [
|
|
916
|
+
{ name: "Providers — add/remove AI providers", value: "provider" },
|
|
917
|
+
{ name: "Security — change trust level", value: "security" },
|
|
918
|
+
{ name: "Language — set preferred language", value: "language" },
|
|
919
|
+
{ name: "Channels — configure messaging bots", value: "channels" },
|
|
920
|
+
{ name: "Server — cloud/server settings", value: "server" },
|
|
921
|
+
{ name: "View raw config (JSON)", value: "raw" },
|
|
922
|
+
{ name: "Reset everything", value: "reset" },
|
|
923
|
+
{ name: "Done", value: "done" },
|
|
924
|
+
],
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
if (action === "done") {
|
|
928
|
+
process.exit(0);
|
|
929
|
+
} else if (action === "raw") {
|
|
930
|
+
const display = JSON.parse(JSON.stringify(config));
|
|
931
|
+
if (display.providers) {
|
|
932
|
+
for (const [k, v] of Object.entries(display.providers)) {
|
|
933
|
+
if (v.apiKey) v.apiKey = v.apiKey.slice(0, 6) + "..." + v.apiKey.slice(-4);
|
|
934
|
+
}
|
|
899
935
|
}
|
|
936
|
+
console.log(JSON.stringify(display, null, 2));
|
|
937
|
+
} else if (action === "reset") {
|
|
938
|
+
const { confirm: cfgConfirm } = await import("@inquirer/prompts");
|
|
939
|
+
const yes = await cfgConfirm({ message: "Reset all configuration?", default: false });
|
|
940
|
+
if (yes) {
|
|
941
|
+
const { writeFile: wf } = await import("node:fs/promises");
|
|
942
|
+
await wf(CONFIG_PATH, "{}\n");
|
|
943
|
+
console.log(`${_green("✓")} Config reset. Run 'wispy setup' to reconfigure.`);
|
|
944
|
+
}
|
|
945
|
+
} else {
|
|
946
|
+
// Delegate to setup wizard step
|
|
947
|
+
const { OnboardingWizard } = await import(
|
|
948
|
+
path.join(__dirname, "..", "core", "onboarding.mjs")
|
|
949
|
+
);
|
|
950
|
+
const wizard = new OnboardingWizard();
|
|
951
|
+
await wizard.runStep(action);
|
|
900
952
|
}
|
|
901
|
-
if (display.apiKey) display.apiKey = display.apiKey.slice(0, 6) + "..." + display.apiKey.slice(-4);
|
|
902
|
-
console.log(`\n${_bold("Wispy Config")} ${_dim(CONFIG_PATH)}\n`);
|
|
903
|
-
console.log(JSON.stringify(display, null, 2));
|
|
904
|
-
console.log("");
|
|
905
953
|
|
|
906
954
|
} else if (sub === "get") {
|
|
907
955
|
// wispy config get <key>
|