{"id":18594470,"url":"https://github.com/bauhausphp/cli","last_synced_at":"2025-07-08T20:09:35.917Z","repository":{"id":41050341,"uuid":"355541482","full_name":"bauhausphp/cli","owner":"bauhausphp","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-16T14:03:25.000Z","size":47,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-26T20:28:07.843Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bauhausphp.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}},"created_at":"2021-04-07T12:44:49.000Z","updated_at":"2021-09-27T17:18:01.000Z","dependencies_parsed_at":"2023-01-25T22:01:47.233Z","dependency_job_id":null,"html_url":"https://github.com/bauhausphp/cli","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bauhausphp%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bauhausphp","download_url":"https://codeload.github.com/bauhausphp/cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239376451,"owners_count":19628355,"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-11-07T01:15:41.026Z","updated_at":"2025-02-17T22:29:16.982Z","avatar_url":"https://github.com/bauhausphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cli\n\n```php\n\u003c?php\n\nuse Bauhaus\\Cli;\nuse Bauhaus\\CliSettings;\nuse Bauhaus\\Cli\\Entrypoint;\nuse Bauhaus\\Cli\\Input;\nuse Bauhaus\\Cli\\Output;\nuse Bauhaus\\Cli\\Processor\\Middleware;\nuse Bauhaus\\Cli\\Attribute\\Name;\nuse Bauhaus\\Cli\\Processor\\Handler;\n\n#[Name('command-id')]\nclass MyCliEntrypoint implements Entrypoint\n{\n    public function execute(Input $input, Output $output): void\n    {\n        $output-\u003ewrite(\"my entrypoing\\n\");\n    }\n}\n\nclass MyCliMiddleware implements Middleware\n{\n    public function execute(Input $input,Output $output, Handler $next): void\n    {\n        $output-\u003ewrite(\"my middleware\\n\");\n        $next-\u003eexecute($input, $output);\n    }\n}\n\n$settings = CliSettings::default()\n    -\u003ewithOutput('/var/tmp/file') // default is php://stdout\n    -\u003ewithEntrypoints(\n        new MyCliEntrypoint(),\n    )\n    -\u003ewithMiddlewares(\n        new MyCliMiddleware(),\n    );\n\n$cliApplication = Cli::bootstrap($settings);\n\n$cliApplication-\u003erun('./bin', 'command-id'); // it could be $cliApplication-\u003erun($_SERVER['argv']);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbauhausphp%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbauhausphp%2Fcli/lists"}