Git Product home page Git Product logo

eecli's Introduction

eecli

eecli is a command line interface for ExpressionEngine 2. It can be used to:

  • aid in development, like creating new channels or generating a custom addon.
  • run post-deployment tasks on your staging/production server(s), like clearing cache.
  • automate critical tasks, like database backup
  • build your own custom CLI commands, like import scripts or cron jobs
  • debug using an interactive shell

Screencast of a few example commands

Installation

The preferred installation method is to install globally with Composer. Refer the official composer documentation for more information on installing Composer globally. Run this at the command line:

$ composer global require eecli/eecli

Make sure your global Composer installation's bin folder is added to your PATH in your ~/.bash_profile (or ~/.profile or ~/.bashrc or ~/.zshrc) so that you may run the binary eecli from the command line:

export PATH=~/.composer/vendor/bin:$PATH

For more installation methods, please see the full Installation guide in the Wiki.

Usage

$ eecli <command> [options] [argument1] [argument2]

To see a list of available commands, simply type eecli at the root of your project installation:

$ eecli

For detailed information on a specific command, use the help command:

$ eecli help <command>

To generate a new config file, use the init command:

$ eecli init

Documentation

For more details on installation, configuration and a command reference, see the Wiki.

Requirements

  • PHP 5.3+
  • ExpressionEngine 2.5 - 2.10 (Does not work with ExpressionEngine 3).

Contributing

See CONTRIBUTING for more information.

License

eecli is released under the MIT License. See the bundled LICENSE file.

eecli's People

Contributors

iainsaxon avatar khaliqgant avatar leevigraham avatar rsanchez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eecli's Issues

Inconsistent command argument naming

Example:

eecli create:channel --cat_group=x
eecli create:category <name> <category_group>

It would be easier to remember command arguments if they were consistent.

Error when creating multiple templates

I get this when creating multiple templates with

eecli create:template something/index another-thing/index

PHP Fatal error: Call to a member function addError() on a non-object in phar:///usr/local/Cellar/eecli/1.0.7/libexec/eecli.phar/src/CodeIgniter/Functions.php on line 78

Update to work with EE 3.0+

I'm not sure what all would need to be updated to make this work with the v3 release of EE. Running the tool in the base directory of a brand new EE3 project states that it cannot find the system folder.

Error with hasParameterOption compatibility

I did a global install and added eecli to my path, then ran the command and got the following error.

eecli init
PHP Fatal error: Declaration of eecli\Console\GlobalArgvInput::hasParameterOption() must be compatible with Symfony\Component\Console\Input\InputInterface::hasParameterOption($values, $onlyParams = false) in /Users/blitzing/.composer/vendor/eecli/eecli/src/Console/GlobalArgvInput.php on line 32

Fatal error: Declaration of eecli\Console\GlobalArgvInput::hasParameterOption() must be compatible with Symfony\Component\Console\Input\InputInterface::hasParameterOption($values, $onlyParams = false) in /Users/blitzing/.composer/vendor/eecli/eecli/src/Console/GlobalArgvInput.php on line 32

Comma separated command arguments in wiki?

eecli create:channel --cat_group="Apparel,Accessories" test_channel

Doesn't seem to work because the --cat_group argument is comma separated? Shouldn't this be: eecli create:channel --cat_group="Apparel" --cat_group="Accessories" test_channel?

PHP notice and warning when creating new category

Running the command eecli create:category --url_title="test" Test 1 results in the following:

PHP Notice:  Undefined variable: options in /Users/(username)/.composer/vendor/eecli/eecli/src/Command/CreateCategoryCommand.php on line 139
PHP Warning:  Invalid argument supplied for foreach() in /Users/(username)/.composer/vendor/eecli/eecli/src/Application.php on line 284
Category Test (1) created.

Getting "No arguments expected" when running `eecli cache:clear:ee`

Any ideas?

PHP Info:

PHP 7.0.12 (cli) (built: Nov  8 2016 23:44:58) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Xdebug v2.5.0rc1, Copyright (c) 2002-2016, by Derick Rethans

