{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/7783","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7783/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7783/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7783/events","html_url":"https://github.com/joomla/joomla-cms/pull/7783","id":103870605,"number":7783,"title":"CLI runner for the CMS","user":{"login":"mbabker","id":368545,"avatar_url":"https://avatars.githubusercontent.com/u/368545?v=3","gravatar_id":"","url":"https://api.github.com/users/mbabker","html_url":"https://github.com/mbabker","followers_url":"https://api.github.com/users/mbabker/followers","following_url":"https://api.github.com/users/mbabker/following{/other_user}","gists_url":"https://api.github.com/users/mbabker/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabker/subscriptions","organizations_url":"https://api.github.com/users/mbabker/orgs","repos_url":"https://api.github.com/users/mbabker/repos","events_url":"https://api.github.com/users/mbabker/events{/privacy}","received_events_url":"https://api.github.com/users/mbabker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/New%20Feature","name":"New Feature","color":"e102d8"},{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-3.5-dev","name":"PR-3.5-dev","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-29T19:08:12Z","updated_at":"2015-08-30T14:48:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7783","html_url":"https://github.com/joomla/joomla-cms/pull/7783","diff_url":"https://github.com/joomla/joomla-cms/pull/7783.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/7783.patch"},"body":"This PR introduces a new CLI class for the CMS which functions as a CLI command runner.  This deprecates the present methodology of new CLI commands being implemented always as `JApplicationCli` objects.\r\n\r\n### Summary\r\n\r\nA `JoomlaCmsCli` class is added at `cli/cms.php` and is the command line entry point to the command runner system.  The first argument given to this script represents the CLI command to be executed.\r\n\r\nCLI commands are namespaced with a `:` separator with the component's name being required to be the first part of this (for example, `finder:index` triggers a command in `com_finder`).  A command with no separator is assumed to be a \"core\" command and is processed as such.\r\n\r\nCore commands live in the `cli/commands` folder and have a class name prefix of `CliCommand`.  The command name finishes the class name as well as defines the file name.  So the `updatecheck` command uses a class name of `CliCommandUpdatecheck` and the file path is `cli/commands/updatecheck.php`.\r\n\r\nComponent commands must have at least one `:` separator, however additional separators are supported and processed.  Component commands must live in the component's administrator folder in a `commands` subfolder.  The class name uses the component as the first part (similar to the MVC layer) followed by `Command` and the command name part(s).  The `:` separator acts as a directory separator for the filesystem and each part uses an uppercase character for the first character when the class name is created.  So, the `finder:index` command would use the `FinderCommandIndex` class name and the file path is `administrator/components/com_finder/commands/index.php`.  If a `content:category:delete` command existed, the class name would be `ContentCommandCategoryDelete` and its file path would be `administrator/components/com_content/commands/category/delete.php`.\r\n\r\n### Command Requirements\r\n\r\nCommands follow the single task methodology already in place by their structure.  The new command classes extend `JControllerBase` from the \"new\" MVC and are triggered from the CLI runner via the interface's `execute` method.\r\n\r\n### Extension Use\r\n\r\nThird party extensions may immediately use this feature by adding CLI commands to their admin component folder in a `commands` folder.  The only manifest change necessary is to ensure the folder is installed.  This is different from the existing \"practice\" of using an install script to place CLI files in the CLI folder.\r\n\r\n### Existing CLI scripts\r\n\r\nThese scripts should be considered deprecated and removed at 4.0."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/136151478","html_url":"https://github.com/joomla/joomla-cms/pull/7783#issuecomment-136151478","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7783","id":136151478,"user":{"login":"elkuku","id":33978,"avatar_url":"https://avatars.githubusercontent.com/u/33978?v=3","gravatar_id":"","url":"https://api.github.com/users/elkuku","html_url":"https://github.com/elkuku","followers_url":"https://api.github.com/users/elkuku/followers","following_url":"https://api.github.com/users/elkuku/following{/other_user}","gists_url":"https://api.github.com/users/elkuku/gists{/gist_id}","starred_url":"https://api.github.com/users/elkuku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elkuku/subscriptions","organizations_url":"https://api.github.com/users/elkuku/orgs","repos_url":"https://api.github.com/users/elkuku/repos","events_url":"https://api.github.com/users/elkuku/events{/privacy}","received_events_url":"https://api.github.com/users/elkuku/received_events","type":"User","site_admin":false},"created_at":"2015-08-30T14:48:33Z","updated_at":"2015-08-30T14:48:33Z","body":"> just curious, it is complicated to implement the suggestion on push Tab key?\r\n\r\nI'd guess that depends highly on the operating system/shell/IDE you use, but it shouldn't be *too* complicated to set something up.\r\nE.g. we have something in this direction set up for the JTracker here: https://github.com/joomla/jissues/blob/master/cli/Custom_jtracker.xml"}}