refactor(daemon-cli): share status text styling

This commit is contained in:
Peter Steinberger
2026-02-16 02:42:46 +00:00
parent c1655982d4
commit 7c27c2d659
3 changed files with 22 additions and 17 deletions

View File

@@ -12,10 +12,11 @@ import {
import { isWSLEnv } from "../../infra/wsl.js";
import { getResolvedLoggerSettings } from "../../logging.js";
import { defaultRuntime } from "../../runtime.js";
import { colorize, isRich, theme } from "../../terminal/theme.js";
import { colorize, theme } from "../../terminal/theme.js";
import { shortenHomePath } from "../../utils.js";
import { formatCliCommand } from "../command-format.js";
import {
createCliStatusTextStyles,
filterDaemonEnv,
formatRuntimeStatus,
renderRuntimeHints,
@@ -53,13 +54,8 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
return;
}
const rich = isRich();
const label = (value: string) => colorize(rich, theme.muted, value);
const accent = (value: string) => colorize(rich, theme.accent, value);
const infoText = (value: string) => colorize(rich, theme.info, value);
const okText = (value: string) => colorize(rich, theme.success, value);
const warnText = (value: string) => colorize(rich, theme.warn, value);
const errorText = (value: string) => colorize(rich, theme.error, value);
const { rich, label, accent, infoText, okText, warnText, errorText } =
createCliStatusTextStyles();
const spacer = () => defaultRuntime.log("");
const { service, rpc, extraServices } = status;