feat: added documentation for patternfly cli.#5009
Conversation
| | --- | --- | | ||
| | `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. | |
There was a problem hiding this comment.
| | `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. | |
| ```sh | ||
| patternfly-cli --version | ||
| ``` | ||
|
|
There was a problem hiding this comment.
| ### 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. |
There was a problem hiding this comment.
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]"
There was a problem hiding this comment.
there's an example above for this.
There was a problem hiding this comment.
which example? or do you just mean the general setup instructions? if this isn't helpful though, we can skip it
…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>
edonehoo
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
| 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`. |
There was a problem hiding this comment.
| 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). |
There was a problem hiding this comment.
| 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—if a custom template has the same `name` as a built-in template, the custom definition is used. |
There was a problem hiding this comment.
| 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. | |
| 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—if a custom template has the same `name` as a predefined template, the custom definition is used. |
| ```sh | ||
| patternfly-cli --version | ||
| ``` | ||
|
|
There was a problem hiding this comment.
which example? or do you just mean the general setup instructions? if this isn't helpful though, we can skip it
Added documentation for the patternfly cli.