An interactive shell for CakePHP featuring class name completion for easier development and debugging
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Interactive shell for CakePHP

This plugin provides a an easy way to run an interactive shell for CakePHP, allowing you to instantiate any class such as models and watch the produced output in your console. Ths makes a great tool for development and quick debugging any function.


  • phpsh command line ( (Optional but highly recommended)
  • PHP command line tool (cli) compiled with interactive support and readline
  • CakePHP 2.x


For an optimal experience you need to install Facebook's phpsh otherwise this plugin can only be used by native php's command line, which does not suppport autocompletion or fatal error recovery. Follow steps on README for the aforementioned project and then continue with the following steps for using this plugin


[GIT Submodule]

In your app directory type:

git submodule add git:// Plugin/Interactive
git submodule init
git submodule update

[GIT Clone]

In your plugin directory type

git clone git:// Plugin/Interactive

Enable plugin

In 2.0 you need to enable the plugin your app/Config/bootstrap.php file:


If you are already using CakePlugin::loadAll();, then this is not necessary.

Intall command line tools in your app's Console folder

Now you need to execute the install shell to copy necessary files into your Console folder

# Console/cake Interactive.Install


Once you have intalled required files using the Install shell, you just need to execute the CakePHP interactive shell

# Console/cpi

If you correctly installed phpsh then you will be able to use autocompletion and get automatically documentation for all php functions and your application classes as well. To use it just write php sentences followed by a semicolon. If the stememnt echoes by default you should see the output immediately, otherwise you can use functions such as debug, pr, var_dump etc. to inspect the contents of a function return value or variable.

Autocompletion is triggered by writing par of the name for a class and then hitting tab a couple times