{"id":17369619,"url":"https://github.com/jblond/php-cli","last_synced_at":"2025-07-21T04:33:43.597Z","repository":{"id":56997257,"uuid":"67442766","full_name":"JBlond/php-cli","owner":"JBlond","description":"php command line / cli scritping and coloring classes","archived":false,"fork":false,"pushed_at":"2024-12-16T12:55:48.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-21T01:48:06.655Z","etag":null,"topics":["bash","bash-scripting","cli","cli-scritping","php","php-cli","php-command"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JBlond.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-05T18:33:11.000Z","updated_at":"2024-12-16T12:55:52.000Z","dependencies_parsed_at":"2025-04-15T03:28:16.651Z","dependency_job_id":"1a85d4e9-41f4-4f56-8fd4-211be07dd402","html_url":"https://github.com/JBlond/php-cli","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/JBlond/php-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBlond%2Fphp-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBlond%2Fphp-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBlond%2Fphp-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBlond%2Fphp-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JBlond","download_url":"https://codeload.github.com/JBlond/php-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JBlond%2Fphp-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266240984,"owners_count":23898063,"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":["bash","bash-scripting","cli","cli-scritping","php","php-cli","php-command"],"created_at":"2024-10-16T00:05:54.792Z","updated_at":"2025-07-21T04:33:43.581Z","avatar_url":"https://github.com/JBlond.png","language":"PHP","readme":"# php-cli\n\n##\n\n```bash\ncomposer require jblond/php-cli\n```\n\n## php command line / cli scripting classes\n\n### Example\n\n```PHP\n\u003c?php\nuse jblond\\cli\\Cli;\nuse jblond\\cli\\CliColors;\n\n$cli = new Cli();\n$colors = new CliColors();\n\n$string = $colors-\u003egetColoredString('This is a test','red','black');\n$cli-\u003eoutput($string); // normal \n$cli-\u003eerror($string); // error \n\n// This input requires Hello or world as input\n$cli-\u003einput('Hello world: ',array('Hello','world'));\n\n// This input requires only test\n\n$cli-\u003einput('Test2: ', 'test');\n\n\n// This input requires any input\n\n$cli-\u003einput('Free input: ', '');\n\n// Question with default N \n$answer = $cli-\u003einput('Do this? y/N', array('y','n','Y','N'), 'N');\necho $answer;\n```\n\nInspired by the php.net docs\nhttp://php.net/manual/en/features.commandline.io-streams.php\n\nand a modified version of \nhttp://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjblond%2Fphp-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjblond%2Fphp-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjblond%2Fphp-cli/lists"}