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
@@ -0,0 +1,102 @@
---
id: PatternFly CLI
title: PatternFly CLI
section: developer-guides
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
section: developer-guides
section: get-started

just saw your previous reply that this tool is actually more oriented towards designers right now. with that in mind (combined with the technicality of the doc itself), I think your initial suggestion of putting this in the get started section is okay for now actually

---

The [PatternFly CLI](https://github.com/patternfly/patternfly-cli) is a command-line tool for scaffolding projects, performing code modifications, and running project-related tasks. It aims to streamline development workflows and improve productivity. The published package is [`@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.

I did just want to mention that (as someone who has no knowledge of this tool) it's not extremely clear to me why this is a separate tool and why designers will be using this. When I read "streamline development workflows and improve productivity" it just sounds like a general dev accelerator tool, so it might be helpful to more explicitly state why we've created this new tool, why we're doing it now, and what's special about it. If I was a designer I wouldn't necessarily pick up that this tool was intended for me to use

that extra context could go up front or in the next ## Features section


## Features
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
## Features
## What does the PatternFly CLI help with?

Maybe some sort of question-formatted heading to help users move through the doc?


- **Project scaffolding:** Quickly set up new PatternFly based projects for development, and prototyping. This is done using predefined templates.
- **Code modifications:** Automate repetitive code changes that helps users upgrade to the latest version of PatternFly.
- **Task runner:** Execute project-related tasks efficiently, such as source code management and task running.
Comment on lines +11 to +13
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
- **Project scaffolding:** Quickly set up new PatternFly based projects for development, and prototyping. This is done using predefined templates.
- **Code modifications:** Automate repetitive code changes that helps users upgrade to the latest version of PatternFly.
- **Task runner:** Execute project-related tasks efficiently, such as source code management and task running.
- **Project scaffolding:** Quickly set up new PatternFly based projects for development and prototyping via predefined templates.
- **Code modifications:** Automate repetitive code changes to help accelerate PatternFly version upgrades.
- **Task runner:** Execute project-related tasks efficiently, such as source code management and task running.

would be good to clarify what "task running" means in the last bullet - right now the description doesn't add much extra context for what sort of tasks this might refer to



## How do I setup 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
## How do I setup PatternFly CLI?
## How do I set up PatternFly CLI?


### Prerequisites
Prerequistes can be found below. For macOS, WSL, and Linux it is recommended that you use [install script](#install-script-macos-and-linux), it covers the items below (you may still need administrator access for system packages). Window based system you will need to install the following yourself before using the 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
Prerequistes can be found below. For macOS, WSL, and Linux it is recommended that you use [install script](#install-script-macos-and-linux), it covers the items below (you may still need administrator access for system packages). Window based system you will need to install the following yourself before using the CLI:
There are a few key prerequisites to meet before using PatternFly CLI. For macOS, WSL, and Linux, we recommended using [install script](#install-script-macos-and-linux) to address the following prerequisites (you might still need administrator access for system packages). For a Windows-based system, you will need to install the following items manually:


- **[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**) — also see [npm](https://www.npmjs.com/).
- **[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable with `corepack enable` after installing npm.
- **[GitHub CLI](https://cli.github.com/)** (`gh`)
Comment on lines +21 to +23
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
- **[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**) — also see [npm](https://www.npmjs.com/).
- **[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable with `corepack enable` after installing npm.
- **[GitHub CLI](https://cli.github.com/)** (`gh`)
- **[Node.js](https://nodejs.org/)** (Supported versions: 20–24) and **[npm](https://www.npmjs.com/)**
- **[Corepack](https://nodejs.org/api/corepack.html)** (Included with Node.js and enabled via `corepack enable` after installing npm)
- **[GitHub CLI](https://cli.github.com/)** (`gh`)


## Installation

### Install script (macOS and Linux)

You can pipe the repository install script into `bash`. It installs Node.js with [nvm](https://github.com/nvm-sh/nvm) when `node` is not available, enables Corepack, installs GitHub CLI when it is missing, then installs the CLI globally from npm:
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 pipe the repository install script into `bash`. It installs Node.js with [nvm](https://github.com/nvm-sh/nvm) when `node` is not available, enables Corepack, installs GitHub CLI when it is missing, then installs the CLI globally from npm:
You can pipe the repository install script into `bash`. This installs Node.js with [nvm](https://github.com/nvm-sh/nvm) when `node` is not available, enables Corepack, installs GitHub CLI when it is missing, and installs the CLI globally from npm:


```sh
curl -fsSL https://raw.githubusercontent.com/patternfly/patternfly-cli/main/scripts/install.sh | bash
```

The script may prompt for `sudo` when your system package manager installs GitHub 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 script may prompt for `sudo` when your system package manager installs GitHub CLI.
The script might prompt you to include `sudo` when your system package manager installs GitHub CLI.


### Windows 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
### Windows Install
### Windows


After installing the [prerequisites](#prerequisites) on your machine, install the published package globally:

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

## Usage
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
## Usage
## How do I use PatternFly CLI?


After installation, you can verify the latest version of the CLI has been installed by running the following in the termianl:
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, you can verify the latest version of the CLI has been installed by running the following in the termianl:
After installation, you can verify the latest version of the CLI has been installed by running the following terminal command:


```sh
patternfly-cli -v
```

### Available CLI 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
Once the PatternFly CLI is installed, you can run the following commands via `patternfly-cli [command]`:

| Command | Usage |
| --- | --- |
| `create` | Create a new project from the available templates. |
| `list` | List all available templates (built-in and optional custom). |
| `update` | Update your project to a newer version. |
| `cli-upgrade` | Upgrade the globally installed CLI to the latest npm release. It runs `npm install -g @patternfly/patternfly-cli@latest`; use your package manager’s equivalent if you did not install with npm. |
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
| `cli-upgrade` | Upgrade the globally installed CLI to the latest npm release. It runs `npm install -g @patternfly/patternfly-cli@latest`; use your package manager’s equivalent if you did not install with npm. |
| `cli-upgrade` | Upgrade the globally installed CLI to the latest npm release. It runs `npm install -g @patternfly/patternfly-cli@latest`—use your package manager’s equivalent if you did not install with npm. |

| `init` | Initialize a git repository and optionally create a GitHub repository. |
| `save` | Commit and push changes to the current branch. |
| `load` | Pull the latest updates from GitHub. |
| `deploy` | Build and deploy your app to GitHub Pages. |

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

### Custom templates

You can add your own templates in addition to the built-in ones by passing a JSON file with `--template-file` (or `-t`). Custom templates are merged with the built-in list; if a custom template has the same `name` as a built-in one, the custom definition is used.
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 add your own templates in addition to the built-in ones by passing a JSON file with `--template-file` (or `-t`). Custom templates are merged with the built-in list; if a custom template has the same `name` as a built-in one, the custom definition is used.
In addition to the built-in templates, you can add your own templates by passing a JSON file with `--template-file` (or `-t`). Custom templates are merged with the built-in list—if a custom template has the same `name` as a built-in template, the custom definition is used.


**Create with 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
**Create with custom templates:**
**Create a project based on custom templates:**


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

**List templates including custom file:**
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
**List templates including custom file:**
**List templates included in custom file:**


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

**JSON format** (array of template objects, same shape as the built-in 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
**JSON format** (array of template objects, same shape as the built-in templates):
**JSON format** (Array of template objects, shown in the same shape as the built-in templates):


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

- **`name`** (required): Template identifier.
- **`description`** (required): Short description shown in prompts and `list`.
- **`repo`** (required): Git clone URL.
- **`options`** (optional): Array of extra arguments for `git clone` (e.g. `["--single-branch", "--branch", "main"]`).
- **`packageManager`** (optional): `npm`, `yarn`, or `pnpm`; defaults to `npm` if omitted.
Comment on lines +98 to +102
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
- **`name`** (required): Template identifier.
- **`description`** (required): Short description shown in prompts and `list`.
- **`repo`** (required): Git clone URL.
- **`options`** (optional): Array of extra arguments for `git clone` (e.g. `["--single-branch", "--branch", "main"]`).
- **`packageManager`** (optional): `npm`, `yarn`, or `pnpm`; defaults to `npm` if omitted.
- **`name`** (required): Template identifier
- **`description`** (required): Short description shown in prompts and `list`
- **`repo`** (required): Git clone URL
- **`options`** (optional): Array of extra arguments for `git clone` (such as `["--single-branch", "--branch", "main"]`)
- **`packageManager`** (optional): `npm`, `yarn`, or `pnpm`; defaults to `npm` if omitted

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
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
Loading