{"id":37002223,"url":"https://github.com/nixphp/cli","last_synced_at":"2026-01-14T00:28:07.099Z","repository":{"id":295846200,"uuid":"991435111","full_name":"nixphp/cli","owner":"nixphp","description":"NixPHP CLI Plugin for console aimed applications","archived":false,"fork":false,"pushed_at":"2025-11-27T21:10:31.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-30T12:00:45.150Z","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/nixphp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-27T16:08:04.000Z","updated_at":"2025-07-27T22:04:14.000Z","dependencies_parsed_at":"2025-07-27T12:13:41.750Z","dependency_job_id":"749c19a4-9460-49dc-9796-ca8490e54946","html_url":"https://github.com/nixphp/cli","commit_stats":null,"previous_names":["nixphp/cli"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nixphp/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixphp%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixphp%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixphp%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixphp%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nixphp","download_url":"https://codeload.github.com/nixphp/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixphp%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2026-01-14T00:28:06.431Z","updated_at":"2026-01-14T00:28:07.085Z","avatar_url":"https://github.com/nixphp.png","language":"PHP","readme":"\u003cdiv style=\"text-align: center;\" align=\"center\"\u003e\n\n![Logo](https://nixphp.github.io/docs/assets/nixphp-logo-small-square.png)\n\n[![NixPHP CLI Plugin](https://github.com/nixphp/cli/actions/workflows/php.yml/badge.svg)](https://github.com/nixphp/cli/actions/workflows/php.yml)\n\n\u003c/div\u003e\n\n[← Back to NixPHP](https://github.com/nixphp/framework)\n\n---\n\n# nixphp/cli\n\n\u003e **A minimal, developer-friendly command-line interface for your NixPHP application.**\n\nThis plugin gives you a clean CLI system with colored output, argument parsing, and auto-discovered commands. All without external dependencies.\n\n\u003e 🧩 Part of the official NixPHP plugin collection. Install it if you want powerful CLI tools for development, deployment, and automation.\n\n---\n\n## 📦 Features\n\n- ✅ Adds `vendor/bin/nix` as your app’s command-line entry point\n- ✅ Auto-discovers commands in `app/Commands/`\n- ✅ Supports arguments, options, and interactive input\n- ✅ Prints colored output for better UX\n- ✅ Fully extensible – build your own tools and workflows\n\n---\n\n## 📥 Installation\n\n```bash\ncomposer require nixphp/cli\n```\n\nThis will create `vendor/bin/nix`, your CLI gateway.\n\n---\n\n## 🚀 Usage\n\n### 🔍 Run a command\n\n```bash\nvendor/bin/nix your:command\n```\n\nCommands are discovered automatically if placed in your app’s `app/Commands/` directory.\n\n```bash\nvendor/bin/nix\n```\n\nIf you call the helper without arguments, it prints all available CLI commands.\n\n---\n\n### 🛠️ Create a custom command\n\nTo create your own CLI command, add a class in the `app/Commands/` folder:\n\n```php\nnamespace App\\Commands;\n\nuse NixPHP\\CLI\\Core\\AbstractCommand;\nuse NixPHP\\CLI\\Core\\Input;\nuse NixPHP\\CLI\\Core\\Output;\n\nclass HelloCommand extends AbstractCommand\n{\n    public const NAME = 'hello:say';\n\n    protected function configure(): void\n    {\n        $this-\u003esetTitle('Say Hello');\n        $this-\u003eaddArgument('name');\n    }\n\n    public function run(Input $input, Output $output): int\n    {\n        $name = $input-\u003egetArgument('name');\n        $output-\u003ewriteLine(\"Hello, {$name}!\", 'ok');\n        return static::SUCCESS;\n    }\n}\n```\n\nNo registration needed — as long as the class resides in `app/Commands/`, it will be picked up automatically.\n\nThen run:\n\n```bash\nvendor/bin/nix hello:say John\n```\n\n---\n\n## 🎨 Colored output\n\nUse `$output-\u003ewriteLine()` to print messages with color support:\n\n| Type         | Appearance              |\n| ------------ | ----------------------- |\n| `'ok'`       | ✅ Green                 |\n| `'error'`    | ❌ Red                   |\n| `'warning'`  | ⚠️ Yellow               |\n| `'title'`    | 💡 Light green on black |\n| `'headline'` | 📢 Light blue on black  |\n\nYou can also draw horizontal lines:\n\n```php\n$output-\u003edrawStroke(30);\n```\n\n---\n\n## 🧪 Interactive input\n\nYou can prompt the user:\n\n```php\n$name = $input-\u003eask('What is your name?');\n```\n\n---\n\n## 📁 File structure\n\nA typical CLI setup might look like this:\n\n```text\napp/\n└── Commands/\n    └── HelloCommand.php\n\nvendor/\n└── bin/\n    └── nix\n\nbootstrap.php\n```\n\n---\n\n## ✅ Requirements\n\n* `nixphp/framework` \u003e= 0.1.0\n* PHP \u003e= 8.3\n\n---\n\n## 📄 License\n\nMIT License.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixphp%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixphp%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixphp%2Fcli/lists"}