Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ We support the following configurations:

#### New projects

If you'd like to start using PatternFly via a sample project, you can use the [PatternFly React seed](https://github.com/patternfly/patternfly-react-seed). We created this open-source build scaffolding utility to help developers jump start new PatternFly projects.
If you'd like to start using PatternFly via a sample project, you can use the [PatternFly React seed](https://github.com/patternfly/patternfly-react-seed). We created this open-source build scaffolding utility to help developers jump start new PatternFly projects. You can also scaffold projects from the command line with the [PatternFly CLI](/get-started/patternfly-cli).

To get started:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
id: PatternFly CLI
title: PatternFly CLI
section: get-started
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the get started section is more so intended for introductory/overview information. Are you set on including these docs there? Otherwise, we could move to /developer-guides or maybe at least nest it under get-started/develop (assuming this is a dev-focused tool)?

---

import './get-started.css';
import { Alert } from '@patternfly/react-core';

The [PatternFly CLI](https://github.com/patternfly/patternfly-cli) is a command-line tool for scaffolding projects, applying code changes, and running common project tasks. It is published as [`@patternfly/patternfly-cli` on npm](https://www.npmjs.com/package/@patternfly/patternfly-cli).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The [PatternFly CLI](https://github.com/patternfly/patternfly-cli) is a command-line tool for scaffolding projects, applying code changes, and running common project tasks. It is published as [`@patternfly/patternfly-cli` on npm](https://www.npmjs.com/package/@patternfly/patternfly-cli).
The [PatternFly CLI](https://github.com/patternfly/patternfly-cli) is a command-line tool published on npm as [`@patternfly/patternfly-cli`](https://www.npmjs.com/package/@patternfly/patternfly-cli). With this tool, you can scaffold projects from built-in or custom templates, automate code updates for repetitive changes, and run workflows (including init, sync with GitHub, updates, and deploys to GitHub Pages).
The PatternFly CLI is developed in the open at [github.com/patternfly/patternfly-cli](https://github.com/patternfly/patternfly-cli), with release notes and tags published on [Releases page](https://github.com/patternfly/patternfly-cli/releases). To report issues or contribute to this tool, refer to the patternfly-cli repo for more instruction.

wdyt about this description, rather than the "what you can do" list? Just to build those list points into the narrative a little more

also moved up the bit about source and releases from the end of the page


## What you can do

- **Scaffold projects** from built-in or custom templates.
- **Automate code updates** for repetitive changes.
- **Run workflows** such as init, sync with GitHub, updates, and deploys to GitHub Pages.
Comment on lines +12 to +16
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## What you can do
- **Scaffold projects** from built-in or custom templates.
- **Automate code updates** for repetitive changes.
- **Run workflows** such as init, sync with GitHub, updates, and deploys to GitHub Pages.

remove, if you're okay with folding into the intro description as I did


## Prerequisites
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Prerequisites
## How do I set up the PatternFly CLI?
### Prerequisites


Before you install the CLI, set up:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Before you install the CLI, set up:
Before you install the PatternFly CLI, you must set up the following:


1. **[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**).
1. **[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable it with `corepack enable` after installing Node.
1. **[GitHub CLI](https://cli.github.com/)** (`gh`) — required for commands that talk to GitHub.
Comment on lines +22 to +24
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**).
1. **[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable it with `corepack enable` after installing Node.
1. **[GitHub CLI](https://cli.github.com/)** (`gh`) — required for commands that talk to GitHub.
1. **[Node.js and npm](https://nodejs.org/)** (versions 20–24 currently supported).
1. **[Corepack](https://nodejs.org/api/corepack.html):** After Node is installed, enabled corepack via `corepack enable` on the command line.
1. **[GitHub CLI](https://cli.github.com/):** Required for commands that refer to GitHub (`gh`).

Is corepack enable a cli command?


## Install
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Install
### Install


Install the CLI globally:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Install the CLI globally:
Install the PatternFly CLI globally:


```sh
npm install -g @patternfly/patternfly-cli
```

## Check your setup
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Check your setup
### Check your setup


Run the doctor command to verify prerequisites:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Run the doctor command to verify prerequisites:
To verify prerequisites, run the `doctor` command:


```sh
patternfly-cli doctor
```

To try to fix missing pieces automatically (Corepack and GitHub CLI only):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To try to fix missing pieces automatically (Corepack and GitHub CLI only):
To try to fix missing pieces automatically, add the `--fix` flag (Corepack and GitHub CLI only):


```sh
patternfly-cli doctor --fix
```

<Alert title="Node.js must be installed separately" variant="warning" isInline>
The `doctor --fix` option does not install or upgrade Node.js. If Node.js is missing or below version 20, install the current **LTS** release from [nodejs.org](https://nodejs.org/).
</Alert>
Comment on lines +48 to +50
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<Alert title="Node.js must be installed separately" variant="warning" isInline>
The `doctor --fix` option does not install or upgrade Node.js. If Node.js is missing or below version 20, install the current **LTS** release from [nodejs.org](https://nodejs.org/).
</Alert>
<Alert title="Node.js must be installed separately" variant="warning" isInline>
The `doctor --fix` option does not install or upgrade Node.js. If Node.js is missing or below version 20, install the current LTS release from [nodejs.org](https://nodejs.org/).
</Alert>


## Commands
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Commands
## How do I use the PatternFly CLI?
### Commands


After installation, run:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After installation, run:
Once the PatternFly CLI is installed, you can run the following commands via `patternfly-cli [command]`:


```sh
patternfly-cli [command]
```
Comment on lines +56 to +58
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```sh
patternfly-cli [command]
```


| Command | Description |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Command | Description |
| Command | Usage |

| --- | --- |
| `doctor` | Check requirements; use `--fix` to enable Corepack and install `gh` where supported. |
| `create` | Create a new project from a template. |
| `list` | List available templates (built-in and custom). |
| `update` | Update the project to a newer PatternFly-oriented version where applicable. |
| `init` | Initialize a git repository and optionally create a GitHub repo. |
| `save` | Commit and push changes on the current branch. |
| `load` | Pull the latest changes from GitHub. |
| `deploy` | Build and deploy the app to GitHub Pages. |
Comment on lines +62 to +69
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `doctor` | Check requirements; use `--fix` to enable Corepack and install `gh` where supported. |
| `create` | Create a new project from a template. |
| `list` | List available templates (built-in and custom). |
| `update` | Update the project to a newer PatternFly-oriented version where applicable. |
| `init` | Initialize a git repository and optionally create a GitHub repo. |
| `save` | Commit and push changes on the current branch. |
| `load` | Pull the latest changes from GitHub. |
| `deploy` | Build and deploy the app to GitHub Pages. |
| `doctor` | Check requirements. Add the `--fix` flag to enable Corepack and install `gh` where supported. |
| `create` | Create a new project from a template. |
| `list` | List available templates (built-in and custom). |
| `update` | Update the project to a newer PatternFly-oriented version where applicable. |
| `init` | Initialize a git repository and optionally create a GitHub repo. |
| `save` | Commit and push changes on the current branch. |
| `load` | Pull the latest changes from GitHub. |
| `deploy` | Build and deploy the app to GitHub Pages. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Add the --fix flag to enable Corepack and install gh where supported. |" This reads like --fix both enables Corepack and installs gh -- is that correct?


For the most up-to-date flags and behavior, see the [PatternFly CLI README](https://github.com/patternfly/patternfly-cli/blob/main/README.md) on GitHub.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the most up-to-date flags and behavior, see the [PatternFly CLI README](https://github.com/patternfly/patternfly-cli/blob/main/README.md) on GitHub.
For the most up-to-date flags and behavior guidance, refer to the [PatternFly CLI README](https://github.com/patternfly/patternfly-cli/blob/main/README.md) on GitHub.


## Custom templates
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Custom templates
### Custom templates


You can merge your own templates with the built-ins by passing a JSON file with `--template-file` (or `-t`):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can merge your own templates with the built-ins by passing a JSON file with `--template-file` (or `-t`):
You can merge your own templates with the built-in templates by passing a JSON file with `--template-file` (or `-t`):


```sh
patternfly-cli create my-app --template-file ./my-templates.json
patternfly-cli list --template-file ./my-templates.json
```

Each entry is an object with at least `name`, `description`, and `repo` (clone URL). Optional fields include `options` (extra `git clone` arguments) and `packageManager` (`npm`, `yarn`, or `pnpm`; default is `npm`). If a custom template uses the same `name` as a built-in one, the custom definition wins.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each entry is an object with at least `name`, `description`, and `repo` (clone URL). Optional fields include `options` (extra `git clone` arguments) and `packageManager` (`npm`, `yarn`, or `pnpm`; default is `npm`). If a custom template uses the same `name` as a built-in one, the custom definition wins.
Each entry is an object with at least `name`, `description`, and `repo` (clone URL). Optional fields include `options` (extra `git clone` arguments) and `packageManager` (`npm` by default, or `yarn`/`pnpm`). If a custom template uses the same `name` as a built-in template, the custom definition is used.


Example:

```json
[
{
"name": "my-template",
"description": "My custom project template",
"repo": "https://github.com/org/repo.git",
"options": ["--single-branch", "--branch", "main"],
"packageManager": "npm"
}
]
```

## Source and releases

The CLI is developed in the open at [github.com/patternfly/patternfly-cli](https://github.com/patternfly/patternfly-cli). Report issues or contribute there; release notes and tags are published on the repository’s [Releases](https://github.com/patternfly/patternfly-cli/releases) page.
Comment on lines +98 to +100
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Source and releases
The CLI is developed in the open at [github.com/patternfly/patternfly-cli](https://github.com/patternfly/patternfly-cli). Report issues or contribute there; release notes and tags are published on the repository’s [Releases](https://github.com/patternfly/patternfly-cli/releases) page.

moving up top?

2 changes: 1 addition & 1 deletion packages/site/src/content/get-started/develop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ We support the following configurations:

#### New projects

If you'd like to start using PatternFly via a sample project, you can use the [PatternFly React seed](https://github.com/patternfly/patternfly-react-seed). We created this open-source build scaffolding utility to help developers jump start new PatternFly projects.
If you'd like to start using PatternFly via a sample project, you can use the [PatternFly React seed](https://github.com/patternfly/patternfly-react-seed). We created this open-source build scaffolding utility to help developers jump start new PatternFly projects. You can also scaffold projects from the command line with the [PatternFly CLI](/get-started/patternfly-cli).

To get started:

Expand Down
100 changes: 100 additions & 0 deletions packages/site/src/content/get-started/patternfly-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
id: PatternFly CLI
title: PatternFly CLI
section: get-started
---

import './get-started.css';
import { Alert } from '@patternfly/react-core';

The [PatternFly CLI](https://github.com/patternfly/patternfly-cli) is a command-line tool for scaffolding projects, applying code changes, and running common project tasks. It is published as [`@patternfly/patternfly-cli` on npm](https://www.npmjs.com/package/@patternfly/patternfly-cli).

## What you can do

- **Scaffold projects** from built-in or custom templates.
- **Automate code updates** for repetitive changes.
- **Run workflows** such as init, sync with GitHub, updates, and deploys to GitHub Pages.

## Prerequisites

Before you install the CLI, set up:

1. **[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**).
1. **[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable it with `corepack enable` after installing Node.
1. **[GitHub CLI](https://cli.github.com/)** (`gh`) — required for commands that talk to GitHub.

## Install

Install the CLI globally:

```sh
npm install -g @patternfly/patternfly-cli
```

## Check your setup

Run the doctor command to verify prerequisites:

```sh
patternfly-cli doctor
```

To try to fix missing pieces automatically (Corepack and GitHub CLI only):

```sh
patternfly-cli doctor --fix
```

<Alert title="Node.js must be installed separately" variant="warning" isInline>
The `doctor --fix` option does not install or upgrade Node.js. If Node.js is missing or below version 20, install the current **LTS** release from [nodejs.org](https://nodejs.org/).
</Alert>

## Commands

After installation, run:

```sh
patternfly-cli [command]
```

| Command | Description |
| --- | --- |
| `doctor` | Check requirements; use `--fix` to enable Corepack and install `gh` where supported. |
| `create` | Create a new project from a template. |
| `list` | List available templates (built-in and custom). |
| `update` | Update the project to a newer PatternFly-oriented version where applicable. |
| `init` | Initialize a git repository and optionally create a GitHub repo. |
| `save` | Commit and push changes on the current branch. |
| `load` | Pull the latest changes from GitHub. |
| `deploy` | Build and deploy the app to GitHub Pages. |

For the most up-to-date flags and behavior, see the [PatternFly CLI README](https://github.com/patternfly/patternfly-cli/blob/main/README.md) on GitHub.

## Custom templates

You can merge your own templates with the built-ins by passing a JSON file with `--template-file` (or `-t`):

```sh
patternfly-cli create my-app --template-file ./my-templates.json
patternfly-cli list --template-file ./my-templates.json
```

Each entry is an object with at least `name`, `description`, and `repo` (clone URL). Optional fields include `options` (extra `git clone` arguments) and `packageManager` (`npm`, `yarn`, or `pnpm`; default is `npm`). If a custom template uses the same `name` as a built-in one, the custom definition wins.

Example:

```json
[
{
"name": "my-template",
"description": "My custom project template",
"repo": "https://github.com/org/repo.git",
"options": ["--single-branch", "--branch", "main"],
"packageManager": "npm"
}
]
```

## Source and releases

The CLI is developed in the open at [github.com/patternfly/patternfly-cli](https://github.com/patternfly/patternfly-cli). Report issues or contribute there; release notes and tags are published on the repository’s [Releases](https://github.com/patternfly/patternfly-cli/releases) page.
Loading