Running the following from my webroot:

$ ./vendor/bin/eecli cache:clear:ee 

Fatal error: Uncaught Symfony\Component\Console\Exception\RuntimeException: No arguments expected, got "cache:clear:ee". in /web/vendor/symfony/console/Input/ArgvInput.php on line 187

Symfony\Component\Console\Exception\RuntimeException: No arguments expected, got "cache:clear:ee". in /web/vendor/symfony/console/Input/ArgvInput.php on line 187

Call Stack:
    0.2038     353416   1. {main}() /web/vendor/eecli/eecli/bin/eecli:0
    0.2053     359096   2. require('/web/vendor/eecli/eecli/src/bootstrap.php') /web/vendor/eecli/eecli/bin/eecli:4
    0.2117    1175352   3. eecli\Application->__construct() /web/vendor/eecli/eecli/src/bootstrap.php:19
    0.2117    1175352   4. eecli\Application->setGlobalInput() /web/vendor/eecli/eecli/src/Application.php:121
    0.2135    1347208   5. eecli\Console\GlobalArgvInput->__construct() /web/vendor/eecli/eecli/src/Application.php:296
    0.2135    1347608   6. Symfony\Component\Console\Input\ArgvInput->__construct() /web/vendor/eecli/eecli/src/Console/GlobalArgvInput.php:43
    0.2135    1348008   7. Symfony\Component\Console\Input\Input->__construct() /web/vendor/symfony/console/Input/ArgvInput.php:63
    0.2135    1348008   8. Symfony\Component\Console\Input\Input->bind() /web/vendor/symfony/console/Input/Input.php:48
    0.2135    1348120   9. eecli\Console\GlobalArgvInput->parse() /web/vendor/symfony/console/Input/Input.php:62

Implement getters for all ID based command arguments

It would be great to have all command arguments that accept an id eg: --channel_id=1 should also accept --channel_id=blog that way we can automate a site build without worrying about the id relationships.

Example:

    eecli create:field_group Articles
    eecli create:category_group Articles
    eecli create:channel articles Articles --field_group="Articles" --cat_group="Articles"
    eecli create:field:wygwam "Content" cf_article_content Articles
    eecli create:field:assets "Feature Image" cf_article_feature_image Articles
    eecli create:field:assets "Thumbnail Image" cf_article_thumbnail_image Articles

init command can't find sample.eecli.php

I use a non-standard directory structure in my EE installs:

project_root
  -  httpdocs (Apache DocumentRoot)
  -  ee-core (Core EE files)
  -  ee-local (Config overrides, Templates, Third Party Add-ons)

When attempting to run eecli init in project_root, the system folder is found but eecli.phar can't find the sample.eecli.php file:

> eecli init
Searching for your system folder...
System folder ./ee-core found.
PHP Warning:  file_get_contents(phar:///usr/local/Cellar/eecli/1.0.4/libexec/eecli.phar/src/Command/../../sample.eecli.php): failed to open stream: phar error: "sample.eecli.php" is not a file in phar "/usr/local/Cellar/eecli/1.0.4/libexec/eecli.phar" in phar:///usr/local/Cellar/eecli/1.0.4/libexec/eecli.phar/src/Command/InitCommand.php on line 38
Could not read the sample.eecli.php file.

Warning: file_get_contents(phar:///usr/local/Cellar/eecli/1.0.4/libexec/eecli.phar/src/Command/../../sample.eecli.php): failed to open stream: phar error: "sample.eecli.php" is not a file in phar "/usr/local/Cellar/eecli/1.0.4/libexec/eecli.phar" in phar:///usr/local/Cellar/eecli/1.0.4/libexec/eecli.phar/src/Command/InitCommand.php on line 38

Running eecli init in the httpdocs folder, I receive the same error except the system folder is not detected.

For clarity, the details of my installation are:

  • OS: OS X 10.10.2
  • PHP Version: 5.6.7
  • eecli version: 1.0.4
  • Installation Method: Homebrew

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.