/ commands / login / index.ts
index.ts
 1  import type { Command } from '../../commands.js'
 2  import { hasAnthropicApiKeyAuth } from '../../utils/auth.js'
 3  import { isEnvTruthy } from '../../utils/envUtils.js'
 4  
 5  export default () =>
 6    ({
 7      type: 'local-jsx',
 8      name: 'login',
 9      description: hasAnthropicApiKeyAuth()
10        ? 'Switch Anthropic accounts'
11        : 'Sign in with your Anthropic account',
12      isEnabled: () => !isEnvTruthy(process.env.DISABLE_LOGIN_COMMAND),
13      load: () => import('./login.js'),
14    }) satisfies Command