CLI Tool

The StyleCI CLI Tool requires PHP 7.4 or higher, and can be installed either directly downloading the phar, orby using Composer. The tool will allow you to analyze your code using StyleCI, before you push. This tool is licensed under The Apache License 2.0.


Download the Phar

Global installation:

$ curl -SsLo styleci.phar \
    && chmod +x styleci.phar && sudo mv styleci.phar /usr/local/bin/styleci

Require using Composer

Local installation:

$ composer require styleci/cli:^1.5 --dev

Global installation:

$ composer global require styleci/cli:^1.5

First Time Setup

When using the tool for the first time, you may want to enter your StyleCI API keys. You can do this with the styleci config command, which will store your keys in ~/.styleci/config.json, just like how Composer store keys.

StyleCI for GitHub:

styleci config auth.github YOUR-API-KEY-GOES-HERE

Your API key is available at

StyleCI for GitLab:

styleci config auth.gitlab YOUR-API-KEY-GOES-HERE

Your API key is available at

StyleCI for Bitbucket:

styleci config auth.bitbucket YOUR-API-KEY-GOES-HERE

Your API key is available at


Now, you can analyze any local copy of a repo enabled in StyleCI, from the console! Simply run:

$ styleci

and StyleCI will analyze your current directory.

Environment Variables

If you have chosen not use the first time setup config, or would like to temporarily override the stored keys, this can be done by setting environment variables.

StyleCI for GitHub:


StyleCI for GitLab:


StyleCI for Bitbucket:


Advanced Usage

You can optionally pass a directory to analyze, otherwise, the current working directory will be used. Moreover, we support analyzing only the changed files, performing a "dry run" without touching your files, and more:

  analyze [options] [--] [<directory>]


  -c, --only-changed
  -d, --dry-run
  -g, --git-binary=GIT-BINARY
  -r, --remote-name=REMOTE-NAME
  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output
      --no-ansi                  Disable ANSI output
  -n, --no-interaction           Do not ask any interactive question
  -v|vv|vvv, --verbose           Increase the verbosity of messages

Note that styleci is shorthand for styleci analyze. This will matter if you want to analyze a directory with relevative path config, or any other command name. You will need to write styleci analyze config in order to use such a <directory> argument.