Plandex / cli /src /checks /config-check.ts
AUXteam's picture
Upload folder using huggingface_hub
cf9339a verified
raw
history blame
955 Bytes
import { readConfig, configExists, resolveConfigPath } from "../config/store.js";
import type { CheckResult } from "./index.js";
export function configCheck(configPath?: string): CheckResult {
const filePath = resolveConfigPath(configPath);
if (!configExists(configPath)) {
return {
name: "Config file",
status: "fail",
message: `Config file not found at ${filePath}`,
canRepair: false,
repairHint: "Run `paperclipai onboard` to create one",
};
}
try {
readConfig(configPath);
return {
name: "Config file",
status: "pass",
message: `Valid config at ${filePath}`,
};
} catch (err) {
return {
name: "Config file",
status: "fail",
message: `Invalid config: ${err instanceof Error ? err.message : String(err)}`,
canRepair: false,
repairHint: "Run `paperclipai configure --section database` (or `paperclipai onboard` to recreate)",
};
}
}