Skip to content

JSProffitt/joomla-console

 
 

Repository files navigation

Joomla Command Line Tools

This is a script developed by Joomlatools to ease the management of Joomla sites.

It is designed to work on Linux and MacOS. Windows users can use it in Joomlatools Vagrant box

For available options, try running:

joomla --list

Create Sites

To create a site with the latest Joomla version, run:

joomla site:create testsite

The newly installed site will be available at /var/www/testsite and testsite.dev after that. You can login into your fresh Joomla installation using these credentials: admin / admin.

By default the web server root is set to /var/www. You can pass --www=/my/server/path to commands for custom values.

You can choose the Joomla version or the sample data to be installed:

joomla site:create testsite --joomla=2.5 --sample-data=blog

You can pick any branch from the Git repository (e.g. master, staging) or any version from 2.5.0 and up using this command.

You can also add your projects into the new site by symlinking. See the Symlinking section below for detailed information.

joomla site:create testsite --symlink=project1,project2

For more information and available options, try running:

joomla site:create --help

Delete Sites

You can delete the sites you have created by running:

joomla site:delete testsite

Symlink Extensions

Let's say you are working on your own Joomla component called Awesome and want to develop it with the latest Joomla version.

By default your code is assumed to be in ~/Projects. You can pass --projects-dir=/my/code/is/here to commands for custom values.

Please note that your source code should resemble the Joomla folder structure for symlinking to work well. For example your administrator section should reside in ~/Projects/awesome/administrator/components/com_awesome.

Now to create a new site, execute the site:create command and add a symlink option:

  joomla site:create testsite --symlink=awesome

Or to symlink your code into an existing site:

joomla extension:symlink testsite awesome

This will symlink all the folders from the awesome folder into testsite.dev.

Run discover install to make your component available to Joomla and you are good to go!

For more information on the symlinker, run:

  joomla extension:symlink  --help

Install Extensions

You can use discover install on command line to install extensions.

joomla extension:install testsite com_awesome

You need to use the element name in your extension manifest.

For more information, run:

  joomla extension:install --help

Alternatively, you can install extensions using their installation packages using the extension:installfile command. Example:

joomla extension:installfile testsite /home/vagrant/com_component.v1.x.zip /home/vagrant/plg_plugin.v2.x.tar.gz

This will install both the com_component.v1.x.zip and plg_plugin.v2.x.tar.gz packages.

Extra commands

There a few other commands available for you to try out as well :

  • joomla site:token sitename user : generates an authentication token for the given user to automatically login to sitename using the ?auth_token query argument. Note requires the Koowa framework to be installed in your site.
  • joomla versions : list the available Joomla versions.
  • Use joomla versions --refresh to get the latest tags and branches from the official Joomla CMS repository.
  • To purge the cache of all Joomla packages, add the --clear-cache flag to this command.

Installation instructions

  1. Download or clone this repository.

  2. Make the joomla command executable:

    $ chmod u+x /path/to/joomla-console/bin/joomla

  3. Configure your system to recognize where the executable resides. There are 3 options:

    1. Create a symbolic link in a directory that is already in your PATH, e.g.:

      $ ln -s /path/to/joomla-console/bin/joomla /usr/bin/joomla

    2. Explicitly add the executable to the PATH variable which is defined in the the shell configuration file called .profile, .bash_profile, .bash_aliases, or .bashrc that is located in your home folder, i.e.:

      export PATH="$PATH:/path/to/joomla-console/bin:/usr/local/bin"

    3. Add an alias for the executable by adding this to you shell configuration file (see list in previous option):

      $ alias joomla=/path/to/joomla-console/bin/joomla

    For options 2 and 3 above, you should log out and then back in to apply your changes to your current session.

  4. Test that joomla executable is found by your system:

    $ which joomla

  5. From joomla-console root (/path/to/joomla-console), run Composer to fetch dependencies.

    $ composer install

About

Joomla command line tools

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%