strapi/docs/.vuepress/dist/assets/js/35.76c29241.js
2018-10-05 17:24:17 +02:00

1 line
26 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{204:function(e,t,a){"use strict";a.r(t);var s=a(0),r=Object(s.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[e._m(0),e._v(" "),a("p",[e._v("Strapi comes with a full featured Command Line Interface (CLI) which lets you scaffold and manage your project in seconds.")]),e._v(" "),a("hr"),e._v(" "),e._m(1),e._v(" "),a("p",[e._v("Create a new project")]),e._v(" "),e._m(2),a("ul",[e._m(3),e._v(" "),e._m(4),e._v(" "),a("li",[e._m(5),e._v(" "),a("p",[e._v("See the "),a("a",{attrs:{href:"https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("CONTRIBUTING guide"),a("OutboundLink")],1),e._v(" for more details.")])])]),e._v(" "),a("hr"),e._v(" "),e._m(6),e._v(" "),a("p",[e._v("Scaffold a complete API with its configurations, controller, model and service.")]),e._v(" "),e._m(7),e._m(8),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),a("p",[e._v("Create a new controller")]),e._v(" "),e._m(11),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),a("p",[e._v("Create a new model")]),e._v(" "),e._m(15),e._m(16),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),a("p",[e._v("Create a new service")]),e._v(" "),e._m(19),e._m(20),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),a("p",[e._v("Create a new policy")]),e._v(" "),e._m(23),e._m(24),e._v(" "),e._m(25),e._v(" "),a("p",[e._v("Create a new plugin skeleton.")]),e._v(" "),e._m(26),e._m(27),e._v(" "),a("p",[e._v("Please refer to the "),a("router-link",{attrs:{to:"./../plugin-development/quick-start.html"}},[e._v("plugin develoment documentation")]),e._v(" to know more.")],1),e._v(" "),a("hr"),e._v(" "),e._m(28),e._v(" "),a("p",[e._v("Install a plugin in the project.")]),e._v(" "),e._m(29),e._m(30),e._v(" "),a("blockquote",[a("p",[e._v("Checkout the "),a("a",{attrs:{href:"https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("CONTRIBUTING guide"),a("OutboundLink")],1),e._v(" for more details about the local Strapi development workflow.")])]),e._v(" "),e._m(31),e._v(" "),a("p",[e._v("Please refer to the "),a("router-link",{attrs:{to:"./../plugin-development/quick-start.html"}},[e._v("plugins documentation")]),e._v(" to know more.")],1),e._v(" "),a("hr"),e._v(" "),e._m(32),e._v(" "),a("p",[e._v("Uninstall a plugin from the project.")]),e._v(" "),e._m(33),e._m(34),e._v(" "),a("p",[e._v("Please refer to the "),a("router-link",{attrs:{to:"./../plugin-development/quick-start.html"}},[e._v("plugins documentation")]),e._v(" to know more.")],1),e._v(" "),a("hr"),e._v(" "),e._m(35),e._v(" "),a("p",[e._v("Print the current globally installed Strapi version.")]),e._v(" "),e._m(36),a("hr"),e._v(" "),e._m(37),e._v(" "),a("p",[e._v("List CLI commands.")]),e._v(" "),e._m(38)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"command-line-interface-cli"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#command-line-interface-cli","aria-hidden":"true"}},[this._v("#")]),this._v(" Command Line Interface (CLI)")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-new"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-new","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi new")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi new "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--dev"),a("span",{attrs:{class:"token operator"}},[e._v("|")]),e._v("--dbclient"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbclient"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbhost"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbhost"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbport"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbport"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbname"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbname"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbusername"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbusername"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbpassword"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbpassword"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbssl"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbssl"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" --dbauth"),a("span",{attrs:{class:"token operator"}},[e._v("=")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("dbauth"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("li",[t("p",[t("strong",[this._v("strapi new <name>")]),t("br"),this._v("\nGenerates a new project called "),t("strong",[this._v("<name>")]),this._v(" and installs the default plugins through the npm registry.")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("li",[a("p",[a("strong",[e._v("strapi new <name> --dev")]),a("br"),e._v("\nGenerates a new project called "),a("strong",[e._v("<name>")]),e._v(" and creates symlinks for the "),a("code",[e._v("./admin")]),e._v(" folder and each plugin inside the "),a("code",[e._v("./plugin")]),e._v(" folder. It means that the Strapi's development workflow has been set up on the machine earlier.")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("p",[a("strong",[e._v("strapi new <name> --dbclient=<dbclient> --dbhost=<dbhost> --dbport=<dbport> --dbname=<dbname> --dbusername=<dbusername> --dbpassword=<dbpassword> --dbssl=<dbssl> --dbauth=<dbauth>")]),a("br"),e._v("\nGenerates a new project called "),a("strong",[e._v("<name>")]),e._v(" and skip the interactive database configuration and initilize with these options. "),a("strong",[e._v("<dbclient>")]),e._v(" can be "),a("code",[e._v("mongo")]),e._v(", "),a("code",[e._v("postgres")]),e._v(", "),a("code",[e._v("mysql")]),e._v(", "),a("code",[e._v("sqlite3")]),e._v(" or "),a("code",[e._v("redis")]),e._v(". "),a("strong",[e._v("<dbssl>")]),e._v(" and "),a("strong",[e._v("<dbauth>")]),e._v(" are optional.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-generate-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-generate-api","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi generate:api")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi generate:api "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("attribute:type"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--tpl "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token operator"}},[e._v("|")]),e._v("--plugin "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi generate:api <name>")]),a("br"),e._v("\nGenerates an API called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api")]),e._v(" folder at the root of your project.")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:api <name> <attribute:type>")]),a("br"),e._v("\nGenerates an API called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api")]),e._v(" folder at the root of your project. The model will already contain an attribute called "),a("strong",[e._v("<attribute>")]),e._v(" with the type property set to "),a("strong",[e._v("<type>")]),e._v(".")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:api product name:string description:text price:integer")])])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:api <name> --plugin <plugin>")]),a("br"),e._v("\nGenerates an API called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins/<plugin>")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:api product --plugin content-manager")])])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:api <name> --tpl <template>")]),a("br"),e._v("\nGenerates an API called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api")]),e._v(" folder which works with the given "),a("strong",[e._v("<template>")]),e._v(". By default, the generated APIs are based on Mongoose.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:api product --tpl bookshelf")])])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"note custom-block"},[t("p",[this._v("The first letter of the filename will be uppercased.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-generate-controller"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-generate-controller","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi generate:controller")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi generate:controller "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--api "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token operator"}},[e._v("|")]),e._v("--plugin "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi generate:controller <name>")]),a("br"),e._v("\nGenerates an empty controller called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<name>/controllers")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:controller category")]),e._v(" will create the controller at "),a("code",[e._v("./api/category/controllers/Category.js")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:controller <name> --api <api>")]),a("br"),e._v("\nGenerates an empty controller called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<api>/controllers")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:controller category --api product")]),e._v(" will create the controller at "),a("code",[e._v("./api/product/controllers/Category.js")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:controller <name> --plugin <plugin>")]),a("br"),e._v("\nGenerates an empty controller called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins/<plugin>/controllers")]),e._v(" folder.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"note custom-block"},[t("p",[this._v("The first letter of the filename will be uppercased.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-generate-model"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-generate-model","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi generate:model")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi generate:model "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v(" "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("attribute:type"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--api "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token operator"}},[e._v("|")]),e._v("--plugin "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi generate:model <name>")]),a("br"),e._v("\nGenerates an empty model called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<name>/models")]),e._v(" folder. It will create two files.\nThe first one will be "),a("strong",[e._v("<name>.js")]),e._v(" which contains your lifecycle callbacks and another "),a("strong",[e._v("<name>.settings.json")]),e._v(" that will list your attributes and options.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:model category")]),e._v(" will create these two files "),a("code",[e._v("./api/category/models/Category.js")]),e._v(" and "),a("code",[e._v("./api/category/models/Category.settings.json")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:model <name> <attribute:type>")]),a("br"),e._v("\nGenerates an empty model called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<name>/models")]),e._v(" folder. The file "),a("strong",[e._v("<name>.settings.json")]),e._v(" will already contain a list of attribute with their associated "),a("strong",[e._v("<type>")]),e._v(".")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:model category name:string description:text")]),e._v(" will create these two files "),a("code",[e._v("./api/category/models/Category.js")]),e._v(" and "),a("code",[e._v("./api/category/models/Category.settings.json")]),e._v(". This last file will contain two attributes "),a("code",[e._v("name")]),e._v(" with the type "),a("code",[e._v("string")]),e._v(" and "),a("code",[e._v("description")]),e._v(" with type "),a("code",[e._v("text")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:model <name> --api <api>")]),a("br"),e._v("\nGenerates an empty model called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<api>/models")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:model category --api product")]),e._v(" will create these two files:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("./api/product/models/Category.js")])]),e._v(" "),a("li",[a("code",[e._v("./api/product/models/Category.settings.json")]),e._v(".")])])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:model <name> --plugin <plugin>")]),a("br"),e._v("\nGenerates an empty model called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins/<plugin>/models")]),e._v(" folder.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"note custom-block"},[t("p",[this._v("The first letter of the filename will be uppercased.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-generate-service"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-generate-service","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi generate:service")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi generate:service "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--api "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token operator"}},[e._v("|")]),e._v("--plugin "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi generate:service <name>")]),a("br"),e._v("\nGenerates an empty service called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<name>/services")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:service category")]),e._v(" will create the service at "),a("code",[e._v("./api/category/services/Category.js")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:service <name> --api <api>")]),a("br"),e._v("\nGenerates an empty service called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<api>/services")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:service category --api product")]),e._v(" will create the service at "),a("code",[e._v("./api/product/services/Category.js")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:service <name> --plugin <plugin>")]),a("br"),e._v("\nGenerates an empty service called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins/<plugin>/services")]),e._v(" folder.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"note custom-block"},[t("p",[this._v("The first letter of the filename will be uppercased.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-generate-policy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-generate-policy","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi generate:policy")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi generate:policy "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--api "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token operator"}},[e._v("|")]),e._v("--plugin "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi generate:policy <name>")]),a("br"),e._v("\nGenerates an empty policy called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./config/policies")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:policy isAuthenticated")]),e._v(" will create the policy at "),a("code",[e._v("./config/policies/isAuthenticated.js")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:policy <name> --api <api>")]),a("br"),e._v("\nGenerates an empty policy called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./api/<api>/config/policies")]),e._v(" folder. This policy will be scoped and only accessible by the "),a("strong",[e._v("<api>")]),e._v(" routes.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:policy isAuthenticated --api product")]),e._v(" will create the policy at "),a("code",[e._v("./api/product/config/policies/isAuthenticated.js")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi generate:policy <name> --plugin <plugin>")]),a("br"),e._v("\nGenerates an empty policy called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins/<plugin>/config/policies")]),e._v(" folder. This policy will be scoped and accessible only by the "),a("strong",[e._v("<plugin>")]),e._v(" routes.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-generate-plugin"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-generate-plugin","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi generate:plugin")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[this._v("strapi generate:plugin "),t("span",{attrs:{class:"token operator"}},[this._v("<")]),this._v("name"),t("span",{attrs:{class:"token operator"}},[this._v(">")]),this._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi generate:plugin <name>")]),a("br"),e._v("\nGenerates an empty plugin called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi generate:plugin user")]),e._v(" will create the plugin at "),a("code",[e._v("./plugins/user")]),e._v(".")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-install"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-install","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi install")])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[e._v("strapi "),a("span",{attrs:{class:"token function"}},[e._v("install")]),e._v(" "),a("span",{attrs:{class:"token operator"}},[e._v("<")]),e._v("name"),a("span",{attrs:{class:"token operator"}},[e._v(">")]),e._v("\n\noptions: "),a("span",{attrs:{class:"token punctuation"}},[e._v("[")]),e._v("--dev"),a("span",{attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi install <name>")]),a("br"),e._v("\nInstalls a plugin called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi install content-type-builder")]),e._v(" will install the plugin at "),a("code",[e._v("./plugins/content-type-builder")]),e._v(".")])]),e._v(" "),a("li",[a("p",[a("strong",[e._v("strapi install <name> --dev")]),a("br"),e._v("\nIt will create a symlink from the local Strapi repository plugin folder called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi install content-type-builder --dev")]),e._v(" will create a symlink from "),a("code",[e._v("/path/to/the/repository/packages/strapi-plugin-content-type-builder")]),e._v(" to "),a("code",[e._v("./plugins/content-type-builder")]),e._v(".")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"warning custom-block"},[t("p",{staticClass:"custom-block-title"},[this._v("WARNING")]),this._v(" "),t("p",[this._v("You have to restart the server to load the plugin into your project.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-uninstall"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-uninstall","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi uninstall")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[this._v("strapi uninstall "),t("span",{attrs:{class:"token operator"}},[this._v("<")]),this._v("name"),t("span",{attrs:{class:"token operator"}},[this._v(">")]),this._v("\n")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ul",[a("li",[a("p",[a("strong",[e._v("strapi uninstall <name>")]),a("br"),e._v("\nUninstalls a plugin called "),a("strong",[e._v("<name>")]),e._v(" in the "),a("code",[e._v("./plugins")]),e._v(" folder.")]),e._v(" "),a("p",[e._v("Example: "),a("code",[e._v("strapi uninstall content-type-builder")]),e._v(" will remove the folder at "),a("code",[e._v("./plugins/content-type-builder")]),e._v(".")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-version"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-version","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi version")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[this._v("strapi version\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"strapi-help"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#strapi-help","aria-hidden":"true"}},[this._v("#")]),this._v(" strapi help")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("strapi help\n")])])])}],!1,null,null,null);r.options.__file="CLI.md";t.default=r.exports}}]);