{"id":19458895,"url":"https://github.com/leafsphp/cli","last_synced_at":"2025-04-25T06:30:39.027Z","repository":{"id":42015035,"uuid":"277725746","full_name":"leafsphp/cli","owner":"leafsphp","description":"🎮 A simple command line tool for installing and interacting with your leaf apps","archived":false,"fork":false,"pushed_at":"2025-04-12T12:54:13.000Z","size":768,"stargazers_count":13,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"v4.x","last_synced_at":"2025-04-18T05:49:38.625Z","etag":null,"topics":["cli","leafphp","php"],"latest_commit_sha":null,"homepage":"https://cli.leafphp.dev/","language":"TypeScript","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/leafsphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"open_collective":"leaf","github":"leafsphp"}},"created_at":"2020-07-07T05:31:57.000Z","updated_at":"2025-04-12T12:53:05.000Z","dependencies_parsed_at":"2023-02-01T04:17:36.642Z","dependency_job_id":"92e52243-d39a-40a6-b9ae-31a78ce37f79","html_url":"https://github.com/leafsphp/cli","commit_stats":{"total_commits":220,"total_committers":3,"mean_commits":73.33333333333333,"dds":"0.013636363636363669","last_synced_commit":"cda438a4beba4ca2beccb6d6a5969ba1b9e100f5"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leafsphp%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leafsphp","download_url":"https://codeload.github.com/leafsphp/cli/tar.gz/refs/heads/v4.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250766990,"owners_count":21483902,"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","leafphp","php"],"created_at":"2024-11-10T17:28:53.460Z","updated_at":"2025-04-25T06:30:38.019Z","avatar_url":"https://github.com/leafsphp.png","language":"TypeScript","readme":"\u003c!-- markdownlint-disable no-inline-html --\u003e\n\u003cp align=\"center\"\u003e\n  \u003cbr\u003e\u003cbr\u003e\n  \u003cimg src=\"https://leafphp.dev/logo-circle.png\" height=\"100\"/\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eLeaf CLI 2\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://packagist.org/packages/leafs/cli\"\n\t\t\u003e\u003cimg\n\t\t\tsrc=\"https://poser.pugx.org/leafs/cli/v/stable\"\n\t\t\talt=\"Latest Stable Version\"\n\t/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://packagist.org/packages/leafs/cli\"\n\t\t\u003e\u003cimg\n\t\t\tsrc=\"https://poser.pugx.org/leafs/cli/downloads\"\n\t\t\talt=\"Total Downloads\"\n\t/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://packagist.org/packages/leafs/cli\"\n\t\t\u003e\u003cimg\n\t\t\tsrc=\"https://poser.pugx.org/leafs/cli/license\"\n\t\t\talt=\"License\"\n\t/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\nA simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting with your app, previewing your app, ...\n\n## Installation\n\nYou can get this tool up and running on your system using composer:\n\n```bash\ncomposer global require leafs/cli\n```\n\nMake sure to place Composer's system-wide vendor bin directory in your `$PATH` so the leaf executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:\n\n- Windows: `%USERPROFILE%\\AppData\\Roaming\\Composer\\vendor\\bin`\n- macOS: `$HOME/.composer/vendor/bin`\n- GNU / Linux Distributions: `$HOME/.config/composer/vendor/bin` or `$HOME/.composer/vendor/bin`\n\nYou could also find the composer's global installation path by running `composer global about` and looking up from the first line.\n\nEg (Adding composer bin to path linux):\n\n```sh\nexport PATH=$PATH:$HOME/.config/composer/vendor/bin\n```\n\nEg (Adding composer bin to path mac):\n\n```sh\nexport PATH=$PATH:$HOME/.composer/vendor/bin\necho $PATH\n```\n\n## Usage Guide\n\n### Creating projects\n\nTo start a new project, simply open up your console or terminal in your directory\nfor projects and enter:\n\nWith leaf 3:\n\n```sh\nleaf create \u003cproject-name\u003e\n```\n\nThis will now prompt you to select a preset\n\n```sh\nCreating a new Leaf app \"\u003cproject-name\u003e\" in ./projects-directory.\n\n* Please pick a preset \n  [0] leaf\n  [1] leaf mvc\n  [2] leaf api\n \u003e \n```\n\nSelecting a number will generate a leaf app based on the associated preset. As you can see, there are 3 presets:\n\n- **Leaf**: a bare leaf 3 project\n- **Leaf MVC**: a leaf MVC project with leaf 3\n- **Leaf API**: a leaf API project with leaf 3\n\nYou can also pick a preset directly without going through the interactive installer.\n\n**Leaf:**\n\n```bash\nleaf create \u003cproject-name\u003e --basic\n```\n\n**Leaf API:**\n\n```bash\nleaf create \u003cproject-name\u003e --api\n```\n\n**Leaf MVC:**\n\n```bash\nleaf create \u003cproject-name\u003e --mvc\n```\n\nYou can also add `--custom` for a fully customisable leaf project.\n\n```bash\nleaf create \u003cproject-name\u003e --custom\n```\n\n### Installing packages\n\nThis cli tool also adds a feature to install modules from composer\n\n```sh\nleaf install ui\n```\n\nThis installs the `leafs/ui` package.\n\nYou can also install third party packages from packagist\n\n```sh\nleaf install psr/log\n```\n\n### Interactive Shell\n\nYou can also use the interactive shell to interact with your app.\n\n```bash\n$ leaf interact\n...\n\u003e\u003e\u003e $user = new User;\n...\n\u003e\u003e\u003e $user-\u003ename = \"Mychi\";\n...\n\u003e\u003e\u003e $user-\u003esave();\n```\n\n### Previewing your app\n\nThis opens up your app on the PHP local server.\n\n```sh\nleaf serve\n```\n\nYou can also specify the port\n\n```bash\nleaf serve -p 8000\n```\n\nIn v2.1, you can also start the leaf server with hot module watching. This reloads your application anytime a change is made to your application code. To get started, simply start the leaf server with the `--watch` flag.\n\n```sh\nleaf serve --port 8000 --watch\n```\n\n## License\n\nLeaf CLI is open-sourced software licensed under the [MIT license](LICENSE.md).\n\n## 😇 Contributing\n\nWe are glad to have you. All contributions are welcome! To get started, familiarize yourself with our [contribution guide](https://leafphp.dev/community/contributing.html) and you'll be ready to make your first pull request 🚀.\n\nTo report a security vulnerability, you can reach out to [@mychidarko](https://twitter.com/mychidarko) or [@leafphp](https://twitter.com/leafphp) on twitter. We will coordinate the fix and eventually commit the solution in this project.\n\n### Code contributors\n\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd align=\"center\"\u003e\n\t\t\t\u003ca href=\"https://github.com/mychidarko\"\u003e\n\t\t\t\t\u003cimg src=\"https://avatars.githubusercontent.com/u/26604242?v=4\" width=\"120px\" alt=\"\"/\u003e\n\t\t\t\t\u003cbr /\u003e\n\t\t\t\t\u003csub\u003e\n\t\t\t\t\t\u003cb\u003eMichael Darko\u003c/b\u003e\n\t\t\t\t\u003c/sub\u003e\n\t\t\t\u003c/a\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"center\"\u003e\n\t\t\t\u003ca href=\"https://github.com/tedtop\"\u003e\n\t\t\t\t\u003cimg src=\"https://avatars.githubusercontent.com/u/5151307?v=4\" width=\"120px\" alt=\"\"/\u003e\n\t\t\t\t\u003cbr /\u003e\n\t\t\t\t\u003csub\u003e\n\t\t\t\t\t\u003cb\u003etedtop\u003c/b\u003e\n\t\t\t\t\u003c/sub\u003e\n\t\t\t\u003c/a\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\n## Sponsoring Leaf\n\nYour cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on [open collective](https://opencollective.com/leaf) or check the [contribution page](https://leafphp.dev/support/) for a list of ways to contribute.\n\nAnd to all our existing cash/code contributors, we love you all ❤️\n\n### Cash contributors\n\nYou can view all sponsors @ [https://leafphp.dev/#sponsors](https://leafphp.dev/#sponsors)\n\n## 🤯 Links/Projects\n\n- [Leaf Docs](https://leafphp.dev)\n- [Leaf MVC](https://mvc.leafphp.dev)\n- [Leaf API](https://api.leafphp.dev)\n- [Leaf CLI](https://cli.leafphp.dev)\n- [Aloe CLI](https://leafphp.dev/aloe-cli/)\n","funding_links":["https://opencollective.com/leaf","https://github.com/sponsors/leafsphp"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafsphp%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleafsphp%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleafsphp%2Fcli/lists"}