Skip to content

Commit 76d4ac2

Browse files
feat(cli): show plan and add-ons in whoami command (#1260)
* feat(cli): show plan and add-ons in whoami command [AI-70] Display planDisplayName and addon tier display names in the whoami output. Requires the backend PR #935 which adds these fields to the GET /v1/accounts/me response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(cli): assert plan is shown in whoami output Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ee5b472 commit 76d4ac2

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

packages/cli/e2e/__tests__/whoami.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ describe('whomai', () => {
1111
accountId: config.get('accountId'),
1212
})
1313
expect(stdout).toContain(config.get('accountName'))
14+
expect(stdout).toContain('Plan:')
1415
})
1516
})

packages/cli/src/commands/whoami.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,13 @@ export default class Whoami extends AuthCommand {
1010
const account = this.account
1111
const { data: user } = await api.user.get()
1212
this.log(`You are currently on account "${account.name}" (${account.id}) as ${user.name}.`)
13+
if (account.planDisplayName) {
14+
this.log(`Plan: ${account.planDisplayName}`)
15+
}
16+
const addons = account.addons ?? {}
17+
const addonNames = Object.values(addons).map(a => a.tierDisplayName)
18+
if (addonNames.length > 0) {
19+
this.log(`Add-ons: ${addonNames.join(', ')}`)
20+
}
1321
}
1422
}

packages/cli/src/rest/accounts.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import type { AxiosInstance } from 'axios'
22

3+
export interface AddonTier {
4+
tier: string
5+
tierDisplayName: string
6+
}
7+
38
export interface Account {
49
id: string
510
name: string
611
runtimeId: string
12+
plan?: string
13+
planDisplayName?: string
14+
addons?: Record<string, AddonTier>
715
}
816

917
class Accounts {

0 commit comments

Comments
 (0)