async function main() {
    let tempDir;
    try {
        const url = await validateInput(cli.input);
        if (process.env.NODE_ENV !== 'test') {
            const result = await downloadRepository(url);
            tempDir = result.tempDir;
            
            const outputPath = cli.flags.output || `${result.repoName}.txt`;
            const content = await processFiles(tempDir, {
                threshold: cli.flags.threshold,
                includeAll: cli.flags.includeAll
            });

            if (!content) {
                throw new Error('No content was generated from the repository');
            }

            await writeOutput(content, outputPath);
        }
    } catch (error) {
        if (process.env.NODE_ENV === 'test') {
            throw error;
        } else {
            console.error(chalk.red('\nAn unexpected error occurred:'));
            console.error(error.message || error);
            exit(1);
        }
    } finally {
        if (tempDir) {
            await cleanup(tempDir);
        }
    }
}
Main application function that orchestrates the entire process
@returns {Promise<void>}