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:
43
cli/src/prompts/llm.ts
Normal file
43
cli/src/prompts/llm.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import * as p from "@clack/prompts";
|
||||
import type { LlmConfig } from "../config/schema.js";
|
||||
|
||||
export async function promptLlm(): Promise<LlmConfig | undefined> {
|
||||
const configureLlm = await p.confirm({
|
||||
message: "Configure an LLM provider now?",
|
||||
initialValue: false,
|
||||
});
|
||||
|
||||
if (p.isCancel(configureLlm)) {
|
||||
p.cancel("Setup cancelled.");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (!configureLlm) return undefined;
|
||||
|
||||
const provider = await p.select({
|
||||
message: "LLM provider",
|
||||
options: [
|
||||
{ value: "claude" as const, label: "Claude (Anthropic)" },
|
||||
{ value: "openai" as const, label: "OpenAI" },
|
||||
],
|
||||
});
|
||||
|
||||
if (p.isCancel(provider)) {
|
||||
p.cancel("Setup cancelled.");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const apiKey = await p.password({
|
||||
message: `${provider === "claude" ? "Anthropic" : "OpenAI"} API key`,
|
||||
validate: (val) => {
|
||||
if (!val) return "API key is required";
|
||||
},
|
||||
});
|
||||
|
||||
if (p.isCancel(apiKey)) {
|
||||
p.cancel("Setup cancelled.");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
return { provider, apiKey };
|
||||
}
|
||||
Reference in New Issue
Block a user