MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / handleUsageCommand

Function handleUsageCommand

cli/src/commands/usage.ts:7–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import type { PostUserMessageFn } from '../types/contracts/send-message'
6
7export async function handleUsageCommand(): Promise<{
8 postUserMessage: PostUserMessageFn
9}> {
10 const authToken = getAuthToken()
11
12 if (!authToken) {
13 const postUserMessage: PostUserMessageFn = (prev) => [
14 ...prev,
15 getSystemMessage('Please log in first to view your usage.'),
16 ]
17 return { postUserMessage }
18 }
19
20 // Show the usage banner - the useUsageQuery hook will automatically fetch
21 // the data when the banner becomes visible
22 useChatStore.getState().setInputMode('usage')
23
24 const postUserMessage: PostUserMessageFn = (prev) => prev
25 return { postUserMessage }
26}

Callers 1

Calls 1

getAuthTokenFunction · 0.90

Tested by

no test coverage detected