toolforge-components-cli 0.0.8__tar.gz → 0.0.9__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: toolforge-components-cli
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: Toolforge components client
5
5
  License: GPLv3
6
6
  Author: Slavina Stefanova
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "toolforge-components-cli"
3
- version = "0.0.8"
3
+ version = "0.0.9"
4
4
  description = "Toolforge components client"
5
5
  authors = ["Slavina Stefanova <sstefanova@wikimedia.org>"]
6
6
  license = "GPLv3"
@@ -205,6 +205,23 @@ def config_show(ctx, as_json: bool) -> None:
205
205
  _display_config(response.get("data", {}), as_json)
206
206
 
207
207
 
208
+ @config.command(
209
+ name="generate",
210
+ help="Generate an example tool configuration from the existing jobs if possible.",
211
+ )
212
+ @click.option(
213
+ "--json",
214
+ "as_json",
215
+ is_flag=True,
216
+ help="If set, will output in JSON format",
217
+ )
218
+ @click.pass_context
219
+ def config_generate(ctx, as_json: bool) -> None:
220
+ components_client = ctx.obj["components_client"]
221
+ response = components_client.get("/config/generate", display_messages=(not as_json))
222
+ _display_config(response.get("data", {}), as_json)
223
+
224
+
208
225
  @config.command(name="delete", help="Delete the tool's configuration.")
209
226
  @click.option(
210
227
  "--json",