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
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"""Textual-based deployment forms for CLI interactions"""
|
|
2
2
|
|
|
3
3
|
from llama_deploy.cli.env import load_env_secrets_from_string
|
|
4
|
-
|
|
5
4
|
from textual.app import ComposeResult
|
|
6
5
|
from textual.containers import HorizontalGroup, Widget
|
|
7
|
-
from textual.widgets import Button, Input, Label, Static, TextArea
|
|
8
6
|
from textual.reactive import reactive
|
|
7
|
+
from textual.widgets import Button, Input, Label, Static, TextArea
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class SecretsWidget(Widget):
|
|
@@ -62,25 +61,34 @@ class SecretsWidget(Widget):
|
|
|
62
61
|
"""
|
|
63
62
|
secrets = reactive({}, recompose=True) # Auto-recompose when secrets change
|
|
64
63
|
prior_secrets = reactive(set(), recompose=True)
|
|
65
|
-
visible_secrets = reactive(
|
|
66
|
-
set(), recompose=True
|
|
67
|
-
) # Auto-recompose when visible secrets change
|
|
64
|
+
visible_secrets = reactive(set(), recompose=True)
|
|
68
65
|
|
|
69
66
|
def __init__(
|
|
70
67
|
self,
|
|
71
68
|
initial_secrets: dict[str, str] | None = None,
|
|
72
69
|
prior_secrets: set[str] | None = None,
|
|
70
|
+
info_message: str | None = None,
|
|
73
71
|
):
|
|
74
72
|
super().__init__()
|
|
75
73
|
self.secrets = initial_secrets or {}
|
|
76
74
|
self.prior_secrets = prior_secrets or set()
|
|
77
75
|
self.visible_secrets = set()
|
|
76
|
+
# Persist textarea content across recomposes triggered by other actions
|
|
77
|
+
self._new_secrets_text = ""
|
|
78
|
+
self.info_message = info_message
|
|
78
79
|
|
|
79
80
|
def compose(self) -> ComposeResult:
|
|
80
81
|
"""Compose the secrets section - called automatically when secrets change"""
|
|
81
|
-
yield Static("
|
|
82
|
-
|
|
82
|
+
yield Static("Secrets", classes="secrets-header")
|
|
83
|
+
# Preserve deterministic order: known secrets in insertion order, then prior-only sorted
|
|
84
|
+
known_secret_names = list(self.secrets.keys())
|
|
85
|
+
prior_only_secret_names = sorted(
|
|
86
|
+
[name for name in self.prior_secrets if name not in self.secrets]
|
|
87
|
+
)
|
|
88
|
+
secret_names = known_secret_names + prior_only_secret_names
|
|
83
89
|
hidden = len(secret_names) == 0
|
|
90
|
+
if self.info_message:
|
|
91
|
+
yield Static(self.info_message, classes="secondary-message mb-1")
|
|
84
92
|
with Static(
|
|
85
93
|
classes="secrets-grid" + (" hidden" if hidden else ""),
|
|
86
94
|
id="secrets-grid",
|
|
@@ -108,9 +116,15 @@ class SecretsWidget(Widget):
|
|
|
108
116
|
compact=True,
|
|
109
117
|
)
|
|
110
118
|
|
|
119
|
+
# Short help text for textarea format
|
|
120
|
+
yield Static(
|
|
121
|
+
"Format: one per line, KEY=VALUE",
|
|
122
|
+
classes="secret-label",
|
|
123
|
+
)
|
|
124
|
+
|
|
111
125
|
with HorizontalGroup(classes="text-container"):
|
|
112
126
|
yield TextArea(
|
|
113
|
-
|
|
127
|
+
self._new_secrets_text,
|
|
114
128
|
id="new_secrets",
|
|
115
129
|
show_line_numbers=True,
|
|
116
130
|
highlight_cursor_line=True,
|
|
@@ -154,6 +168,7 @@ class SecretsWidget(Widget):
|
|
|
154
168
|
|
|
155
169
|
# Clear textarea
|
|
156
170
|
textarea.text = ""
|
|
171
|
+
self._new_secrets_text = ""
|
|
157
172
|
|
|
158
173
|
def _toggle_secret_visibility(self, secret_name: str) -> None:
|
|
159
174
|
"""Toggle the visibility of a secret"""
|
|
@@ -175,6 +190,11 @@ class SecretsWidget(Widget):
|
|
|
175
190
|
updated_prior_secrets.remove(secret_name)
|
|
176
191
|
self.prior_secrets = updated_prior_secrets
|
|
177
192
|
|
|
193
|
+
def on_text_area_changed(self, event: TextArea.Changed) -> None:
|
|
194
|
+
"""Track textarea edits so content persists across recomposes."""
|
|
195
|
+
text = event.text_area.text
|
|
196
|
+
self._new_secrets_text = text
|
|
197
|
+
|
|
178
198
|
def get_updated_secrets(self) -> dict[str, str]:
|
|
179
199
|
"""Get current secrets with values from input fields"""
|
|
180
200
|
self._add_secrets_from_textarea()
|
|
@@ -30,6 +30,10 @@ Container {
|
|
|
30
30
|
height: auto;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
.two-column-form-grid .full-width {
|
|
34
|
+
column-span: 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
33
37
|
/* =============================================== */
|
|
34
38
|
/* FORM ELEMENTS */
|
|
35
39
|
/* =============================================== */
|
|
@@ -72,6 +76,13 @@ Input.disabled {
|
|
|
72
76
|
margin-top: 2;
|
|
73
77
|
}
|
|
74
78
|
|
|
79
|
+
.m-1 {
|
|
80
|
+
margin: 1;
|
|
81
|
+
}
|
|
82
|
+
.m-2 {
|
|
83
|
+
margin: 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
75
86
|
.text-error {
|
|
76
87
|
color: $error;
|
|
77
88
|
}
|
|
@@ -95,32 +106,35 @@ Input.disabled {
|
|
|
95
106
|
color: $text-error;
|
|
96
107
|
background: $error-muted;
|
|
97
108
|
border-left: heavy $error;
|
|
98
|
-
|
|
99
|
-
padding: 0 0 0 1
|
|
109
|
+
padding: 0 0 0 1;
|
|
100
110
|
}
|
|
101
111
|
|
|
102
112
|
.primary-message {
|
|
103
113
|
color: $text-primary;
|
|
104
114
|
background: $primary-muted;
|
|
105
115
|
border-left: heavy $primary;
|
|
106
|
-
|
|
107
|
-
padding: 0 0 0 1
|
|
116
|
+
padding: 0 0 0 1;
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
.secondary-message {
|
|
111
120
|
color: $text-secondary;
|
|
112
121
|
background: $secondary-muted;
|
|
113
122
|
border-left: heavy $secondary;
|
|
114
|
-
|
|
115
|
-
padding: 0 0 0 1
|
|
123
|
+
padding: 0 0 0 1;
|
|
116
124
|
}
|
|
117
125
|
|
|
118
126
|
.success-message {
|
|
119
127
|
color: $text-success;
|
|
120
128
|
background: $success-muted;
|
|
121
129
|
border-left: heavy $success;
|
|
122
|
-
padding: 1;
|
|
123
|
-
|
|
130
|
+
padding: 0 0 0 1;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.warning-message {
|
|
134
|
+
color: $text-warning;
|
|
135
|
+
background: $warning-muted;
|
|
136
|
+
border-left: heavy $warning;
|
|
137
|
+
padding: 0 0 0 1;
|
|
124
138
|
}
|
|
125
139
|
|
|
126
140
|
.hidden {
|
|
@@ -138,6 +152,14 @@ Input.disabled {
|
|
|
138
152
|
layout: vertical;
|
|
139
153
|
}
|
|
140
154
|
|
|
155
|
+
.flex-1 {
|
|
156
|
+
width: 1fr;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.align-right {
|
|
160
|
+
align: right middle;
|
|
161
|
+
}
|
|
162
|
+
|
|
141
163
|
/* =============================================== */
|
|
142
164
|
/* BUTTONS & ACTIONS */
|
|
143
165
|
/* =============================================== */
|
|
@@ -160,3 +182,22 @@ Button.secondary {
|
|
|
160
182
|
}
|
|
161
183
|
|
|
162
184
|
|
|
185
|
+
/* Centered button row for help back button */
|
|
186
|
+
.centered-button-row {
|
|
187
|
+
align: center middle;
|
|
188
|
+
margin-top: 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Link-styled button */
|
|
192
|
+
.link-button {
|
|
193
|
+
background: transparent;
|
|
194
|
+
color: $accent;
|
|
195
|
+
text-style: underline;
|
|
196
|
+
border: none;
|
|
197
|
+
padding: 0 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.info-message {
|
|
201
|
+
align: left middle;
|
|
202
|
+
}
|
|
203
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Dict
|
|
4
|
+
|
|
5
|
+
from llama_deploy.cli.config.schema import Auth
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def env_vars_from_profile(profile: Auth) -> Dict[str, str]:
|
|
9
|
+
"""Return env var values derived strictly from the given profile.
|
|
10
|
+
|
|
11
|
+
Produces the three keys expected by CLI commands:
|
|
12
|
+
- LLAMA_CLOUD_API_KEY
|
|
13
|
+
- LLAMA_CLOUD_BASE_URL
|
|
14
|
+
- LLAMA_DEPLOY_PROJECT_ID
|
|
15
|
+
"""
|
|
16
|
+
values: Dict[str, str] = {}
|
|
17
|
+
if profile.api_key:
|
|
18
|
+
values["LLAMA_CLOUD_API_KEY"] = profile.api_key
|
|
19
|
+
if profile.api_url:
|
|
20
|
+
values["LLAMA_CLOUD_BASE_URL"] = profile.api_url
|
|
21
|
+
if profile.project_id:
|
|
22
|
+
values["LLAMA_DEPLOY_PROJECT_ID"] = profile.project_id
|
|
23
|
+
return values
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: llamactl
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: A command-line interface for managing LlamaDeploy projects and deployments
|
|
5
5
|
Author: Adrian Lyjak
|
|
6
6
|
Author-email: Adrian Lyjak <adrianlyjak@gmail.com>
|
|
7
7
|
License: MIT
|
|
8
|
-
Requires-Dist: llama-deploy-core>=0.
|
|
9
|
-
Requires-Dist: llama-deploy-appserver>=0.
|
|
10
|
-
Requires-Dist: httpx>=0.24.0
|
|
8
|
+
Requires-Dist: llama-deploy-core[client]>=0.3.0,<0.4.0
|
|
9
|
+
Requires-Dist: llama-deploy-appserver>=0.3.0,<0.4.0
|
|
10
|
+
Requires-Dist: httpx>=0.24.0,<1.0.0
|
|
11
11
|
Requires-Dist: rich>=13.0.0
|
|
12
12
|
Requires-Dist: questionary>=2.0.0
|
|
13
13
|
Requires-Dist: click>=8.2.1
|
|
14
14
|
Requires-Dist: python-dotenv>=1.0.0
|
|
15
15
|
Requires-Dist: tenacity>=9.1.2
|
|
16
|
-
Requires-Dist: textual>=
|
|
16
|
+
Requires-Dist: textual>=6.0.0
|
|
17
17
|
Requires-Dist: aiohttp>=3.12.14
|
|
18
|
-
Requires-
|
|
18
|
+
Requires-Dist: copier>=9.9.0
|
|
19
|
+
Requires-Dist: pyjwt[crypto]>=2.10.1
|
|
20
|
+
Requires-Dist: vibe-llama>=0.4.2,<0.5.0
|
|
21
|
+
Requires-Python: >=3.11, <4
|
|
19
22
|
Description-Content-Type: text/markdown
|
|
20
23
|
|
|
21
24
|
# llamactl
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
llama_deploy/cli/__init__.py,sha256=df028686233c4d5a3e244bb50c1c7b84cf2399ae03abe45eb4d01e53caa1be38,476
|
|
2
|
+
llama_deploy/cli/app.py,sha256=9170e4f506c482522bd745eb1cdb700a198cfcfd7204c168c94e5ee2b6b43ffa,2199
|
|
3
|
+
llama_deploy/cli/auth/client.py,sha256=0673e2fdc71e8cf1f6d79a64e39596e608dc0257b7dddfebcc38e13e1545a2a8,11670
|
|
4
|
+
llama_deploy/cli/client.py,sha256=f4053b5183224cff55c1393e78887d1af2597219135379a851b742c676adc154,1727
|
|
5
|
+
llama_deploy/cli/commands/aliased_group.py,sha256=bc41007c97b7b93981217dbd4d4591df2b6c9412a2d9ed045b0ec5655ed285f2,1066
|
|
6
|
+
llama_deploy/cli/commands/auth.py,sha256=1381eee494c3a0c73253322b4a54af1a857d5b89e5f1685b8afa3422eecc5607,23937
|
|
7
|
+
llama_deploy/cli/commands/deployment.py,sha256=46339e09135521c46ff90235ccf765c37b1a161cec11d92e92a54ceac6528b01,9883
|
|
8
|
+
llama_deploy/cli/commands/env.py,sha256=36cb1b0abb9e3d1c5546d3e8a3c4c7839c4d6c2abf75763e39efb08376b3eae9,6808
|
|
9
|
+
llama_deploy/cli/commands/init.py,sha256=46f9fcdc43880edbd2f244b4c80d5cc5d387a6f8d7407c182f5995c46e41c851,10153
|
|
10
|
+
llama_deploy/cli/commands/serve.py,sha256=309b416bfc0b527cd8c8e041beb36b64e78342545f767af7fde3bc55dbbce961,8448
|
|
11
|
+
llama_deploy/cli/config/_config.py,sha256=654a4b6d06542e3503edab7023fc1c3148de510b3e3f6194e28cd4bd3e7c029a,14230
|
|
12
|
+
llama_deploy/cli/config/_migrations.py,sha256=37055641970e1ea41abc583f270dc8a9dab03076224a02cd5fb08bbab2b9259f,2333
|
|
13
|
+
llama_deploy/cli/config/auth_service.py,sha256=8a61110e18c752bbec5fbca23cd5d35d4ec232a4371f8c8291ba07ad83d30c6c,5208
|
|
14
|
+
llama_deploy/cli/config/env_service.py,sha256=cd51a68f1e9aad0bdd49cd76351cd54cea612a7f669512484c42e2876fea0458,2650
|
|
15
|
+
llama_deploy/cli/config/migrations/0001_init.sql,sha256=aaffcb1fd0a00398ecf0af2d98ae26479c91519ec938efa99270f2d98dfdd1f4,1091
|
|
16
|
+
llama_deploy/cli/config/migrations/0002_add_auth_fields.sql,sha256=31bd109e5fa0a9ad563a205b4c0e8110db4df3b4b3956704a0c0cdf345002daa,724
|
|
17
|
+
llama_deploy/cli/config/migrations/__init__.py,sha256=a092bdd1eba7041e69db0a9594941821a6337018f90d7e231d651195a9db0a69,151
|
|
18
|
+
llama_deploy/cli/config/schema.py,sha256=bd7b68eacd8a242c7f6fbccd176970425eeed504f593838d228a73ea75d73770,1542
|
|
19
|
+
llama_deploy/cli/debug.py,sha256=e85a72d473bbe1645eb31772f7349bde703d45704166f767385895c440afc762,496
|
|
20
|
+
llama_deploy/cli/env.py,sha256=d4b83c1f12e07f90893fcc7388d769de37dc2b41d345eb6bc2041c39b4fb2c31,1057
|
|
21
|
+
llama_deploy/cli/interactive_prompts/session_utils.py,sha256=b996f2eddf70d6c49636c4797d246d212fce0950fe7e9a3f59cf6a1bf7ae26f5,1142
|
|
22
|
+
llama_deploy/cli/interactive_prompts/utils.py,sha256=594cc2a242cc3405d66d0e26a60647496cc5fcb4ce7d0500a4cfec4888c9a0fa,516
|
|
23
|
+
llama_deploy/cli/options.py,sha256=62ee7286c3305ddb4b597783d19e854284d79bf9384800045f15b934dc245c1d,1298
|
|
24
|
+
llama_deploy/cli/py.typed,sha256=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,0
|
|
25
|
+
llama_deploy/cli/styles.py,sha256=15901fb567b0d10470f56a06d863819c4ed00a9f90b2a8c46b4bc2fb1dbdf6c3,307
|
|
26
|
+
llama_deploy/cli/textual/deployment_form.py,sha256=61ff18bceaba810b40d68aac104969b92870316a7025ba839242c1e0b6bde397,23677
|
|
27
|
+
llama_deploy/cli/textual/deployment_help.py,sha256=91094f9c460421bae75bc705c02c64a9ec464a7e92dd2eb5de365cfd5b08a9a7,2463
|
|
28
|
+
llama_deploy/cli/textual/deployment_monitor.py,sha256=86b2545eeee9ef4ff9c8bec0ee5c8eefd54373d2200da5906a886fb614e763cd,16723
|
|
29
|
+
llama_deploy/cli/textual/git_validation.py,sha256=94c95b61d0cbc490566a406b4886c9c12e1d1793dc14038a5be37119223c9568,13419
|
|
30
|
+
llama_deploy/cli/textual/github_callback_server.py,sha256=3111cc45b3ff2632255a37e4472c85084670c94bcea25ec428f06b0761dd27bf,7584
|
|
31
|
+
llama_deploy/cli/textual/llama_loader.py,sha256=33cb32a46dd40bcf889c553e44f2672c410e26bd1d4b17aa6cca6d0a5d59c2c4,1468
|
|
32
|
+
llama_deploy/cli/textual/secrets_form.py,sha256=df6699de29d2bc2cbcaddd41ad2495ce0e622cdccaadbc8369a6ee09a9e79d34,7251
|
|
33
|
+
llama_deploy/cli/textual/styles.tcss,sha256=c8fa0eec00a97fa6907d223faaad82c6add1ea3f60009f1630be19282ea77e3b,3271
|
|
34
|
+
llama_deploy/cli/utils/env_inject.py,sha256=01911758bcc3cf22aad0db0d1ade56aece48d6ad6bdb7186ea213337c67f5a89,688
|
|
35
|
+
llamactl-0.3.0.dist-info/WHEEL,sha256=66530aef82d5020ef5af27ae0123c71abb9261377c5bc519376c671346b12918,79
|
|
36
|
+
llamactl-0.3.0.dist-info/entry_points.txt,sha256=b67e1eb64305058751a651a80f2d2268b5f7046732268421e796f64d4697f83c,52
|
|
37
|
+
llamactl-0.3.0.dist-info/METADATA,sha256=d0e36387e6908f030aa7c5e237e7983018ab9fd9d8f8f5ff036b6b071fd1d6f9,3252
|
|
38
|
+
llamactl-0.3.0.dist-info/RECORD,,
|