{"id":15873880,"url":"https://github.com/xy2z/cliclass","last_synced_at":"2026-02-09T17:01:18.093Z","repository":{"id":52420655,"uuid":"154338424","full_name":"xy2z/CliClass","owner":"xy2z","description":"Easily create a simple CLI tool from PHP classes","archived":false,"fork":false,"pushed_at":"2021-04-29T19:27:45.000Z","size":14,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-24T10:31:16.767Z","etag":null,"topics":["cli","cli-framework","php"],"latest_commit_sha":null,"homepage":"","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/xy2z.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":"2018-10-23T14:02:54.000Z","updated_at":"2025-02-19T22:24:25.000Z","dependencies_parsed_at":"2022-09-17T04:11:29.305Z","dependency_job_id":null,"html_url":"https://github.com/xy2z/CliClass","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/xy2z/CliClass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xy2z%2FCliClass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xy2z%2FCliClass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xy2z%2FCliClass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xy2z%2FCliClass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xy2z","download_url":"https://codeload.github.com/xy2z/CliClass/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xy2z%2FCliClass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29273139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","cli-framework","php"],"created_at":"2024-10-06T01:07:59.828Z","updated_at":"2026-02-09T17:01:18.060Z","avatar_url":"https://github.com/xy2z.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CliClass\n\n(previously known as SlimConsole)\n\nCreate a simple CLI tool from a PHP class.\n\n- All public methods will be available to run from cli.\n- PHPdocs will be displayed as the description.\n- Method arguments are automatically validated.\n- Supports multiple classes.\n\n\n## Requires\n- PHP 7.0 or above\n\n\n## Install\n`composer require xy2z/cliclass`\n\n\n## Usage\n```php\nrequire '/path/to/vendor/autoload.php';\n\nuse xy2z\\CliClass\\CliClass;\n\nclass Router {\n\t/**\n\t * Says hello world.\n\t */\n\tpublic function hello_world() {\n\t\techo 'Hello world.';\n\t}\n\n\t/**\n\t * Says hello to $name.\n\t */\n\tpublic function hello(string $name) {\n\t\techo 'Hello ' . $name;\n\t}\n}\n\nCliClass::init($argv, [\n\tRouter::class,\n]);\n\n```\n\n\n### Result\n```bash\n$ php cli.php\nUsage:\n command [arguments]\n\nAvailable commands:\n hello_world  Says hello world.\n hello        \u003cstring $name\u003e Says hello to $name.\n```\n\n```bash\n$ php cli.php hello_world\nHello world.\n```\n\n```bash\n$ php cli.php hello\nUsage: hello \u003cstring $name\u003e\nError: Missing argument 2 for $name (no default value)\n```\n\n```bash\n$ php cli.php hello Peter\nHello Peter\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxy2z%2Fcliclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxy2z%2Fcliclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxy2z%2Fcliclass/lists"}