Repository: apify/crawlee-python
File: src/crawlee/_cli.py (Python)

Code before:
                progress.add_task(description='Bootstrapping...', total=None)
                try:
                    cookiecutter(
                        template=str(template_directory),
                        no_input=True,
                        extra_context={
                            'project_name': project_name,
                            'package_manager': package_manager,
                            'crawler_type': crawler_type,
                            'http_client': http_client,
                            'enable_apify_integration': enable_apify_integration,
                            'start_url': start_url,
                        },
                    )
                except Exception as exc:
                    # Print just the last line of the error message (the actual error without traceback)
                    if 'Hook script failed' in str(exc):
                        typer.echo('Project creation failed. Check the error message above.', err=True)
                    else:
                        typer.echo(f'Project creation failed: {exc!s}', err=True)

                    sys.exit(1)

            typer.echo(f'Your project "{project_name}" was created.')

            if package_manager == 'manual':
                typer.echo(
                    f'To run it, navigate to the directory: "cd {project_name}", '
                    f'install the dependencies listed in "requirements.txt" '
                    f'and run it using "python -m {package_name}".'
                )
            elif package_manager == 'pip':
                typer.echo(
                    f'To run it, navigate to the directory: "cd {project_name}", '
                    f'activate the virtual environment in ".venv" ("source .venv/bin/activate") '
                    f'and run your project using "python -m {package_name}".'
                )
            elif package_manager in {'poetry', 'uv'}:
                typer.echo(
                    f'To run it, navigate to the directory: "cd {project_name}", '
                    f'and run it using "{package_manager} run python -m {package_name}".'
                )

            typer.echo(f'See the "{project_name}/README.md" for more information.')

    except KeyboardInterrupt:
        typer.echo('Operation cancelled by user.')


Review comment (refactor):
nit: Perhaps if you could pull the `typer.echo` calls out of the `with progress()` block, we could get rid of the duplicated "Bootstrapping..." line? :thinking: 

Code after:
                bootstrap_task = progress.add_task(description='Bootstrapping...', total=None)

                try:
                    cookiecutter(
                        template=str(template_directory),
                        no_input=True,
                        extra_context={
                            'project_name': project_name,
                            'package_manager': package_manager,
                            'crawler_type': crawler_type,
                            'http_client': http_client,
                            'enable_apify_integration': enable_apify_integration,
                            'start_url': start_url,
                        },
                    )
                except Exception as exc:
                    progress.update(bootstrap_task, visible=False)
                    progress.refresh()

                    # Print just the last line of the error message (the actual error without traceback)
                    if 'Hook script failed' in str(exc):
                        typer.echo('Project creation failed. Check the error message above.', err=True)
                    else:
                        typer.echo(f'Project creation failed: {exc!s}', err=True)

                    sys.exit(1)

            typer.echo(f'Your project "{project_name}" was created.')

            if package_manager == 'manual':
                typer.echo(
                    f'To run it, navigate to the directory: "cd {project_name}", '
                    f'install the dependencies listed in "requirements.txt" '
                    f'and run it using "python -m {package_name}".'
                )
            elif package_manager == 'pip':
                typer.echo(
                    f'To run it, navigate to the directory: "cd {project_name}", '
                    f'activate the virtual environment in ".venv" ("source .venv/bin/activate") '
                    f'and run your project using "python -m {package_name}".'
                )
            elif package_manager in {'poetry', 'uv'}:
                typer.echo(
                    f'To run it, navigate to the directory: "cd {project_name}", '
                    f'and run it using "{package_manager} run python -m {package_name}".'
                )

            typer.echo(f'See the "{project_name}/README.md" for more information.')

    except KeyboardInterrupt:
        typer.echo('Operation cancelled by user.')