import { describe, it, expect } from 'vitest';
import { execSync } from 'child_process';
import path from 'path';
describe('CLI', () => {
    const cliPath = path.resolve(__dirname, '../../bin/expxagents.js');
    it('shows help output with all commands', () => {
        execSync('npm run build', { cwd: path.resolve(__dirname, '../..') });
        const output = execSync(`node ${cliPath} --help`, { encoding: 'utf-8' });
        expect(output).toContain('expxagents');
        expect(output).toContain('init');
        expect(output).toContain('create');
        expect(output).toContain('run');
        expect(output).toContain('stop');
        expect(output).toContain('list');
        expect(output).toContain('install');
        expect(output).toContain('uninstall');
        expect(output).toContain('server');
    });
    it('shows version', () => {
        const output = execSync(`node ${cliPath} --version`, { encoding: 'utf-8' });
        expect(output.trim()).toMatch(/^\d+\.\d+\.\d+$/);
    });
});
