Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/commands/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export const blocksCommand = define({
log(`Time Remaining: ${pc.green(`${Math.floor(remaining / 60)}h ${remaining % 60}m`)}\n`);

log(pc.bold('Current Usage:'));
log(` Messages: ${formatNumber(block.entries.length)}`);
log(` Input Tokens: ${formatNumber(block.tokenCounts.inputTokens)}`);
log(` Output Tokens: ${formatNumber(block.tokenCounts.outputTokens)}`);
log(` Total Cost: ${formatCurrency(block.costUSD)}\n`);
Expand Down Expand Up @@ -359,8 +360,8 @@ export const blocksCommand = define({
// Calculate token limit if "max" is specified
const actualTokenLimit = parseTokenLimit(ctx.values.tokenLimit, maxTokensFromAll);

const tableHeaders = ['Block Start', 'Duration/Status', 'Models', 'Tokens'];
const tableAligns: ('left' | 'right' | 'center')[] = ['left', 'left', 'left', 'right'];
const tableHeaders = ['Block Start', 'Duration/Status', 'Models', 'Messages', 'Tokens'];
const tableAligns: ('left' | 'right' | 'center')[] = ['left', 'left', 'left', 'right', 'right'];

// Add % column if token limit is set
if (actualTokenLimit != null && actualTokenLimit > 0) {
Expand Down Expand Up @@ -389,6 +390,7 @@ export const blocksCommand = define({
pc.gray('(inactive)'),
pc.gray('-'),
pc.gray('-'),
pc.gray('-'),
];
if (actualTokenLimit != null && actualTokenLimit > 0) {
gapRow.push(pc.gray('-'));
Expand All @@ -405,6 +407,7 @@ export const blocksCommand = define({
formatBlockTime(block, useCompactFormat),
status,
formatModels(block.models),
formatNumber(block.entries.length),
formatNumber(totalTokens),
];

Expand Down Expand Up @@ -438,6 +441,7 @@ export const blocksCommand = define({
{ content: pc.gray(`(assuming ${formatNumber(actualTokenLimit)} token limit)`), hAlign: 'right' as const },
pc.blue('REMAINING'),
'',
'',
remainingText,
remainingPercentText,
'', // No cost for remaining - it's about token limit, not cost
Expand All @@ -457,6 +461,7 @@ export const blocksCommand = define({
{ content: pc.gray('(assuming current burn rate)'), hAlign: 'right' as const },
pc.yellow('PROJECTED'),
'',
'',
projectedText,
];

Expand Down