Skip to content

Commit 9adf7da

Browse files
authored
[Feature] Documentation on the --config flag when using init (#287)
* [Feature] Documentation on the `--config` flag when using `ploomber-cloud init` * fix: typo * [Feature] Documentation on `--config` sub dir in `swtiching the config file section * chore: wrong rendering of `warning` * chore: simple `Refer to this section` to configure project * Update doc/user-guide/cli.md
1 parent b908ee8 commit 9adf7da

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

doc/user-guide/cli.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ ploomber-cloud deploy --watch-incremental
5353

5454
When deploying from the terminal, it's recommended to use the `--watch` option. This flag clears the terminal before printing updated logs, ensuring a clean display. Alternatively, if you're storing deployment output in a file, such as with GitHub Actions, opt for `--watch-incremental`. This option skips clearing the screen and only prints new logs and status updates.
5555

56+
57+
(config)=
5658
## Configure an existing project
5759

58-
If you want to deploy an existing project, run the `init` command with the `--from-existing` flag:
60+
If you want to deploy an existing project, run the `init` command with the `--from-existing` flag to download this one:
5961

6062
```sh
6163
ploomber-cloud init --from-existing
@@ -88,6 +90,14 @@ Then, execute:
8890
ploomber-cloud deploy
8991
```
9092

93+
**Optional Configuration**:
94+
You can use the `--config` flag with the `ploomber-cloud init --from-existing` command to specify a custom name for the configuration file instead of the default `ploomber-cloud.json`. When using this flag for downloading your project, only the file name will be considered, regardless of any specified path. For example:
95+
```sh
96+
ploomber-cloud init --from-existing --config ./specific-path/custom-config.json
97+
```
98+
99+
This will create a configuration file named `custom-config.json` in the root of the downloaded project directory.
100+
91101
## Download Configuration Only
92102
If you want to download only the configuration file without the project code, use the --only-config flag:
93103

@@ -97,6 +107,14 @@ ploomber-cloud init --from-existing --only-config
97107

98108
This will generate only the ploomber-cloud.json file in your current directory, without creating a new project directory or downloading the project files.
99109

110+
111+
**Optional Configuration**:
112+
You can use the `--config` flag in combination with `--only-config` to specify a custom name and location for the configuration file:
113+
```sh
114+
ploomber-cloud init --from-existing --only-config --config path/to/custom-config.json
115+
```
116+
This allows you to choose a different name for the configuration file and the specify a different location to save the file.
117+
100118
## Force initialize an app
101119

102120
You might want to re-initialize your project in case the `ploomber-cloud.json` file has got corrupted or doesn't contain the valid keys.
@@ -428,7 +446,7 @@ ploomber-cloud labels --sync
428446

429447
By default, the CLI reads and writes to a `ploomber-cloud.json` file, but you can customize it via the `--config` (or its short version, `-c`), switching the config file is useful when you need to manage multiple environments (for example, development and production).
430448

431-
All commands that read or write the config file accept the `--config/-c` argument, for example:
449+
All commands that read or write the config file accept the `--config/-c` argument. You can use this option to specify both alternative file names and paths, for example:
432450

433451
```sh
434452
# create the config file in ploomber-cloud.dev.json
@@ -437,3 +455,5 @@ ploomber-cloud init --config ploomber-cloud.dev.json
437455
# deploy using the dev config
438456
ploomber-cloud deploy --config ploomber-cloud.dev.json
439457
```
458+
459+
For more details on configuring projects, refer to [this section](config).

0 commit comments

Comments
 (0)