{"id":20678901,"url":"https://github.com/phpgt/cli","last_synced_at":"2025-04-02T09:13:30.909Z","repository":{"id":12362344,"uuid":"127637104","full_name":"phpgt/Cli","owner":"phpgt","description":"Command line interface builder.","archived":false,"fork":false,"pushed_at":"2024-07-15T10:52:43.000Z","size":301,"stargazers_count":0,"open_issues_count":17,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T14:05:03.832Z","etag":null,"topics":["cli","cli-api","cli-app","cli-application","cli-framework","command-line-interface-builder","phpgt","terminal","terminal-colors"],"latest_commit_sha":null,"homepage":"https://www.php.gt/cli","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/phpgt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["phpgt"]}},"created_at":"2018-04-01T14:33:54.000Z","updated_at":"2024-05-08T17:45:50.000Z","dependencies_parsed_at":"2024-11-16T21:25:37.201Z","dependency_job_id":"e210d50a-616a-49d2-890e-b5edd6380663","html_url":"https://github.com/phpgt/Cli","commit_stats":{"total_commits":167,"total_committers":5,"mean_commits":33.4,"dds":"0.23353293413173648","last_synced_commit":"f451b58bdb233a76671e2391afa231387470eb1b"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpgt%2FCli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpgt","download_url":"https://codeload.github.com/phpgt/Cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785453,"owners_count":20833494,"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":["cli","cli-api","cli-app","cli-application","cli-framework","command-line-interface-builder","phpgt","terminal","terminal-colors"],"created_at":"2024-11-16T21:22:59.714Z","updated_at":"2025-04-02T09:13:30.865Z","avatar_url":"https://github.com/phpgt.png","language":"PHP","readme":"Command line interface builder.\n===============================\n\nCreate multi-command terminal application with parameter requirements that are self-documenting and easy to unit test.\n\n***\n\n\u003ca href=\"https://github.com/PhpGt/Cli/actions\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cli-build.svg\" alt=\"Build status\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codacy.com/gh/PhpGt/Cli\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cli-quality.svg\" alt=\"Code quality\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/PhpGt/Cli\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cli-coverage.svg\" alt=\"Code coverage\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/PhpGt/Cli\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cli-version.svg\" alt=\"Current version\" /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.php.gt/cli\" target=\"_blank\"\u003e\n\t\u003cimg src=\"https://badge.status.php.gt/cli-docs.svg\" alt=\"PHP.G/Cli documentation\" /\u003e\n\u003c/a\u003e\n\n## Example usage: Twitter client\n\nCLI interaction:\n\n```bash\n$ twitter tweet --message \"Sending a test Tweet from the terminal.\"\nSent! View online: https://twitter.com/g105b/status/1038509073346510849\n$ twitter dm --to @g105b --message \"Hello, Greg!\"\nSent!\n$ twitter help\nTwitter example application\n\nAvailable commands:\n• tweet\t\tSend a Tweet to your timeline.\n• view\t\tView your timeline\n• follow\tFollow an account\n• dm\t\tSend a direct message.\n• login\t\tAuthenticate your username.\n• help\t\tShow this help screen.\n```\n\n`twitter.php:`\n\n```php\n$app = new Application(\n\t\"Twitter example application\",\n\tnew CliArgumentList(...$argv),\n\tnew TweetCommand(),\n\tnew ViewCommand(),\n\tnew FollowCommand(),\n\tnew DmCommand(),\n\tnew LoginCommand()\n);\n$app-\u003erun();\n```\n\n`Command/tweet.php`\n\n```php\nclass TweetCommand extends Command {\n\tpublic function __construct() {\n\t\t$this-\u003esetName(\"tweet\");\n\t\t$this-\u003esetDescription(\"Send a Tweet to your timeline.\");\n\n\t\t$this-\u003esetRequiredParameter(true, \"message\", \"m\");\n\t\t$this-\u003esetOptionalParameter(true, \"location\", \"l\");\n\t}\n\n\tpublic function run(ArgumentValueList $arguments):void {\n\t\tif(!TwitterApi::isLoggedIn()) {\n\t\t\t$this-\u003ewriteLine(\"You must login first.\", Stream::ERROR);\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$uri = TwitterApi::sendTweet($arguments-\u003eget(\"message\"));\n\t\t\t$this-\u003ewriteLine(\"Sent! View online: $uri\");\n\t\t}\n\t\tcatch(TwitterApiException $exception) {\n\t\t\t$this-\u003ewriteLine(\n\t\t\t\t\"Error sending Tweet: \"\n\t\t\t\t. $exception-\u003egetMessage(),\n\t\t\t\tStream::ERROR\n\t\t\t);\n\t\t}\n\t}\n}\n```\n","funding_links":["https://github.com/sponsors/phpgt"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpgt%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpgt%2Fcli/lists"}