Installing swowtcli is very simple. We provide the already packaged phar on GitHub.


You need to download the packaged swoftcli.phar from the GitHub Releases of swoft-cli.

Note: You need to replace {VERSION} in the following command with the specified version. Of course, you can also download it directly through the browser.


# 检查包是否可用
php swoftcli.phar -V
php swoftcli.phar -h 

Global use

If you need to use swoftcli directly from swoftcli :

 # move to ENV path:
mv swoftcli.phar /usr/local/bin/swoftcli
chmod a+x /usr/local/bin/swoftcli

# check
swoftcli -V 


If you need to build a phar package from the latest code:

 git clone
cd swoft-cli 
composer install

// build
php -d phar.readonly=0 bin/swoftcli phar:pack -o=swoftcli.phar