Skip to content

feat: added documentation for patternfly cli.#5009

Open
dlabaj wants to merge 7 commits into
patternfly:mainfrom
dlabaj:pfcli-dev-update
Open

feat: added documentation for patternfly cli.#5009
dlabaj wants to merge 7 commits into
patternfly:mainfrom
dlabaj:pfcli-dev-update

Conversation

@dlabaj
Copy link
Copy Markdown
Contributor

@dlabaj dlabaj commented May 11, 2026

Added documentation for the patternfly cli.

@dlabaj dlabaj requested a review from edonehoo May 11, 2026 16:57
@dlabaj
Copy link
Copy Markdown
Contributor Author

dlabaj commented May 11, 2026

New PR with pf cli updates. I closed #4981 this pr includes the updates from review comments on #4981.

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented May 11, 2026

Preview: https://pf-org--pr-5009-site.surge.sh

Comment thread packages/documentation-site/patternfly-docs/content/AI/patternfly-cli.md Outdated
Comment thread packages/documentation-site/patternfly-docs/content/AI/patternfly-cli.md Outdated
Comment thread packages/documentation-site/patternfly-docs/content/AI/patternfly-cli.md Outdated
| --- | --- |
| `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. |
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
| `update` | Update your project to a newer version. |
| `update` | Migrate your project to a newer PatternFly version using codemods, which handle import changes, component renames, and other breaking changes automatically. |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

```sh
patternfly-cli --version
```

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
### Typical workflow
If you're starting a new project and publishing it, this is the usual sequence:
[CODE FORMAT THIS]
patternfly-cli create my-app # create a new project from a template
cd my-app
patternfly-cli init # set up Git and connect to GitHub
patternfly-cli save # commit and push your changes
patternfly-cli deploy # publish to GitHub Pages
For an existing project, use patternfly-cli update to migrate to a newer PatternFly version.

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.

Up to you - do you want to have a beginning to end example like this?

sorry I couldn't get the code block format to work here - so you'll need to replace "[CODE FORMAT THIS]"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there's an example above for this.

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.

which example? or do you just mean the general setup instructions? if this isn't helpful though, we can skip it

dlabaj and others added 2 commits May 11, 2026 16:25
…fly-cli.md

Co-authored-by: Erin Donehoo <105813956+edonehoo@users.noreply.github.com>
…fly-cli.md

Co-authored-by: Erin Donehoo <105813956+edonehoo@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@edonehoo edonehoo left a comment

Choose a reason for hiding this comment

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

just a few more things


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 streamlines everyday development work and PatternFly upgrades, making it convenient and easy to work straight from the terminal. You can run it in the terminal on its own, or use it from an AI-enabled editor (such as [Cursor](https://www.cursor.com/)) so coding agents can rely on the same predictable commands for scaffolding, updates, and git workflows. The published package is [`@patternfly/patternfly-cli` on npm](https://www.npmjs.com/package/@patternfly/patternfly-cli).

The npm package installs two equivalent entry points: `patternfly-cli` and the shorter alias `pfcli`. The examples below use `patternfly-cli`; substitute `pfcli` if you prefer.
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 npm package installs two equivalent entry points: `patternfly-cli` and the shorter alias `pfcli`. The examples below use `patternfly-cli`; substitute `pfcli` if you prefer.
The npm package installs two equivalent entry points: `patternfly-cli` and the shorter alias `pfcli`. The examples below use `patternfly-cli`, but you can substitute `pfcli` in your own usage if you prefer.


### Predefined templates

Built-in templates ship with the CLI. Each row is the template `name` you pass to `patternfly-cli create` (or choose from the interactive prompt). To print the list from your installed version, run `patternfly-cli list`.
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
Built-in templates ship with the CLI. Each row is the template `name` you pass to `patternfly-cli create` (or choose from the interactive prompt). To print the list from your installed version, run `patternfly-cli list`.
The following predefined templates ship with PatternFly CLI:

| `compass-starter` | Starter template for a PatternFly Compass theme TypeScript project |
| `nextjs-starter` | Starter template for a PatternFly Next.js project |

Template definitions in source: [patternfly-cli `src/templates.ts`](https://github.com/patternfly/patternfly-cli/blob/main/src/templates.ts).
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
Template definitions in source: [patternfly-cli `src/templates.ts`](https://github.com/patternfly/patternfly-cli/blob/main/src/templates.ts).
To use a template, pass the template name to `patternfly-cli create [template name]` or choose the template from the interactive prompt triggered by the generic `patternfly-cli create` comman. To print a list of all templates from your installed version, run `patternfly-cli list`.
Template definitions can be found in the [patternfly-cli repo](https://github.com/patternfly/patternfly-cli/blob/main/src/templates.ts).


### Custom templates

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

```sh
patternfly-cli --version
```

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.

which example? or do you just mean the general setup instructions? if this isn't helpful though, we can skip it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants