/ commands / cost / index.ts
index.ts
 1  /**
 2   * Cost command - minimal metadata only.
 3   * Implementation is lazy-loaded from cost.ts to reduce startup time.
 4   */
 5  import type { Command } from '../../commands.js'
 6  import { isClaudeAISubscriber } from '../../utils/auth.js'
 7  
 8  const cost = {
 9    type: 'local',
10    name: 'cost',
11    description: 'Show the total cost and duration of the current session',
12    get isHidden() {
13      // Keep visible for Ants even if they're subscribers (they see cost breakdowns)
14      if (process.env.USER_TYPE === 'ant') {
15        return false
16      }
17      return isClaudeAISubscriber()
18    },
19    supportsNonInteractive: true,
20    load: () => import('./cost.js'),
21  } satisfies Command
22  
23  export default cost