feat(cli): show client ID in usage command output

- Add client field to UsageEntry type
- Display client ID when present in usage entries
This commit is contained in:
redshift
2026-03-21 16:52:42 +00:00
parent 7afeefaad1
commit b3fc02b1cc
+3 -1
View File
@@ -39,6 +39,7 @@ type UsageEntry = {
promptTokens: number;
completionTokens: number;
totalTokens: number;
client?: string;
};
const cliVersion = "0.1.0";
@@ -355,8 +356,9 @@ program
const time = new Date(entry.timestamp).toISOString();
const provider = entry.baseUrl || "unknown";
const reqId = entry.requestId || "unknown";
const client = entry.client ? ` | client: ${entry.client}` : "";
console.log(
`${index + 1}. ${time} | ${entry.modelId} | ${provider} | ${entry.satsCost.toFixed(3)} sats`,
`${index + 1}. ${time} | ${entry.modelId} | ${provider} | ${entry.satsCost.toFixed(3)} sats${client}`,
);
console.log(
` tokens p/c/t: ${entry.promptTokens}/${entry.completionTokens}/${entry.totalTokens} | request: ${reqId}`,