llamactl 0.2.7a1__py3-none-any.whl → 0.3.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.
- llama_deploy/cli/__init__.py +9 -22
- llama_deploy/cli/app.py +69 -0
- llama_deploy/cli/auth/client.py +362 -0
- llama_deploy/cli/client.py +47 -170
- llama_deploy/cli/commands/aliased_group.py +33 -0
- llama_deploy/cli/commands/auth.py +696 -0
- llama_deploy/cli/commands/deployment.py +300 -0
- llama_deploy/cli/commands/env.py +211 -0
- llama_deploy/cli/commands/init.py +313 -0
- llama_deploy/cli/commands/serve.py +239 -0
- llama_deploy/cli/config/_config.py +390 -0
- llama_deploy/cli/config/_migrations.py +65 -0
- llama_deploy/cli/config/auth_service.py +130 -0
- llama_deploy/cli/config/env_service.py +67 -0
- llama_deploy/cli/config/migrations/0001_init.sql +35 -0
- llama_deploy/cli/config/migrations/0002_add_auth_fields.sql +24 -0
- llama_deploy/cli/config/migrations/__init__.py +7 -0
- llama_deploy/cli/config/schema.py +61 -0
- llama_deploy/cli/env.py +5 -3
- llama_deploy/cli/interactive_prompts/session_utils.py +37 -0
- llama_deploy/cli/interactive_prompts/utils.py +6 -72
- llama_deploy/cli/options.py +27 -5
- llama_deploy/cli/py.typed +0 -0
- llama_deploy/cli/styles.py +10 -0
- llama_deploy/cli/textual/deployment_form.py +263 -36
- llama_deploy/cli/textual/deployment_help.py +53 -0
- llama_deploy/cli/textual/deployment_monitor.py +466 -0
- llama_deploy/cli/textual/git_validation.py +20 -21
- llama_deploy/cli/textual/github_callback_server.py +17 -14
- llama_deploy/cli/textual/llama_loader.py +13 -1
- llama_deploy/cli/textual/secrets_form.py +28 -8
- llama_deploy/cli/textual/styles.tcss +49 -8
- llama_deploy/cli/utils/env_inject.py +23 -0
- {llamactl-0.2.7a1.dist-info → llamactl-0.3.0.dist-info}/METADATA +9 -6
- llamactl-0.3.0.dist-info/RECORD +38 -0
- {llamactl-0.2.7a1.dist-info → llamactl-0.3.0.dist-info}/WHEEL +1 -1
- llama_deploy/cli/commands.py +0 -549
- llama_deploy/cli/config.py +0 -173
- llama_deploy/cli/textual/profile_form.py +0 -171
- llamactl-0.2.7a1.dist-info/RECORD +0 -19
- {llamactl-0.2.7a1.dist-info → llamactl-0.3.0.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Fully lifted from https://click.palletsprojects.com/en/stable/extending-click/"""
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AliasedGroup(click.Group):
|
|
7
|
+
"""
|
|
8
|
+
Implements a subclass of Group that accepts a prefix for a command.
|
|
9
|
+
If there was a command called push, it would accept pus as an alias (so long as it was unique):
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def get_command(self, ctx: click.Context, cmd_name: str) -> click.Command | None:
|
|
13
|
+
rv = super().get_command(ctx, cmd_name)
|
|
14
|
+
|
|
15
|
+
if rv is not None:
|
|
16
|
+
return rv
|
|
17
|
+
|
|
18
|
+
matches = [x for x in self.list_commands(ctx) if x.startswith(cmd_name)]
|
|
19
|
+
|
|
20
|
+
if not matches:
|
|
21
|
+
return None
|
|
22
|
+
|
|
23
|
+
if len(matches) == 1:
|
|
24
|
+
return click.Group.get_command(self, ctx, matches[0])
|
|
25
|
+
|
|
26
|
+
ctx.fail(f"Too many matches: {', '.join(sorted(matches))}")
|
|
27
|
+
|
|
28
|
+
def resolve_command(
|
|
29
|
+
self, ctx: click.Context, args: list[str]
|
|
30
|
+
) -> tuple[str, click.Command, list[str]]:
|
|
31
|
+
# always return the full command name
|
|
32
|
+
_, cmd, args = super().resolve_command(ctx, args)
|
|
33
|
+
return cmd.name, cmd, args
|