qbraid-cli 0.16.18__tar.gz → 0.16.20__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.
- {qbraid_cli-0.16.18/qbraid_cli.egg-info → qbraid_cli-0.16.20}/PKG-INFO +4 -4
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/pyproject.toml +4 -4
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/configure/app.py +41 -8
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/devices/app.py +1 -1
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/app.py +812 -21
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/handlers.py +41 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/jobs/app.py +11 -1
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/skills/app.py +46 -5
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20/qbraid_cli.egg-info}/PKG-INFO +4 -4
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli.egg-info/SOURCES.txt +1 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli.egg-info/requires.txt +3 -3
- qbraid_cli-0.16.20/tests/test_status_colors.py +157 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/LICENSE +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/README.md +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/_build_info.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/_version.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/account/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/account/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/admin/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/admin/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/admin/headers.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/admin/validation.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/keep_alive.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/permission_response.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/provider_children.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/queue.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/agents/work.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/ai/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/ai/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/ai/token.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/artifacts/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/artifacts/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/comms/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/comms/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/compute/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/compute/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/compute/instances.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/compute/profiles.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/compute/server.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/compute/ssh.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/configure/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/configure/actions.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/devices/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/devices/validation.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/activate.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/create.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/data_handling.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/groups.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/publish.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/registry.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/envs/share.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/exceptions.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/jobs/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/jobs/groups.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/kernels/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/kernels/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/lab/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/lab/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/main.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/pip/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/pip/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/pip/hooks.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/projects/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/projects/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/skills/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/troubleshoot/__init__.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli/troubleshoot/app.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/setup.cfg +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/tests/test_cli_e2e.py +0 -0
- {qbraid_cli-0.16.18 → qbraid_cli-0.16.20}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.20
|
|
4
4
|
Summary: Command Line Interface for interacting with all parts of the qBraid platform.
|
|
5
5
|
Author-email: qBraid Development Team <contact@qbraid.com>
|
|
6
6
|
License-Expression: LicenseRef-Proprietary
|
|
@@ -30,11 +30,11 @@ Requires-Dist: typer>=0.12.1
|
|
|
30
30
|
Requires-Dist: rich>=10.11.0
|
|
31
31
|
Requires-Dist: click<=8.5.0
|
|
32
32
|
Requires-Dist: questionary>=2.0.0
|
|
33
|
-
Requires-Dist: qbraid-core>=0.6.
|
|
33
|
+
Requires-Dist: qbraid-core>=0.6.48
|
|
34
34
|
Provides-Extra: compute
|
|
35
|
-
Requires-Dist: qbraid-core[compute]>=0.6.
|
|
35
|
+
Requires-Dist: qbraid-core[compute]>=0.6.48; extra == "compute"
|
|
36
36
|
Provides-Extra: envs
|
|
37
|
-
Requires-Dist: qbraid-core[environments]>=0.6.
|
|
37
|
+
Requires-Dist: qbraid-core[environments]>=0.6.48; extra == "envs"
|
|
38
38
|
Provides-Extra: dev
|
|
39
39
|
Requires-Dist: isort; extra == "dev"
|
|
40
40
|
Requires-Dist: black; extra == "dev"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.16.
|
|
7
|
+
version = "0.16.20"
|
|
8
8
|
description = "Command Line Interface for interacting with all parts of the qBraid platform."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
|
|
@@ -32,7 +32,7 @@ dependencies = [
|
|
|
32
32
|
"rich>=10.11.0",
|
|
33
33
|
"click<=8.5.0",
|
|
34
34
|
"questionary>=2.0.0",
|
|
35
|
-
"qbraid-core>=0.6.
|
|
35
|
+
"qbraid-core>=0.6.48",
|
|
36
36
|
]
|
|
37
37
|
requires-python = ">= 3.10"
|
|
38
38
|
|
|
@@ -43,8 +43,8 @@ Documentation = "https://docs.qbraid.com/v2/cli/api-reference/qbraid"
|
|
|
43
43
|
Discord = "https://discord.gg/KugF6Cnncm"
|
|
44
44
|
|
|
45
45
|
[project.optional-dependencies]
|
|
46
|
-
compute = ["qbraid-core[compute]>=0.6.
|
|
47
|
-
envs = ["qbraid-core[environments]>=0.6.
|
|
46
|
+
compute = ["qbraid-core[compute]>=0.6.48"]
|
|
47
|
+
envs = ["qbraid-core[environments]>=0.6.48"]
|
|
48
48
|
dev = ["isort", "black", "pytest", "pytest-cov", "pytest-asyncio"]
|
|
49
49
|
|
|
50
50
|
[project.scripts]
|
|
@@ -12,6 +12,7 @@ from rich.console import Console
|
|
|
12
12
|
from rich.table import Table
|
|
13
13
|
|
|
14
14
|
from qbraid_cli.configure.actions import default_action
|
|
15
|
+
from qbraid_cli.handlers import require_tty
|
|
15
16
|
|
|
16
17
|
# disable pretty_exceptions_show_locals to avoid printing sensative information in the traceback
|
|
17
18
|
configure_app = typer.Typer(
|
|
@@ -26,6 +27,36 @@ configure_app = typer.Typer(
|
|
|
26
27
|
)
|
|
27
28
|
|
|
28
29
|
|
|
30
|
+
_SECRET_WORDS = ("token", "secret", "password", "passwd", "credential")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def is_secret_config_key(name: str) -> bool:
|
|
34
|
+
"""Whether a config key holds a secret.
|
|
35
|
+
|
|
36
|
+
api-key and named api-key-* keys, plus any key whose name contains token,
|
|
37
|
+
secret, password, passwd or credential. Config keys are case-insensitive
|
|
38
|
+
(configparser), so the check is too, and underscore or run-together
|
|
39
|
+
spellings (api_key, apikey, refresh_token, accesstoken) count.
|
|
40
|
+
"""
|
|
41
|
+
key = name.lower().replace("_", "-")
|
|
42
|
+
if key in ("api-key", "apikey") or key.startswith(("api-key-", "apikey-")):
|
|
43
|
+
return True
|
|
44
|
+
return any(word in key for word in _SECRET_WORDS)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def mask_config_value(name: str, value: str) -> str:
|
|
48
|
+
"""Return a config value for display.
|
|
49
|
+
|
|
50
|
+
Secrets are shown as `*****` plus their last three characters, or as `*****`
|
|
51
|
+
alone when they are shorter than 12 characters, so a short secret is not
|
|
52
|
+
mostly revealed.
|
|
53
|
+
"""
|
|
54
|
+
if value and is_secret_config_key(name):
|
|
55
|
+
text = str(value)
|
|
56
|
+
return f"*****{text[-3:]}" if len(text) >= 12 else "*****"
|
|
57
|
+
return str(value)
|
|
58
|
+
|
|
59
|
+
|
|
29
60
|
@configure_app.callback(invoke_without_command=True)
|
|
30
61
|
def configure(ctx: typer.Context):
|
|
31
62
|
"""
|
|
@@ -38,6 +69,12 @@ def configure(ctx: typer.Context):
|
|
|
38
69
|
|
|
39
70
|
"""
|
|
40
71
|
if ctx.invoked_subcommand is None:
|
|
72
|
+
require_tty(
|
|
73
|
+
"qbraid configure",
|
|
74
|
+
"interactive",
|
|
75
|
+
"Use 'qbraid configure set <name> <value>', or export QBRAID_API_KEY "
|
|
76
|
+
"to keep the key out of shell history.",
|
|
77
|
+
)
|
|
41
78
|
default_action()
|
|
42
79
|
|
|
43
80
|
|
|
@@ -66,6 +103,7 @@ def configure_set(
|
|
|
66
103
|
def configure_get(
|
|
67
104
|
name: str = typer.Argument(..., help="Config name"),
|
|
68
105
|
profile: str = typer.Option("default", "--profile", "-p", help="Profile name"),
|
|
106
|
+
show: bool = typer.Option(False, "--show", help="Print a secret (API key or token) unmasked."),
|
|
69
107
|
):
|
|
70
108
|
"""Get configuration value from qbraidrc file."""
|
|
71
109
|
# pylint: disable-next=import-outside-toplevel
|
|
@@ -81,7 +119,8 @@ def configure_get(
|
|
|
81
119
|
typer.echo(f"Configuration '{name}' not found in profile '{profile}'.")
|
|
82
120
|
raise typer.Exit(1)
|
|
83
121
|
|
|
84
|
-
|
|
122
|
+
value = config[profile][name]
|
|
123
|
+
typer.echo(value if show else mask_config_value(name, value))
|
|
85
124
|
|
|
86
125
|
|
|
87
126
|
@configure_app.command(name="list")
|
|
@@ -106,14 +145,8 @@ def configure_list():
|
|
|
106
145
|
table.add_column("Name", style="cyan")
|
|
107
146
|
table.add_column("Value", style="green")
|
|
108
147
|
|
|
109
|
-
sensitive_keys = {"api-key", "refresh-token"}
|
|
110
|
-
|
|
111
148
|
for name, value in config[profile].items():
|
|
112
|
-
|
|
113
|
-
masked_value = f"*****{str(value)[-3:]}"
|
|
114
|
-
else:
|
|
115
|
-
masked_value = str(value)
|
|
116
|
-
table.add_row(name, masked_value)
|
|
149
|
+
table.add_row(name, mask_config_value(name, value))
|
|
117
150
|
|
|
118
151
|
console.print(table)
|
|
119
152
|
|