@dotcms/dotcli 24.3.1 → 24.3.8-SANPSHOT

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,7 +21,7 @@ npm install -g @dotcms/cli
21
21
  java -jar dotcli.jar
22
22
  ```
23
23
 
24
- 2. Configure the dotCMS instances you want to connect to using a dot-service.yml file. More details on how to do it [on this section](## CLI Instance Configuration). Make sure you make a site active in the yml file, otherwise you will have to active one using the [`instance` command](## Available Commands)
24
+ 2. Configure the dotCMS instances you want to connect to using the `config` command. More details on how to do it on the [Configuration](#Configuration) section.
25
25
 
26
26
  3. Log in to the selected instance
27
27
  ```shell script
@@ -34,6 +34,7 @@ java -jar dotcli.jar login --user={USER} --password
34
34
 
35
35
  | Command | Description |
36
36
  |--------------------------------------------|-------------------------------------------------------------------------------------|
37
+ | [config](cli/docs/config.adoc) | Sets the initial configuration required by all commands to operate |
37
38
  | [content-type](cli/docs/content-type.adoc) | Performs operations over content types. For example: pull, push, remove |
38
39
  | [files](cli/docs/files.adoc) | Performs operations over files. For example: tree, ls, push |
39
40
  | [instance](cli/docs/instance.adoc) | Prints a list of available dotCMS instances |
@@ -51,7 +52,21 @@ You can find more details about how to use the dotCMS CLI in the [Examples](#exa
51
52
 
52
53
  ## Examples
53
54
 
54
- 1. Log in with an admin user
55
+ 1. Run Configuration command to set the initial configuration required by all commands to operate
56
+ ```shell script
57
+ config
58
+ Enter the key/name that will serve to identify the dotCMS instance (must be unique) [local].
59
+ The name is [local]
60
+ Enter the dotCMS base URL (must be a valid URL starting protocol http or https) [http://localhost:8080]
61
+ The URL is [http://localhost:8080]
62
+ Are these values OK? (Enter to confirm or N to cancel) (Y/n)
63
+ ...
64
+ Do you want to continue adding another dotCMS instance? (Y/n)n
65
+ 0. Profile [local], Uri [http://localhost:8080], active [no].
66
+ 1. Profile [local#1], Uri [https://demo.dotcms.com], active [no].
67
+ One of these profiles needs to be made the current active one. Please select the number of the profile you want to activate. 1
68
+ ```
69
+ 2. Log in with an admin user
55
70
  ```shell script
56
71
  login --user=admin@dotCMS.com --password
57
72
  ```
@@ -193,39 +208,36 @@ Example:
193
208
  ../mvnw quarkus:dev -Dquarkus.log.file.path=/Users/my-user/CLI/dotcms-cli.log
194
209
  ```
195
210
 
196
- ## CLI Instance Configuration
211
+ ## Configuration
197
212
 
198
213
  The CLI can be used to manage multiple dotCMS instances. Each instance profile is defined in the `~/.dotcms/dot-service.yml` file.
199
- Whatever profile is active will be used by the CLI to execute the commands.
214
+ Whatever profile is active will be used by the CLI to execute the commands on
200
215
  The selected profile can be obtained by running the `status` command.
201
216
  Here's an example of the default `dot-service.yml` file shipped with the CLI:
202
217
 
203
218
  ```yaml
204
219
  - name: "default"
220
+ url: "http://localhost:8080"
205
221
  credentials:
206
222
  user: "admin@dotcms.com"
207
223
  - name: "demo"
224
+ url: "https://demo.dotcms.com"
208
225
  active: true
209
226
  credentials:
210
227
  user: "admin@dotCMS.com"
211
228
  ```
212
229
 
213
- The profiles declared on this file are paired up with properties defined in an internal `application.properties` file.
214
-
215
- ```properties
216
- # Your configuration properties
217
- dotcms.client.servers.default=http://localhost:8080/api
218
- dotcms.client.servers.demo=https://demo.dotcms.com/api
219
- ```
220
-
221
- Notice how the `dotcms.client.servers` property has a suffix matching the profile name in the `dot-service.yml` file.
230
+ Therefore, in order to add a new instance profile, you need to add a new entry in the `dot-service.yml` as it is shown on the example above.
231
+ The `active` attribute indicates which profile is currently active. The CLI will use the active profile to execute the commands.
232
+ If more than one profile is marked active, this will result in an InvalidStateException.
233
+ The `credentials` section is optional. If the credentials are not provided, the CLI will prompt the user to enter them when the `login` command is executed.
222
234
 
223
- Therefore, in order to add a new instance profile, you need to add a new entry in the `dot-service.yml` file and a new property extending the `application.properties` file.
224
- Application properties can be extended via system properties, environment variables, `.env` file or in `$PWD/config/application.properties` file.
235
+ If the `dot-service.yml` file does not exist, the CLI will prompt to create one No commands can operate without having a valid configuration in place.
225
236
 
226
- To learn more about how to extend the `application.properties` file see the Quarkus configuration guide [Here](https://es.quarkus.io/guides/config-reference#application-properties-file)
237
+ The CLI provides a `config` command to set the initial configuration required by all commands to operate. The command will guide you through the process of adding a new instance profile to the `dot-service.yml` file. and setting the active profile.
238
+ See the [Configuration](cli/docs/config.adoc) section for more details. And the [Examples](#examples) section for a practical example.
227
239
 
228
- In future versions this process will be facilitated by the CLI itself.
240
+ ```shell script
229
241
 
230
242
  ### Workspace
231
243
 
@@ -253,7 +265,7 @@ In order to incorporate the CLI into your GitHub Actions workflow, you need to:
253
265
  - In Your repository General Settings, enable the following permissions:
254
266
  - Workflow Permissions : Read and Write permissions
255
267
  - In Your repository General Settings, Secrets and variables, Actions
256
- - Create a new variable called `DOT_API_URL` and set the value to a valid dotCMS URL. e.g. `https://demo.dotcms.com/api`
268
+ - Create a new variable called `DOT_API_URL` and set the value to a valid dotCMS URL. e.g. `https://demo.dotcms.com`
257
269
  ![How to create a variable](doc_images/create_variable.png)
258
270
  - Create a new secret called `DOT_TOKEN` and set the value to a valid dotCMS CLI token.
259
271
  ![How to create a secret](doc_images/create_secret.png)
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@dotcms/dotcli",
3
- "version": "24.03.01",
3
+ "version": "24.03.08-SANPSHOT",
4
4
  "scripts": {
5
5
  "postinstall": "node src/postinstall.js install",
6
6
  "postuninstall": "node src/postinstall.js uninstall && npm prune"
7
7
  },
8
8
  "binaries": {
9
- "dotcms-cli-darwin-arm64": "bin/dotcms-cli-24.03.01-osx-aarch_64",
10
- "dotcms-cli-darwin-x64": "bin/dotcms-cli-24.03.01-osx-x86_64",
11
- "dotcms-cli-linux-x64": "bin/dotcms-cli-24.03.01-linux-x86_64"
9
+ "dotcms-cli-darwin-arm64": "bin/dotcms-cli-24.03.08-SANPSHOT-osx-aarch_64",
10
+ "dotcms-cli-darwin-x64": "bin/dotcms-cli-24.03.08-SANPSHOT-osx-x86_64",
11
+ "dotcms-cli-linux-x64": "bin/dotcms-cli-24.03.08-SANPSHOT-linux-x86_64"
12
12
  },
13
13
  "alias": "dotcli",
14
14
  "packageName": "dotcms-cli",