{"id":18561196,"url":"https://github.com/apostrophecms-legacy/apostrophe-cli","last_synced_at":"2025-04-10T02:31:26.409Z","repository":{"id":23770179,"uuid":"27145080","full_name":"apostrophecms-legacy/apostrophe-cli","owner":"apostrophecms-legacy","description":"DEPRECATED. Use `@apostrophecms/cli` as the active ApostropheCMS CLI tool.","archived":false,"fork":false,"pushed_at":"2023-01-07T22:39:30.000Z","size":149,"stargazers_count":14,"open_issues_count":11,"forks_count":5,"subscribers_count":18,"default_branch":"main","last_synced_at":"2024-11-24T13:27:27.727Z","etag":null,"topics":["apostrophecms","cli"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@apostrophecms/cli","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apostrophecms-legacy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-25T20:40:27.000Z","updated_at":"2024-11-21T21:06:32.000Z","dependencies_parsed_at":"2023-01-13T23:50:39.505Z","dependency_job_id":null,"html_url":"https://github.com/apostrophecms-legacy/apostrophe-cli","commit_stats":null,"previous_names":["apostrophecms-legacy/apostrophe-cli","apostrophecms/apostrophe-cli"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms-legacy%2Fapostrophe-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms-legacy%2Fapostrophe-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms-legacy%2Fapostrophe-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms-legacy%2Fapostrophe-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostrophecms-legacy","download_url":"https://codeload.github.com/apostrophecms-legacy/apostrophe-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247934828,"owners_count":21020728,"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":["apostrophecms","cli"],"created_at":"2024-11-06T22:06:09.289Z","updated_at":"2025-04-10T02:31:26.097Z","avatar_url":"https://github.com/apostrophecms-legacy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apostrophe CLI\n\n⚠️ NOTE: `apostrophe-cli` is a deprecated version of the ApostropheCMS command line tool. [Please use `@apostrophecms/cli` instead.](https://www.npmjs.com/package/@apostrophecms/cli) ⚠️\n\nThe Apostrophe CLI is a cross-platform starting point for creating and configuring [ApostropheCMS](https://github.com/apostrophecms/apostrophe) projects, providing a simple boilerplate generator and wrapping other useful functions into an easy to use command line tool.\n\n**Requires Node.js 8+**\n\nFirst, install `apostrophe-cli` as a global NPM module:\n```bash\nnpm install -g apostrophe-cli\n```\n\nTo view the available commands in a given context, execute the newly-installed command with no arguments:\n```bash\napos\n```\n\n**Note:** All Apostrophe CLI commands can also be run with `apostrophe`, the legacy command, in addition to `apos`.\n\n## Create a project\n\nTo create a new project with the tool:\n```bash\napos create-project \u003cshortname-without-spaces\u003e\n```\n\nThis will create a local copy of our standard [Apostrophe Boilerplate](https://github.com/apostrophecms/apostrophe-boilerplate).\n\n### options\n\nRun `create-project` with a `--boilerplate` flag to start from a Github repository other than the standard `apostrophe-boilerplate` repo. For example, `apos create-project \u003cshortname-without-spaces\u003e --boilerplate=https://github.com/apostrophecms/apostrophe-open-museum.git` would create a project using the [Open Museum](https://github.com/apostrophecms/apostrophe-open-museum) demo.\n\nIf you run the `create-project` command with the `--setup` flag, the command will also `npm install` the dependencies for the project and run `apostrophe-users:add` to create an admin user for the CMS, resulting in a fully bootstrapped project. This command will prompt you for a password for the admin user being created.\n\n## Create a widget\nTo bootstrap the necessary files and basic configuration for a new Apostrophe widget, run the following command from within your Apostrophe project's root directory:\n```bash\n# \"-widgets\" will automatically be appended to the end of your module name\napos create-widget fancy-button\n```\n\n**Note:** You will then need to register this widget module in `app.js` so it is available in your project code. The same is true for the commands below when you create a piece module or generic module.\n\n```javascript\n// app.js\nmodule.exports = {\n  // ...\n  'fancy-button-widgets': {},\n  // ...\n}\n```\n\n\n## Create a piece\nTo bootstrap the necessary files and basic configuration for a new Apostrophe piece type, run the following command from within your Apostrophe project's root directory:\n```bash\n# be sure to use the SINGULAR version of the name of your content type\napos create-piece vegetable\n```\n\nThen remember to register `'vegetables': {}` in `apps.js` above.\n\nIf you run the `create-piece` command with the `--pages` flag, the command will also set up a corresponding pieces-pages module with your new piece type. Similarly, you can run the `create-piece` command with the `--widgets` flag, which will also set up a corresponding pieces-widgets module along with your new piece type. These flags can be used together or separately.\n\n```bash\napos create-piece vegetable --pages --widgets\n```\n\n## Create an empty Apostrophe module\nTo bootstrap the necessary files and basic configuration for a brand-new Apostrophe module that doesn't extend one of the usual suspects like pieces or widgets:\n```bash\napos create-module \u003cmodule name\u003e\n```\n\nRemember to register the module in `apps.js` with the other module types.\n\n## Run other Apostrophe-flavored command-line tasks\n\nTo run an Apostrophe command-line task with the Apostrophe CLI, which are conventionally run like this: `node app.js \u003cnamespace\u003e:\u003ctask name\u003e`, you may instead execute the following from any location within a project's directory:\n```bash\napos \u003cnamespace\u003e:\u003ctask name\u003e\n```\n\n\n\nThe Apostrophe CLI assumes the `apostrophe` namespace when executing tasks. This means that if a task is in the `apostrophe` namespace (such as the `apostrophe:generation` task), you can simply execute:\n```bash\napos \u003ctask name\u003e\n```\n\nFor more information on command-line tasks in Apostrophe, visit the [Command line tasks](https://docs.apostrophecms.org/reference/modules/apostrophe-tasks.html) documentation for Apostrophe.\n\n---------------\n\nFor more documentation for ApostropheCMS, visit the [documentation site](https://docs.apostrophecms.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms-legacy%2Fapostrophe-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostrophecms-legacy%2Fapostrophe-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms-legacy%2Fapostrophe-cli/lists"}