function formatCredentialLabel(credential: ClaudeCliReadableCredential): string { if (credential.type === "oauth" || credential.type === "token") { return credential.type;
} return"unknown";
}
function formatWorkspaceHealthLine(workspaceDir: string, health: ClaudeCliDirHealth): string { const display = shortenHomePath(workspaceDir); if (health === "present") { return `- Workspace: ${display} (writable).`;
} if (health === "missing") { return `- Workspace: ${display} (missing; OpenClaw will create it on first run).`;
} if (health === "not_directory") { return `- Workspace: ${display} exists but is not a directory.`;
} if (health === "unreadable") { return `- Workspace: ${display} is not readable by this user.`;
} return `- Workspace: ${display} is not writable by this user.`;
}
function formatProjectDirHealthLine(projectDir: string, health: ClaudeCliDirHealth): string { const display = shortenHomePath(projectDir); if (health === "present") { return `- Claude project dir: ${display} (present).`;
} if (health === "missing") { return `- Claude project dir: ${display} (not created yet; it appears after the first Claude CLI turn in this workspace).`;
} if (health === "not_directory") { return `- Claude project dir: ${display} exists but is not a directory.`;
} if (health === "unreadable") { return `- Claude project dir: ${display} is not readable by this user.`;
} return `- Claude project dir: ${display} is not writable by this user.`;
}
if (commandPath) {
lines.push(`- Binary: ${shortenHomePath(commandPath)}.`);
} else {
lines.push(`- Binary: command "${command}" was not found on PATH.`);
fixHints.push( "- Fix: install Claude CLI or set agents.defaults.cliBackends.claude-cli.command to the real binary path.",
);
}
if (credential) {
lines.push(`- Headless Claude auth: OK (${formatCredentialLabel(credential)}).`);
} else {
lines.push("- Headless Claude auth: unavailable without interactive prompting.");
fixHints.push(
`- Fix: run ${formatCliCommand("claude auth login")}, then ${formatCliCommand( "openclaw models auth login --provider anthropic --method cli --set-default",
)}.`,
);
}
lines.push(formatWorkspaceHealthLine(workspaceDir, workspaceHealth)); if (
workspaceHealth === "readonly" ||
workspaceHealth === "unreadable" ||
workspaceHealth === "not_directory"
) {
fixHints.push("- Fix: make the workspace a readable, writable directory for the gateway user.");
}
lines.push(formatProjectDirHealthLine(projectDir, projectDirHealth)); if (projectDirHealth === "unreadable" || projectDirHealth === "not_directory") {
fixHints.push( "- Fix: make the Claude project dir readable, or remove the broken path and let Claude recreate it.",
);
}
if (fixHints.length > 0) {
lines.push(...fixHints);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.