{"id":13876189,"url":"https://github.com/GrapesJS/cli","last_synced_at":"2025-07-16T10:33:18.941Z","repository":{"id":35368086,"uuid":"208894079","full_name":"GrapesJS/cli","owner":"GrapesJS","description":"GrapesJS CLI helper for the development","archived":false,"fork":false,"pushed_at":"2024-10-25T21:05:18.000Z","size":1848,"stargazers_count":103,"open_issues_count":13,"forks_count":29,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-14T11:02:33.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrapesJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-16T20:41:53.000Z","updated_at":"2024-11-12T07:19:27.000Z","dependencies_parsed_at":"2024-11-10T15:47:56.422Z","dependency_job_id":null,"html_url":"https://github.com/GrapesJS/cli","commit_stats":{"total_commits":157,"total_committers":6,"mean_commits":"26.166666666666668","dds":"0.14649681528662417","last_synced_commit":"73b5861fc92ba2acbf9c987cd8357c1cae0ccb39"},"previous_names":["artf/grapesjs-dev-helper","artf/grapesjs-cli"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrapesJS","download_url":"https://codeload.github.com/GrapesJS/cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225718957,"owners_count":17513381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T06:01:07.317Z","updated_at":"2024-11-24T04:31:02.797Z","avatar_url":"https://github.com/GrapesJS.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","others"],"sub_categories":[],"readme":"# GrapesJS CLI\n\n[![npm](https://img.shields.io/npm/v/grapesjs-cli.svg)](https://www.npmjs.com/package/grapesjs-cli)\n\n![grapesjs-cli](https://user-images.githubusercontent.com/11614725/67523496-0ed41300-f6af-11e9-9850-7175355f2946.jpg)\n\nA simple CLI library for helping in GrapesJS plugin development.\n\nThe goal of this package is to avoid the hassle of setting up all the dependencies and configurations for the plugin development by centralizing and speeding up the necessary steps during the process.\n\n* Fast project scaffolding\n* No need to touch Babel and Webpack configurations\n\n## Plugin from 0 to 100\n\nCreate a production-ready plugin in a few simple steps.\n\n* Create a folder for your plugin and init some preliminary steps\n\n```sh\nmkdir grapesjs-my-plugin\ncd grapesjs-my-plugin\nnpm init -y\ngit init\n```\n\n* Install the package\n\n```sh\nnpm i -D grapesjs-cli\n```\n\n* Init your plugin project by following few steps\n\n```sh\nnpx grapesjs-cli init\n```\n\nYou can also skip all the questions with `-y` option or pass all the answers via options (to see all available options run `npx grapesjs-cli init --help`)\n\n```sh\nnpx grapesjs-cli init -y --user=YOUR-GITHUB-USERNAME\n```\n\n* The command will scaffold the `src` directory and a bunch of other files inside your project. The `src/index.js` will be the entry point of your plugin. Before starting developing your plugin run the development server and open the printed URL (eg. the default is http://localhost:8080)\n\n```sh\nnpx grapesjs-cli serve\n```\n\nIf you need a custom port use the `-p` option\n\n```sh\nnpx grapesjs-cli serve -p 8081\n```\n\nUnder the hood we use `webpack-dev-server` and you can pass its option via CLI in this way\n\n```sh\nnpx grapesjs-cli serve --devServer='{\"https\": true}'\n```\n\n* Once the development is finished you can build your plugin and generate the minified file ready for production\n\n```sh\nnpx grapesjs-cli build\n```\n\n* Before publishing your package remember to complete your README.md file with all the available options, components, blocks and so on.\nFor a better user engagement create a simple live demo by using services like [JSFiddle](https://jsfiddle.net) [CodeSandbox](https://codesandbox.io) [CodePen](https://codepen.io) and link it in your README. To help you in this process we'll print all the necessary HTML/CSS/JS in your README, so it will be just a matter of copy-pasting on some of those services.\n\n## Customization\n\n### Customize webpack config\n\nIf you need to customize the webpack configuration, you can create `webpack.config.js` file in the root dir of your project and export a function, which should return the new configuration object. Check the example below.\n\n```js\n// YOUR-PROJECT-DIR/webpack.config.js\n\n// config is the default configuration\nexport default ({ config }) =\u003e {\n    // This is how you can distinguish the `build` command from the `serve`\n    const isBuild = config.mode === 'production';\n\n    return {\n        ...config,\n        module: {\n            rules: [ { /* extra rule */ }, ...config.module.rules ],\n        },\n    };\n}\n```\n\n## Generic CLI usage\n\nShow all available commands\n\n```sh\ngrapesjs-cli\n```\n\nShow available options for a command\n\n```sh\ngrapesjs-cli COMMAND --help\n```\n\nRun the command\n\n```sh\ngrapesjs-cli COMMAND --OPT1 --OPT2=VALUE\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGrapesJS%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGrapesJS%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGrapesJS%2Fcli/lists"}