ProjectCLI is a command line tool that translates complex tasks into simple, single commands. It also helps keeping a standard project structure across all projects. Here are some benefits of using ProjectCLI:
- Initialize, setup and start whole environments (incl. web server, database, caching, mail server, etc.) in seconds
- Set up even complex projects with a single command
- Use (force) the same directory structure in every project
- Reduce amount of necessary commands for each developer
- The same environment, tools and versions for every developer
- Easier and colored log-tailing
- Write your own commands and plugins to extend ProjectCLI
- Simple
/etc/hostsand SSH config management
For the plugin registry, more info, the documentation and some examples, check out cli.lazu.io.
- PHP CLI 7.2 or newer (incl. extensions: zlib, json, intl, xml, curl)
$ brew install php@7.2Make sure the available version meets the requirements:
$ apt show phpIf not, add the following repository:
$ add-apt-repository -y ppa:ondrej/php && apt-get updateInstall the PHP CLI and extensions:
$ apt install php-cli php-xml php-curl php-zip php-intl php-jsonAfter you've installed all dependencies, get the latest ProjectCLI release here and move it to /usr/local/bin/project or /usr/bin/project, depending on your system. The project command will be available after you restart your terminal session.
To manually update ProjectCLI, just use the project self-update command.
It's mandatory, that the project has the according directory structure and files in order for ProjectCLI to work properly.
- commands
| Contains project specific commands, created via 'project make:command'
- conf
| Add configuration files for components (like nginx, PHP, crontab, supervisor, etc)
- scripts
| Can contain scripts for deployment, HTTP requests or other complex tasks
- src
| Contains the application src
- temp
| Directory for temporary files, such as docker-compose service mounts
project create NAME [--type=php|node|python] [--repository=URL_TO_YOUR_REPOSITORY]To create an automated setup for an existing project, you need to add a setup command via
project make:command SetupCommand. In the handle() method, you specify the commands to set up
the project (eg. copy env files, run migrations, seed test data, compile static files, etc).
project clone REPOSITORY_URL [DIRECTORY]The clone command will clone the repository and ask, if the project should be set up via the
existing setup command.
project [up|down|restart]ProjectCLI will run all commands inside the according Docker service.
# for the web service
project [artisan|composer|...]
# for node / npm / npx
project [node|npm|npx install|run|...]project help statusFind all your log files and see what's happening with your application. It'll also warn you, if your files get too big.
project help logs:tailEnable and disable Xdebug with a single command.
project help php:xdebugList, enable, disable, add, remove and check hosts for existence
project help hostsWhenever you change the hosts file (eg. enable, disable, add, rm), you have to run the command with sudo / as root.
ProjectCLI will create backups, but only keeps the last two versions.
Run Docker Compose commands with your docker-compose.yml
project help docker:composeUsing bash inside a container / service
project help shellrm -rf $HOME/.project $(which project)