Add CLI package, config file support, and workspace setup
Add cli/ package with initial scaffolding. Add config-schema to shared package for typed configuration. Add server config-file loader for paperclip.config.ts support. Register cli in pnpm workspace. Add .paperclip/ and .pnpm-store/ to gitignore. Minor Companies page fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
33
cli/src/checks/config-check.ts
Normal file
33
cli/src/checks/config-check.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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 `paperclip 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 `paperclip onboard` to recreate",
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user