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/hosts
and 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 [email protected]
Make sure the available version meets the requirements:
$ apt show php
If not, add the following repository:
$ add-apt-repository -y ppa:ondrej/php && apt-get update
Install the PHP CLI and extensions:
$ apt install php-cli php-xml php-curl php-zip php-intl php-json
After 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 status
Find 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:tail
Enable and disable Xdebug with a single command.
project help php:xdebug
List, enable, disable, add, remove and check hosts for existence
project help hosts
Whenever 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:compose
Using bash inside a container / service
project help shell
rm -rf $HOME/.project $(which project)