{"id":15726714,"url":"https://github.com/grasmash/symfony-console-checklist","last_synced_at":"2025-03-13T02:31:07.751Z","repository":{"id":65386342,"uuid":"590526514","full_name":"grasmash/symfony-console-checklist","owner":"grasmash","description":"A utility for creating animated spinners via Symfony Console.","archived":false,"fork":false,"pushed_at":"2023-01-19T23:34:11.000Z","size":43,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T22:44:04.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grasmash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-18T16:09:20.000Z","updated_at":"2023-06-22T19:25:16.000Z","dependencies_parsed_at":"2023-02-11T22:30:24.437Z","dependency_job_id":null,"html_url":"https://github.com/grasmash/symfony-console-checklist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fsymfony-console-checklist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fsymfony-console-checklist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fsymfony-console-checklist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grasmash%2Fsymfony-console-checklist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grasmash","download_url":"https://codeload.github.com/grasmash/symfony-console-checklist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243327809,"owners_count":20273751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T22:40:24.969Z","updated_at":"2025-03-13T02:31:07.453Z","avatar_url":"https://github.com/grasmash.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony Console Spinner\n\nThis utility provides two tools for use with Symfony Console:\n1. An animated spinner class. This is a wrapper around Symfony's built-in Progress Bar which will show a colored, animated spinner. It requires advance() to be called in order for the spinner to spin.\n2. A checklist class. This is a wrapper around the Spinner. It allows you to emit a checklist item, display a spinner next to it to indicate that it is in progress, and write a \"message detail\" under the item.\n\n![image](https://user-images.githubusercontent.com/539205/213492499-014d79f3-7b8b-4362-9f31-72f9dcaaa37b.png)\n\n## Usage\n\n### Simple Spinner\n```php\n$output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n$spinner = new Spinner($output);\n$spinner-\u003esetMessage('Fetching a really big file from far away');\n$spinner-\u003estart();\nwhile (getting_the_file()) {\n    $spinner-\u003eadvance();\n}\n$spinner-\u003efinish();\n```\n\n### Simple Checklist\n```php\n$output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n$checklist = new Checklist($output);\n$checklist-\u003eaddItem('Fetching a really big file from far away');\nwhile (getting_the_file()) {\n    $checklist-\u003eupdateProgressBar('Still getting the file');\n}\n$checklist-\u003ecompletePreviousItem();\n\n$checklist-\u003eaddItem('Doing the next thing');\n```\n\n### Advanced Checklist Example\n\n```php\n  use Symfony\\Component\\Process\\Process;\n  use Symfony\\Component\\Console\\Output\\ConsoleOutput;\n  \n  public function runMyCommand() {\n    $output = new ConsoleOutput();\n    $checklist = new Checklist($output);\n    $checklist-\u003eaddItem('Running a command with lots of output');\n\n    $process = new Process([\n      'composer',\n      'run-script',\n      'my-script',\n      '--no-interaction',\n    ]);\n    $process-\u003estart();\n    $process-\u003ewait(function ($type, $buffer) use ($checklist, $output) {\n      if (!$output-\u003eisVerbose() \u0026\u0026 $checklist-\u003egetItems()) {\n        $checklist-\u003eupdateProgressBar($buffer);\n      }\n      $output-\u003ewriteln($buffer, OutputInterface::VERBOSITY_VERY_VERBOSE);\n    });\n    if (!$process-\u003eisSuccessful()) {\n      throw new \\Exception('Something went wrong! {message}' . $process-\u003egetErrorOutput());\n    }\n\n    $checklist-\u003ecompletePreviousItem();\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrasmash%2Fsymfony-console-checklist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrasmash%2Fsymfony-console-checklist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrasmash%2Fsymfony-console-checklist/lists"}