You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/documentation-site/patternfly-docs/content/get-started/patternfly-cli.md
+67-35Lines changed: 67 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,83 +5,109 @@ section: get-started
5
5
---
6
6
7
7
import './get-started.css';
8
-
import { Alert } from '@patternfly/react-core';
9
8
10
-
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).
9
+
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).
11
10
12
-
## What you can do
11
+
## Features
12
+
13
+
-**Project scaffolding:** Quickly set up new PatternFly based projects for development, and prototyping. This is done using predefined templates.
14
+
-**Code modifications:** Automate repetitive code changes that helps users upgrade to the latest version of PatternFly.
15
+
-**Task runner:** Execute project-related tasks efficiently, such as source code management and task running.
13
16
14
-
-**Scaffold projects** from built-in or custom templates.
15
-
-**Automate code updates** for repetitive changes.
16
-
-**Run workflows** such as init, sync with GitHub, updates, and deploys to GitHub Pages.
17
17
18
18
## Prerequisites
19
19
20
-
Before you install the CLI, set up:
20
+
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:
21
+
22
+
-**[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**) — also see [npm](https://www.npmjs.com/).
23
+
-**[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable with `corepack enable` after installing npm.
24
+
-**[GitHub CLI](https://cli.github.com/)** (`gh`)
21
25
22
-
1.**[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**).
23
-
1.**[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable it with `corepack enable` after installing Node.
24
-
1.**[GitHub CLI](https://cli.github.com/)** (`gh`) — required for commands that talk to GitHub.
26
+
## Installation
25
27
26
-
## Install
28
+
###Install script (macOS and Linux)
27
29
28
-
Install the CLI globally:
30
+
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:
The script may prompt for `sudo` when your system package manager installs GitHub CLI.
37
+
38
+
### Windows Install
39
+
40
+
After installing the [prerequisites](#prerequisites) on your machine, install the published package globally:
29
41
30
42
```sh
31
43
npm install -g @patternfly/patternfly-cli
32
44
```
33
45
34
-
## Check your setup
46
+
## Uninstall
47
+
48
+
### Uninstall script (macOS and Linux)
35
49
36
-
Run the doctor command to verify prerequisites:
50
+
If you ever wish to uninstall PatternFly Cli, you can do the following. Pipe the repository uninstall script into `bash`. It removes the globally installed `@patternfly/patternfly-cli` package with npm. It does **not** remove Node.js, nvm, Corepack, or GitHub CLI.
<Alerttitle="Node.js must be installed separately"variant="warning"isInline>
49
-
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/).
50
-
</Alert>
63
+
### Windows npm package uninstall
51
64
52
-
## Commands
65
+
If you installed the CLI on Windows, you can remove the CLI with:
53
66
54
-
After installation, run:
67
+
```sh
68
+
npm uninstall -g @patternfly/patternfly-cli
69
+
```
70
+
71
+
## Usage
72
+
73
+
After installation, you can verify the latest version of the CLI has been installed by running the following in the termianl:
55
74
56
75
```sh
57
-
patternfly-cli [command]
76
+
patternfly-cli -v
58
77
```
59
78
79
+
### Available CLI commands
80
+
60
81
| Command | Description |
61
82
| --- | --- |
62
-
|`doctor`|Check requirements; use `--fix` to enable Corepack and install `gh` where supported. |
63
-
|`create`|Create a new project from a template. |
64
-
|`list`|List available templates (built-in and custom). |
65
-
|`update`|Update the project to a newer PatternFly-oriented version where applicable. |
66
-
|`init`| Initialize a git repository and optionally create a GitHub repo. |
67
-
|`save`| Commit and push changes on the current branch. |
68
-
|`load`| Pull the latest changes from GitHub. |
69
-
|`deploy`| Build and deploy the app to GitHub Pages. |
83
+
|`create`|Create a new project from the available templates. |
84
+
|`list`|List all available templates (built-in and optional custom). |
85
+
|`update`|Update your project to a newer version. |
86
+
|`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. |
87
+
|`init`| Initialize a git repository and optionally create a GitHub repository. |
88
+
|`save`| Commit and push changes to the current branch. |
89
+
|`load`| Pull the latest updates from GitHub. |
90
+
|`deploy`| Build and deploy your app to GitHub Pages. |
70
91
71
92
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.
72
93
73
94
## Custom templates
74
95
75
-
You can merge your own templates with the built-ins by passing a JSON file with `--template-file` (or `-t`):
96
+
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.
patternfly-cli list --template-file ./my-templates.json
80
102
```
81
103
82
-
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.
104
+
**List templates including custom file:**
83
105
84
-
Example:
106
+
```sh
107
+
patternfly-cli list --template-file ./my-templates.json
108
+
```
109
+
110
+
**JSON format** (array of template objects, same shape as the built-in templates):
85
111
86
112
```json
87
113
[
@@ -95,6 +121,12 @@ Example:
95
121
]
96
122
```
97
123
124
+
-**`name`** (required): Template identifier.
125
+
-**`description`** (required): Short description shown in prompts and `list`.
126
+
-**`repo`** (required): Git clone URL.
127
+
-**`options`** (optional): Array of extra arguments for `git clone` (e.g. `["--single-branch", "--branch", "main"]`).
128
+
-**`packageManager`** (optional): `npm`, `yarn`, or `pnpm`; defaults to `npm` if omitted.
129
+
98
130
## Source and releases
99
131
100
132
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.
Copy file name to clipboardExpand all lines: packages/site/src/content/get-started/patternfly-cli.mdx
+71-33Lines changed: 71 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,83 +5,115 @@ section: get-started
5
5
---
6
6
7
7
import'./get-started.css';
8
-
import { Alert } from'@patternfly/react-core';
9
8
10
-
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).
9
+
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).
11
10
12
-
## What you can do
11
+
## Features
13
12
14
-
-**Scaffold projects**from built-in or custom templates.
15
-
-**Automate code updates**for repetitive changes.
16
-
-**Run workflows**such as init, sync with GitHub, updates, and deploys to GitHub Pages.
13
+
-**Project scaffolding:**Quickly set up new projects with predefined templates.
If you use the [install script](#install-script-macos-and-linux) on macOS or Linux, it covers the items below (you may still need administrator access for system packages). Otherwise, install the following yourself before using the CLI:
21
20
22
-
1.**[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**).
23
-
1.**[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable it with `corepack enable` after installing Node.
24
-
1.**[GitHub CLI](https://cli.github.com/)** (`gh`) — required for commands that talk to GitHub.
21
+
-**[Node.js and npm](https://nodejs.org/)** (supported versions **20–24**) — also see [npm](https://www.npmjs.com/).
22
+
-**[Corepack](https://nodejs.org/api/corepack.html)** — included with Node.js; enable with `corepack enable` after installing npm.
23
+
-**[GitHub CLI](https://cli.github.com/)** (`gh`)
25
24
26
-
## Install
25
+
## Installation
27
26
28
-
Install the CLI globally:
27
+
### Install script (macOS and Linux)
28
+
29
+
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:
The script may prompt for `sudo` when your system package manager installs GitHub CLI.
43
+
44
+
### npm
45
+
46
+
If you already have the [prerequisites](#prerequisites) on your machine, install the published package globally:
29
47
30
48
```sh
31
49
npm install -g @patternfly/patternfly-cli
32
50
```
33
51
34
-
## Check your setup
52
+
## Uninstall
53
+
54
+
### Uninstall script (macOS and Linux)
35
55
36
-
Run the doctor command to verify prerequisites:
56
+
Pipe the repository uninstall script into `bash`. It removes the globally installed `@patternfly/patternfly-cli` package with npm. It does **not** remove Node.js, nvm, Corepack, or GitHub CLI.
<Alerttitle="Node.js must be installed separately"variant="warning"isInline>
49
-
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/).
50
-
</Alert>
69
+
### npm
51
70
52
-
## Commands
71
+
If you installed with npm globally, remove the package with:
72
+
73
+
```sh
74
+
npm uninstall -g @patternfly/patternfly-cli
75
+
```
76
+
77
+
## Usage
53
78
54
79
After installation, run:
55
80
56
81
```sh
57
82
patternfly-cli [command]
58
83
```
59
84
85
+
### Available commands
86
+
60
87
| Command | Description |
61
88
| --- | --- |
62
-
|`doctor`|Check requirements; use `--fix` to enable Corepack and install `gh` where supported. |
63
-
|`create`|Create a new project from a template. |
64
-
|`list`|List available templates (built-in and custom). |
65
-
|`update`|Update the project to a newer PatternFly-oriented version where applicable. |
66
-
|`init`| Initialize a git repository and optionally create a GitHub repo. |
67
-
|`save`| Commit and push changes on the current branch. |
68
-
|`load`| Pull the latest changes from GitHub. |
69
-
|`deploy`| Build and deploy the app to GitHub Pages. |
89
+
|`create`|Create a new project from the available templates. |
90
+
|`list`|List all available templates (built-in and optional custom). |
91
+
|`update`|Update your project to a newer version. |
92
+
|`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. |
93
+
|`init`| Initialize a git repository and optionally create a GitHub repository. |
94
+
|`save`| Commit and push changes to the current branch. |
95
+
|`load`| Pull the latest updates from GitHub. |
96
+
|`deploy`| Build and deploy your app to GitHub Pages. |
70
97
71
98
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.
72
99
73
100
## Custom templates
74
101
75
-
You can merge your own templates with the built-ins by passing a JSON file with `--template-file` (or `-t`):
102
+
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.
patternfly-cli list --template-file ./my-templates.json
80
108
```
81
109
82
-
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.
110
+
**List templates including custom file:**
111
+
112
+
```sh
113
+
patternfly-cli list --template-file ./my-templates.json
114
+
```
83
115
84
-
Example:
116
+
**JSON format** (array of template objects, same shape as the built-in templates):
85
117
86
118
```json
87
119
[
@@ -95,6 +127,12 @@ Example:
95
127
]
96
128
```
97
129
130
+
-**`name`** (required): Template identifier.
131
+
-**`description`** (required): Short description shown in prompts and `list`.
132
+
-**`repo`** (required): Git clone URL.
133
+
-**`options`** (optional): Array of extra arguments for `git clone` (e.g. `["--single-branch", "--branch", "main"]`).
134
+
-**`packageManager`** (optional): `npm`, `yarn`, or `pnpm`; defaults to `npm` if omitted.
135
+
98
136
## Source and releases
99
137
100
138
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.
0 commit comments