sweatstack-cli 0.8.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

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,3 +1,3 @@
1
1
  """SweatStack CLI — Command-line interface for the SweatStack platform."""
2
2
 
3
- __version__ = "0.8.0"
3
+ __version__ = "0.9.0"
@@ -17,9 +17,14 @@ from sweatstack_cli.project import CONFIG_FILENAME, write_config
17
17
  app = typer.Typer(name="app", help="Manage OAuth2 applications.")
18
18
 
19
19
 
20
+ def _is_interactive() -> bool:
21
+ """Check if stdin is a TTY (interactive terminal)."""
22
+ return sys.stdin.isatty()
23
+
24
+
20
25
  @app.command()
21
26
  def create(
22
- name: str = typer.Argument(..., help="Application name."),
27
+ name: str | None = typer.Argument(None, help="Application name."),
23
28
  description: str | None = typer.Option(
24
29
  None,
25
30
  "--description",
@@ -59,6 +64,32 @@ def create(
59
64
  console.print("[red]Error:[/red] --env and --env-file are mutually exclusive.")
60
65
  raise typer.Exit(1)
61
66
 
67
+ interactive = _is_interactive()
68
+
69
+ # Resolve name
70
+ if name is None:
71
+ if not interactive:
72
+ console.print("[red]Error:[/red] App name is required.")
73
+ raise typer.Exit(1)
74
+ name = typer.prompt("App name")
75
+
76
+ # Prompt for optional fields in interactive mode
77
+ if interactive:
78
+ if description is None:
79
+ description = typer.prompt(
80
+ "Description (optional)", default="", show_default=False
81
+ )
82
+ if not description:
83
+ description = None
84
+ if page is None:
85
+ page = typer.prompt(
86
+ "Page slug (optional)", default="", show_default=False
87
+ )
88
+ if not page:
89
+ page = None
90
+ if not secret:
91
+ secret = typer.confirm("Generate client secret?", default=False)
92
+
62
93
  body: dict[str, str | bool] = {"name": name}
63
94
 
64
95
  if description:
@@ -90,7 +121,7 @@ def create(
90
121
  # Write sweatstack.toml (protect existing file)
91
122
  config_path = Path(CONFIG_FILENAME)
92
123
  if config_path.exists():
93
- if not sys.stdin.isatty():
124
+ if not interactive:
94
125
  console.print(
95
126
  f"[red]Error:[/red] {CONFIG_FILENAME} already exists. "
96
127
  "Remove it first or run interactively."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sweatstack-cli
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Command-line interface for SweatStack — the sports data platform for developers
5
5
  Project-URL: Homepage, https://sweatstack.no
6
6
  Project-URL: Documentation, https://docs.sweatstack.no
@@ -88,7 +88,7 @@ sweatstack page deploy
88
88
 
89
89
  | Command | Description |
90
90
  |---------|-------------|
91
- | `sweatstack app create NAME` | Create a new private OAuth2 application |
91
+ | `sweatstack app create [NAME]` | Create a new private OAuth2 application |
92
92
  | `sweatstack app link` | Link current directory to an existing application |
93
93
 
94
94
  #### `app create` options
@@ -1,4 +1,4 @@
1
- sweatstack_cli/__init__.py,sha256=PrOyFimElYJM3lDfkHlz_9FFLf3CN85a82pavfqBUgo,100
1
+ sweatstack_cli/__init__.py,sha256=gqp4cHVRfTQZSb9iCu508gC8SFLnocm0gOfZLzXV934,100
2
2
  sweatstack_cli/config.py,sha256=cD4OXnVAKVagYazyk9Cw-WWx62tJPqcjQt1cknYyymM,706
3
3
  sweatstack_cli/console.py,sha256=69KWAM7ksnYRTONMYTXGXN4LWRAQhRxcLXO0LcWGLqo,300
4
4
  sweatstack_cli/exceptions.py,sha256=qEUu8GydXGRKR4ndAdZ2wnkHekmFpBXDJiT5bXdl7Yk,613
@@ -14,10 +14,10 @@ sweatstack_cli/auth/jwt.py,sha256=Ja6ccFyRKtX5MPjFdHNavVYf8KTz0MYT86StbnF-cwg,15
14
14
  sweatstack_cli/auth/pkce.py,sha256=sO_xUeN1UIvXKX0yEIGgMTIIzvfCOCUwlyNAveEd16k,1542
15
15
  sweatstack_cli/auth/tokens.py,sha256=kc8ytoO9PAyjLD6wUTIagVuP7_ia5ZjW5m_WjXIRIkA,4942
16
16
  sweatstack_cli/commands/__init__.py,sha256=YCO8wYVvdGeoEI0p_oUm8ANLneuET4SHsKDjitMjAgY,35
17
- sweatstack_cli/commands/app.py,sha256=dsGfNm2xPk1VV31RGD5N58LnG5__y902F2-o2uq5BeI,7552
17
+ sweatstack_cli/commands/app.py,sha256=3kTnXBCNqu77VwFa-TL4AMtTtDFqvZ68q2CYalzJL_Q,8517
18
18
  sweatstack_cli/commands/auth.py,sha256=lmlN2RcZIHdbZG-EEUVFwOSn6vPN-Ijgh_5E-cFQVtU,3478
19
19
  sweatstack_cli/commands/page.py,sha256=aiuKVYUBdV2AcAcDAISx8qzs0PKieXQKAoYq00fTDew,7470
20
- sweatstack_cli-0.8.0.dist-info/METADATA,sha256=XNNUhVP7eyRvhKCKEyk7eCNkIpZ-PDYjrEeWmTb8lZs,3672
21
- sweatstack_cli-0.8.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
22
- sweatstack_cli-0.8.0.dist-info/entry_points.txt,sha256=rnH0EV1U9CQlmKQcJ7RmxGpNRTa9J-YdiIJZDYrAXb4,56
23
- sweatstack_cli-0.8.0.dist-info/RECORD,,
20
+ sweatstack_cli-0.9.0.dist-info/METADATA,sha256=Y8EHoUGmIc4zTd87x-ZH7rziBQBmB7xMUjZyiTe98Fk,3674
21
+ sweatstack_cli-0.9.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
22
+ sweatstack_cli-0.9.0.dist-info/entry_points.txt,sha256=rnH0EV1U9CQlmKQcJ7RmxGpNRTa9J-YdiIJZDYrAXb4,56
23
+ sweatstack_cli-0.9.0.dist-info/RECORD,,