import { describe, it, expect } from 'vitest';
import { createProgram } from './index.js';

describe('CLI program', () => {
  it('creates a commander program with expected commands', () => {
    const program = createProgram();
    const commandNames = program.commands.map((c) => c.name());

    expect(commandNames).toContain('start');
    expect(commandNames).toContain('tui');
    expect(commandNames).toContain('send');
    expect(commandNames).toContain('sessions');
    expect(commandNames).toContain('doctor');
    expect(commandNames).toContain('config');
    expect(commandNames).toContain('skills');

    expect(commandNames).toContain('openai-auth');
    expect(commandNames).toContain('openai-key');
    expect(commandNames).toContain('anthropic-auth');
    expect(commandNames).toContain('zai-auth');
  });

  it('has version info', () => {
    const program = createProgram();
    expect(program.version()).toBeDefined();
  });

  it('has description', () => {
    const program = createProgram();
    expect(program.description()).toContain('AI');
  });
});
