cli: add quickstart onboarding flow and config-scoped jwt env handling

This commit is contained in:
Dotta
2026-03-03 10:24:34 -06:00
parent 5c07bdafc5
commit 3248974435
9 changed files with 277 additions and 115 deletions

View File

@@ -6,8 +6,8 @@ import {
} from "../config/env.js";
import type { CheckResult } from "./index.js";
export function agentJwtSecretCheck(): CheckResult {
if (readAgentJwtSecretFromEnv()) {
export function agentJwtSecretCheck(configPath?: string): CheckResult {
if (readAgentJwtSecretFromEnv(configPath)) {
return {
name: "Agent JWT secret",
status: "pass",
@@ -15,7 +15,7 @@ export function agentJwtSecretCheck(): CheckResult {
};
}
const envPath = resolveAgentJwtEnvFile();
const envPath = resolveAgentJwtEnvFile(configPath);
const fileSecret = readAgentJwtSecretFromEnvFile(envPath);
if (fileSecret) {
@@ -33,7 +33,7 @@ export function agentJwtSecretCheck(): CheckResult {
message: `PAPERCLIP_AGENT_JWT_SECRET missing from environment and ${envPath}`,
canRepair: true,
repair: () => {
ensureAgentJwtSecret();
ensureAgentJwtSecret(configPath);
},
repairHint: `Run with --repair to create ${envPath} containing PAPERCLIP_AGENT_JWT_SECRET`,
};