{"id":18561181,"url":"https://github.com/apostrophecms/cli","last_synced_at":"2025-04-10T02:31:25.394Z","repository":{"id":45077478,"uuid":"375151184","full_name":"apostrophecms/cli","owner":"apostrophecms","description":"The Apostrophe CLI is a cross-platform starting point for creating and configuring ApostropheCMS projects. Works for Apostrophe 3 and Apostrophe 2 projects.","archived":false,"fork":false,"pushed_at":"2025-01-07T17:26:02.000Z","size":305,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T05:30:03.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-06-08T21:35:25.000Z","updated_at":"2025-01-07T17:25:58.000Z","dependencies_parsed_at":"2024-01-25T15:50:53.549Z","dependency_job_id":null,"html_url":"https://github.com/apostrophecms/cli","commit_stats":{"total_commits":42,"total_committers":5,"mean_commits":8.4,"dds":"0.40476190476190477","last_synced_commit":"2a9adb3fa752675b06cb28dbc2e7f884bcb3e7e8"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostrophecms%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostrophecms","download_url":"https://codeload.github.com/apostrophecms/cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144204,"owners_count":21054885,"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-11-06T22:06:04.276Z","updated_at":"2025-04-10T02:31:25.090Z","avatar_url":"https://github.com/apostrophecms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apostrophe 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 `@apostrophecms/cli` as a global NPM module:\n\n```bash\nnpm install -g @apostrophecms/cli\n```\n\nTo view the available commands in a given context, execute the `apos` command with no arguments:\n\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 \u003cshortname-without-spaces\u003e\n```\n\nThis will create a local copy of the [apostrophe essentials starter kit](https://github.com/apostrophecms/starter-kit-essentials).\n\n### options\n\n#### `--starter`\n\nRun `create` with a `--starter` flag to start from a Github repository other than the standard starters. For example, `apos create \u003cshortname-without-spaces\u003e --starter=https://github.com/apostrophecms/apostrophe-open-museum.git` would create a project using the [Open Museum](https://github.com/apostrophecms/apostrophe-open-museum) demo. The `--starter` flag also accepts shortened names for any of the [existing starter kits](https://github.com/orgs/apostrophecms/repositories?q=starter-kit\u0026type=all) that consists of the name of the repo with the `starter-kit-` prefix removed. For example, `apos create \u003cshortname-without-spaces\u003e --starter=ecommerce` for the `starter-kit-ecommerce` repo. Finally, if you are using a personal or organizational repo, you can prefix your repo with it's location followed by the name to automatically add `https://github.com/`. For example, `apos create \u003cshortname-without-spaces\u003e --starter=mycoolcompany/my-starter`.\n\n#### `--mongodb-uri`\nIf you are not using a locally hosted MongoDB server, you can provide a connection string with the `--mongodb-uri` flag. For the standard Atlas connection string, you will need to add quotes around the connection string due to the query parameters. This allows for the creation of an admin user during project creation. **Note**: this will not add your connection string to the project. It needs to be included through the `APOS_MONGODB_URI` environment variable, potentially through a `.env` file.\n\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 add 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\nAdd a `--player` option to the command to include the client-side Javascript \"player\" boilerplate to the new widget module as well.\n\n```bash\napos add widget tabs --player\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\n```bash\napos add piece vegetable\n```\n\nThen remember to register `'vegetable': {}` in `app.js` above.\n\nIf you run the `add piece` command with the `--page` flag, the command will also set up a corresponding piece-pages module with your new piece type. Similarly, you can run the `add piece` command with the `--widget` flag, which will also set up a corresponding piece-widgets module along with your new piece type. These flags can be used together or separately.\n\n```bash\napos add piece vegetable --page --widget\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 add module \u003cmodule name\u003e\n```\n\nRemember to register the module in `app.js` with the other module types.\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%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostrophecms%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostrophecms%2Fcli/lists"}