Skip to content

Commit

Permalink
Added the create-keystone-app CLI argument documentation (#2278)
Browse files Browse the repository at this point in the history
* Added support for --name and --adapter and fixed the --template CLI arguments

* Using strict string equality

* Added support for unattended app creation using CLI arguments

* Updated Keystone app generation documentation with the CLI arguments and sample commands (#2276)

* Reverted the manual version change. This should be done automatically using changesets

* Moved the create-app package argument documentation to the bottom of the README file

* Changeset for the keystone-create-app CLI arguments
  • Loading branch information
gabipetrovay authored and jesstelford committed Jan 23, 2020
1 parent 4244635 commit 1235f8d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/twenty-baboons-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'create-keystone-app': patch
'@keystonejs/website': patch
---

Added the documentation for the keystone-create-app CLI arguments (#2276)
2 changes: 2 additions & 0 deletions docs/quick-start/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ You'll be prompted with a few questions:
2. **Select a starter project.** Select the `Todo` application if you wish to follow this guide.
3. **Select an adapter.** We'll go more into database adapters later. For now, simply choose `Mongoose` if you're running a MongoDB database and `Knex` if you're running a Postgres one.

If you want to perform an unattended app generation (i.e. skipping the prompts), see the [CLI arguments](/packages/create-keystone-app/README.md) of the `create-keystone-app` utility script.

Wait a few minutes for all the project dependencies to install. Once that's finished, run this:

```sh
Expand Down
34 changes: 32 additions & 2 deletions packages/create-keystone-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,45 @@ title: Create Keystone App

# Create Keystone App

A cli for Keystone 5 to help generate starter apps.
A CLI for Keystone 5 to help generate starter apps.

## Usage

### Interactive

```sh
yarn create keystone-app my-app
```

Follow the prompts, then:
and follow the prompts.

### Non-Interactive

A non-interactive Keystone app creation could be useful in unattended app generation.
One such example is creating a Docker image with a generated Keystone app built in.
See the list of possible arguments in the **Arguments** section below.

```sh
npm init keystone-app --name "My App" --template "starter" --adapter "Mongoose" my-app
```

The app generation will fall back to interactive prompts if any of the arguments are
missing or have incorrect values.

**NOTE**: By the time this documentation was written, `yarn create` was not working
because the CLI arguments were not passed to the `create-keystone-app` script.

### Arguments

| Argument | Type | Description |
| :----------- | :-------- | :--------------------------------------------------------------------------------------------------------------------------- |
| `--name` | `String` | The Keystone app name visible in the Admin UI and page titles. |
| `--template` | `String` | One of the existing app templates (folder name). For example: `starter`, `todo`, etc. |
| `--adapter` | `String` | One of the adapters listed in the app template. Usually one of: `Mongoose`, `Knex`. |
| `--dry-run` | `Boolean` | Will go through the app generation process validating the user inputs or CLI arguments but in the end no app will be generated. |


## Run the App

```sh
cd my-app
Expand Down

0 comments on commit 1235f8d

Please sign in to comment.