qbraid-cli 0.12.0a5__tar.gz → 0.12.1__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.12.0a5 → qbraid_cli-0.12.1}/LICENSE +1 -1
- {qbraid_cli-0.12.0a5/qbraid_cli.egg-info → qbraid_cli-0.12.1}/PKG-INFO +16 -24
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/README.md +10 -16
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/pyproject.toml +6 -7
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/_version.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/account/__init__.py +1 -1
- qbraid_cli-0.12.1/qbraid_cli/account/app.py +37 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/admin/__init__.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/admin/app.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/admin/headers.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/admin/validation.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/configure/__init__.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/configure/actions.py +3 -15
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/configure/app.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/configure/claude_config.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/devices/__init__.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/devices/app.py +64 -28
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/devices/validation.py +1 -10
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/envs/__init__.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/envs/activate.py +9 -11
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/envs/app.py +102 -83
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/envs/create.py +2 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/envs/data_handling.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/exceptions.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/handlers.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/jobs/__init__.py +1 -1
- qbraid_cli-0.12.1/qbraid_cli/jobs/app.py +169 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/kernels/__init__.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/kernels/app.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/main.py +2 -35
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/mcp/__init__.py +2 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/mcp/app.py +2 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/mcp/serve.py +2 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/pip/__init__.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/pip/app.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/pip/hooks.py +1 -1
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1/qbraid_cli.egg-info}/PKG-INFO +16 -24
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli.egg-info/SOURCES.txt +0 -6
- qbraid_cli-0.12.1/qbraid_cli.egg-info/requires.txt +17 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/tests/test_version.py +1 -1
- qbraid_cli-0.12.0a5/qbraid_cli/account/app.py +0 -67
- qbraid_cli-0.12.0a5/qbraid_cli/chat/__init__.py +0 -11
- qbraid_cli-0.12.0a5/qbraid_cli/chat/app.py +0 -76
- qbraid_cli-0.12.0a5/qbraid_cli/files/__init__.py +0 -11
- qbraid_cli-0.12.0a5/qbraid_cli/files/app.py +0 -139
- qbraid_cli-0.12.0a5/qbraid_cli/jobs/app.py +0 -193
- qbraid_cli-0.12.0a5/qbraid_cli/jobs/toggle_braket.py +0 -201
- qbraid_cli-0.12.0a5/qbraid_cli/jobs/validation.py +0 -94
- qbraid_cli-0.12.0a5/qbraid_cli.egg-info/requires.txt +0 -20
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/__init__.py +0 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli/py.typed +0 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli.egg-info/dependency_links.txt +0 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli.egg-info/entry_points.txt +0 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/qbraid_cli.egg-info/top_level.txt +0 -0
- {qbraid_cli-0.12.0a5 → qbraid_cli-0.12.1}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qbraid-cli
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.1
|
|
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
|
|
7
|
-
Project-URL: Homepage, https://docs.qbraid.com/cli/user-guide/overview
|
|
8
|
-
Project-URL: Documentation, https://docs.qbraid.com/cli/api-reference/qbraid
|
|
7
|
+
Project-URL: Homepage, https://docs.qbraid.com/v2/cli/user-guide/overview
|
|
8
|
+
Project-URL: Documentation, https://docs.qbraid.com/v2/cli/api-reference/qbraid
|
|
9
9
|
Project-URL: Bug Tracker, https://github.com/qBraid/community/issues
|
|
10
10
|
Project-URL: Discord, https://discord.gg/KugF6Cnncm
|
|
11
11
|
Keywords: qbraid,cli,quantum,cloud
|
|
@@ -30,13 +30,11 @@ License-File: LICENSE
|
|
|
30
30
|
Requires-Dist: typer>=0.12.1
|
|
31
31
|
Requires-Dist: rich>=10.11.0
|
|
32
32
|
Requires-Dist: click<=8.1.8
|
|
33
|
-
Requires-Dist: qbraid-core
|
|
34
|
-
Provides-Extra: jobs
|
|
35
|
-
Requires-Dist: amazon-braket-sdk>=1.48.1; extra == "jobs"
|
|
33
|
+
Requires-Dist: qbraid-core>=0.2.0
|
|
36
34
|
Provides-Extra: envs
|
|
37
|
-
Requires-Dist: qbraid-core[environments]>=0.2.
|
|
35
|
+
Requires-Dist: qbraid-core[environments]>=0.2.0; extra == "envs"
|
|
38
36
|
Provides-Extra: mcp
|
|
39
|
-
Requires-Dist: qbraid-core[mcp]>=0.2.
|
|
37
|
+
Requires-Dist: qbraid-core[mcp]>=0.2.0; extra == "mcp"
|
|
40
38
|
Provides-Extra: dev
|
|
41
39
|
Requires-Dist: isort; extra == "dev"
|
|
42
40
|
Requires-Dist: black; extra == "dev"
|
|
@@ -47,20 +45,16 @@ Dynamic: license-file
|
|
|
47
45
|
|
|
48
46
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
49
47
|
|
|
50
|
-
[](https://docs.qbraid.com/cli/user-guide/overview)
|
|
48
|
+
[](https://docs.qbraid.com/v2/cli/user-guide/overview)
|
|
51
49
|
[](https://pypi.org/project/qbraid-cli/)
|
|
52
50
|
[](https://pypi.org/project/qbraid-cli/)
|
|
53
|
-
[](https://pepy.tech/project/qbraid-cli)
|
|
54
51
|
[](https://github.com/qBraid/community/issues)
|
|
55
|
-
[](https://stackoverflow.com/questions/tagged/qbraid)
|
|
56
52
|
|
|
57
53
|
Command Line Interface for interacting with all parts of the qBraid platform.
|
|
58
54
|
|
|
59
|
-
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/lab/user-guide/overview) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/cli/user-guide/quantum-jobs), enabling direct, pre-configured access to QPUs from IonQ, Oxford Quantum Circuits, QuEra, Rigetti, and IQM, as well as on-demand simulators from qBraid, AWS, IonQ, QuEra, and NEC. See [pricing](https://docs.qbraid.com/home/pricing) for more.
|
|
60
|
-
|
|
61
55
|
*Resources*:
|
|
62
|
-
- [User Guide](https://docs.qbraid.com/cli/user-guide/overview)
|
|
63
|
-
- [API Reference](https://docs.qbraid.com/cli/api-reference/qbraid)
|
|
56
|
+
- [User Guide](https://docs.qbraid.com/v2/cli/user-guide/overview)
|
|
57
|
+
- [API Reference](https://docs.qbraid.com/v2/cli/api-reference/qbraid)
|
|
64
58
|
|
|
65
59
|
## Getting Started
|
|
66
60
|
|
|
@@ -69,7 +63,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
|
|
|
69
63
|
- [Launch qBraid Lab →](https://lab.qbraid.com/)
|
|
70
64
|
- [Make an account →](https://account.qbraid.com/)
|
|
71
65
|
|
|
72
|
-
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
|
|
66
|
+
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/v2/lab/user-guide/getting-started).
|
|
73
67
|
|
|
74
68
|
You can also install the qBraid-CLI from PyPI with:
|
|
75
69
|
|
|
@@ -77,7 +71,7 @@ You can also install the qBraid-CLI from PyPI with:
|
|
|
77
71
|
pip install qbraid-cli
|
|
78
72
|
```
|
|
79
73
|
|
|
80
|
-
To manage qBraid [environments](https://docs.qbraid.com/lab/user-guide/environments) using the CLI, you must also install the `envs` extra:
|
|
74
|
+
To manage qBraid [environments](https://docs.qbraid.com/v2/lab/user-guide/environments) using the CLI, you must also install the `envs` extra:
|
|
81
75
|
|
|
82
76
|
```bash
|
|
83
77
|
pip install 'qbraid-cli[envs]'
|
|
@@ -91,13 +85,13 @@ After installation, you must configure your account credentials to use the CLI l
|
|
|
91
85
|
[account.qbraid.com](https://account.qbraid.com/)
|
|
92
86
|
2. Copy your API Key token from the left side of
|
|
93
87
|
your [account page](https://account.qbraid.com/):
|
|
94
|
-
3. Save your API key from step 2 in local [configuration file](https://docs.qbraid.com/cli/user-guide/config-files) `~/.qbraid/qbraidrc` using:
|
|
88
|
+
3. Save your API key from step 2 in local [configuration file](https://docs.qbraid.com/v2/cli/user-guide/config-files) `~/.qbraid/qbraidrc` using:
|
|
95
89
|
|
|
96
90
|
```bash
|
|
97
91
|
$ qbraid configure
|
|
98
92
|
```
|
|
99
93
|
|
|
100
|
-
For more on API keys, see [documentation](https://docs.qbraid.com/home/account#api-keys).
|
|
94
|
+
For more on API keys, see [documentation](https://docs.qbraid.com/v2/home/account#api-keys).
|
|
101
95
|
|
|
102
96
|
## Basic Commands
|
|
103
97
|
|
|
@@ -119,7 +113,7 @@ $ qbraid
|
|
|
119
113
|
|
|
120
114
|
- Use 'qbraid --version' to see the current version.
|
|
121
115
|
|
|
122
|
-
Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
|
|
116
|
+
Reference Docs: https://docs.qbraid.com/v2/cli/api-reference/qbraid
|
|
123
117
|
```
|
|
124
118
|
|
|
125
119
|
A qBraid CLI command has the following structure:
|
|
@@ -162,10 +156,8 @@ Commands
|
|
|
162
156
|
admin CI/CD commands for qBraid maintainers.
|
|
163
157
|
configure Configure qBraid CLI options.
|
|
164
158
|
account Manage qBraid account.
|
|
165
|
-
chat Interact with qBraid AI chat service.
|
|
166
159
|
devices Manage qBraid quantum devices.
|
|
167
160
|
envs Manage qBraid environments.
|
|
168
|
-
files Manage qBraid cloud storage files.
|
|
169
161
|
jobs Manage qBraid quantum jobs.
|
|
170
162
|
kernels Manage qBraid kernels.
|
|
171
163
|
mcp MCP (Model Context Protocol) aggregator commands.
|
|
@@ -180,7 +172,7 @@ $ qbraid --version
|
|
|
180
172
|
|
|
181
173
|
## Magic Commands
|
|
182
174
|
|
|
183
|
-
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
175
|
+
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/v2/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
184
176
|
|
|
185
177
|
```bash
|
|
186
178
|
$ qbraid configure magic
|
|
@@ -195,5 +187,5 @@ In [1]: %load_ext qbraid_magic
|
|
|
195
187
|
Now you can continue to use the qBraid-CLI as normal from within your Jupyter notebook using the magic ``%`` operator, e.g.
|
|
196
188
|
|
|
197
189
|
```python
|
|
198
|
-
In [2]: %qbraid
|
|
190
|
+
In [2]: %qbraid jobs list
|
|
199
191
|
```
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
<img width="full" alt="qbraid_cli" src="https://qbraid-static.s3.amazonaws.com/logos/qbraid-cli-banner.png">
|
|
2
2
|
|
|
3
|
-
[](https://docs.qbraid.com/cli/user-guide/overview)
|
|
3
|
+
[](https://docs.qbraid.com/v2/cli/user-guide/overview)
|
|
4
4
|
[](https://pypi.org/project/qbraid-cli/)
|
|
5
5
|
[](https://pypi.org/project/qbraid-cli/)
|
|
6
|
-
[](https://pepy.tech/project/qbraid-cli)
|
|
7
6
|
[](https://github.com/qBraid/community/issues)
|
|
8
|
-
[](https://stackoverflow.com/questions/tagged/qbraid)
|
|
9
7
|
|
|
10
8
|
Command Line Interface for interacting with all parts of the qBraid platform.
|
|
11
9
|
|
|
12
|
-
The **qBraid CLI** is a versatile command-line interface tool designed for seamless interaction with qBraid cloud services and quantum software management tools. Initially exclusive to the [qBraid Lab](https://docs.qbraid.com/lab/user-guide/overview) platform, the CLI now supports local installations as well. This enhancement broadens access to features like [qBraid Quantum Jobs](https://docs.qbraid.com/cli/user-guide/quantum-jobs), enabling direct, pre-configured access to QPUs from IonQ, Oxford Quantum Circuits, QuEra, Rigetti, and IQM, as well as on-demand simulators from qBraid, AWS, IonQ, QuEra, and NEC. See [pricing](https://docs.qbraid.com/home/pricing) for more.
|
|
13
|
-
|
|
14
10
|
*Resources*:
|
|
15
|
-
- [User Guide](https://docs.qbraid.com/cli/user-guide/overview)
|
|
16
|
-
- [API Reference](https://docs.qbraid.com/cli/api-reference/qbraid)
|
|
11
|
+
- [User Guide](https://docs.qbraid.com/v2/cli/user-guide/overview)
|
|
12
|
+
- [API Reference](https://docs.qbraid.com/v2/cli/api-reference/qbraid)
|
|
17
13
|
|
|
18
14
|
## Getting Started
|
|
19
15
|
|
|
@@ -22,7 +18,7 @@ The qBraid-CLI comes pre-installed and pre-configured in qBraid Lab:
|
|
|
22
18
|
- [Launch qBraid Lab →](https://lab.qbraid.com/)
|
|
23
19
|
- [Make an account →](https://account.qbraid.com/)
|
|
24
20
|
|
|
25
|
-
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/lab/user-guide/getting-started).
|
|
21
|
+
For help, see qBraid Lab User Guide: [Getting Started](https://docs.qbraid.com/v2/lab/user-guide/getting-started).
|
|
26
22
|
|
|
27
23
|
You can also install the qBraid-CLI from PyPI with:
|
|
28
24
|
|
|
@@ -30,7 +26,7 @@ You can also install the qBraid-CLI from PyPI with:
|
|
|
30
26
|
pip install qbraid-cli
|
|
31
27
|
```
|
|
32
28
|
|
|
33
|
-
To manage qBraid [environments](https://docs.qbraid.com/lab/user-guide/environments) using the CLI, you must also install the `envs` extra:
|
|
29
|
+
To manage qBraid [environments](https://docs.qbraid.com/v2/lab/user-guide/environments) using the CLI, you must also install the `envs` extra:
|
|
34
30
|
|
|
35
31
|
```bash
|
|
36
32
|
pip install 'qbraid-cli[envs]'
|
|
@@ -44,13 +40,13 @@ After installation, you must configure your account credentials to use the CLI l
|
|
|
44
40
|
[account.qbraid.com](https://account.qbraid.com/)
|
|
45
41
|
2. Copy your API Key token from the left side of
|
|
46
42
|
your [account page](https://account.qbraid.com/):
|
|
47
|
-
3. Save your API key from step 2 in local [configuration file](https://docs.qbraid.com/cli/user-guide/config-files) `~/.qbraid/qbraidrc` using:
|
|
43
|
+
3. Save your API key from step 2 in local [configuration file](https://docs.qbraid.com/v2/cli/user-guide/config-files) `~/.qbraid/qbraidrc` using:
|
|
48
44
|
|
|
49
45
|
```bash
|
|
50
46
|
$ qbraid configure
|
|
51
47
|
```
|
|
52
48
|
|
|
53
|
-
For more on API keys, see [documentation](https://docs.qbraid.com/home/account#api-keys).
|
|
49
|
+
For more on API keys, see [documentation](https://docs.qbraid.com/v2/home/account#api-keys).
|
|
54
50
|
|
|
55
51
|
## Basic Commands
|
|
56
52
|
|
|
@@ -72,7 +68,7 @@ $ qbraid
|
|
|
72
68
|
|
|
73
69
|
- Use 'qbraid --version' to see the current version.
|
|
74
70
|
|
|
75
|
-
Reference Docs: https://docs.qbraid.com/cli/api-reference/qbraid
|
|
71
|
+
Reference Docs: https://docs.qbraid.com/v2/cli/api-reference/qbraid
|
|
76
72
|
```
|
|
77
73
|
|
|
78
74
|
A qBraid CLI command has the following structure:
|
|
@@ -115,10 +111,8 @@ Commands
|
|
|
115
111
|
admin CI/CD commands for qBraid maintainers.
|
|
116
112
|
configure Configure qBraid CLI options.
|
|
117
113
|
account Manage qBraid account.
|
|
118
|
-
chat Interact with qBraid AI chat service.
|
|
119
114
|
devices Manage qBraid quantum devices.
|
|
120
115
|
envs Manage qBraid environments.
|
|
121
|
-
files Manage qBraid cloud storage files.
|
|
122
116
|
jobs Manage qBraid quantum jobs.
|
|
123
117
|
kernels Manage qBraid kernels.
|
|
124
118
|
mcp MCP (Model Context Protocol) aggregator commands.
|
|
@@ -133,7 +127,7 @@ $ qbraid --version
|
|
|
133
127
|
|
|
134
128
|
## Magic Commands
|
|
135
129
|
|
|
136
|
-
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
130
|
+
You can also access the CLI directly from within [Notebooks](https://docs.qbraid.com/v2/lab/user-guide/notebooks) using IPython [magic commands](https://ipython.readthedocs.io/en/stable/interactive/magics.html). First, configure the qBraid magic commands extension using:
|
|
137
131
|
|
|
138
132
|
```bash
|
|
139
133
|
$ qbraid configure magic
|
|
@@ -148,5 +142,5 @@ In [1]: %load_ext qbraid_magic
|
|
|
148
142
|
Now you can continue to use the qBraid-CLI as normal from within your Jupyter notebook using the magic ``%`` operator, e.g.
|
|
149
143
|
|
|
150
144
|
```python
|
|
151
|
-
In [2]: %qbraid
|
|
145
|
+
In [2]: %qbraid jobs list
|
|
152
146
|
```
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qbraid-cli"
|
|
7
|
-
version = "0.12.
|
|
7
|
+
version = "0.12.1"
|
|
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,20 +32,19 @@ dependencies = [
|
|
|
32
32
|
"typer>=0.12.1",
|
|
33
33
|
"rich>=10.11.0",
|
|
34
34
|
"click<=8.1.8",
|
|
35
|
-
"qbraid-core
|
|
35
|
+
"qbraid-core>=0.2.0",
|
|
36
36
|
]
|
|
37
37
|
requires-python = ">= 3.9"
|
|
38
38
|
|
|
39
39
|
[project.urls]
|
|
40
|
-
Homepage = "https://docs.qbraid.com/cli/user-guide/overview"
|
|
41
|
-
Documentation = "https://docs.qbraid.com/cli/api-reference/qbraid"
|
|
40
|
+
Homepage = "https://docs.qbraid.com/v2/cli/user-guide/overview"
|
|
41
|
+
Documentation = "https://docs.qbraid.com/v2/cli/api-reference/qbraid"
|
|
42
42
|
"Bug Tracker" = "https://github.com/qBraid/community/issues"
|
|
43
43
|
Discord = "https://discord.gg/KugF6Cnncm"
|
|
44
44
|
|
|
45
45
|
[project.optional-dependencies]
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
mcp = ["qbraid-core[mcp]>=0.2.0a0"]
|
|
46
|
+
envs = ["qbraid-core[environments]>=0.2.0"]
|
|
47
|
+
mcp = ["qbraid-core[mcp]>=0.2.0"]
|
|
49
48
|
dev = ["isort", "black", "pytest", "pytest-cov", "pytest-asyncio"]
|
|
50
49
|
|
|
51
50
|
[project.scripts]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Copyright (c) 2026, qBraid Development Team
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
Module defining commands in the 'qbraid user' namespace.
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import rich
|
|
10
|
+
import typer
|
|
11
|
+
|
|
12
|
+
from qbraid_cli.handlers import run_progress_task
|
|
13
|
+
|
|
14
|
+
account_app = typer.Typer(help="Manage qBraid account.", no_args_is_help=True)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@account_app.command(name="credits")
|
|
18
|
+
def account_credits():
|
|
19
|
+
"""Get number of qBraid credits remaining."""
|
|
20
|
+
|
|
21
|
+
def get_credits() -> float:
|
|
22
|
+
from qbraid_core.client import QbraidClientV1
|
|
23
|
+
|
|
24
|
+
client = QbraidClientV1()
|
|
25
|
+
return client.user_credits_value()
|
|
26
|
+
|
|
27
|
+
qbraid_credits: float = run_progress_task(get_credits)
|
|
28
|
+
typer.secho(
|
|
29
|
+
f"{typer.style('qBraid credits remaining:')} "
|
|
30
|
+
f"{typer.style(f'{qbraid_credits:.4f}', fg=typer.colors.MAGENTA, bold=True)}",
|
|
31
|
+
nl=True, # Ensure a newline after output (default is True)
|
|
32
|
+
)
|
|
33
|
+
rich.print("\nFor more information, visit: https://docs.qbraid.com/v2/home/pricing#credits")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
account_app()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c)
|
|
1
|
+
# Copyright (c) 2026, qBraid Development Team
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
"""
|
|
@@ -25,8 +25,6 @@ from rich.console import Console
|
|
|
25
25
|
|
|
26
26
|
from qbraid_cli.handlers import handle_filesystem_operation
|
|
27
27
|
|
|
28
|
-
QBRAID_ORG_MODEL_ENABLED = False # Set to True if organization/workspace model is enabled
|
|
29
|
-
|
|
30
28
|
|
|
31
29
|
def validate_input(key: str, value: str) -> str:
|
|
32
30
|
"""Validate the user input based on the key.
|
|
@@ -50,7 +48,8 @@ def validate_input(key: str, value: str) -> str:
|
|
|
50
48
|
if not re.match(r"^\S+@\S+\.\S+$", value):
|
|
51
49
|
raise typer.BadParameter("Invalid email format.")
|
|
52
50
|
elif key == "api-key":
|
|
53
|
-
|
|
51
|
+
# Support legacy alphanumeric keys and new qbr_<hex> format
|
|
52
|
+
if not re.match(r"^(qbr_[a-zA-Z0-9]+|[a-zA-Z0-9]+)$", value):
|
|
54
53
|
raise typer.BadParameter("Invalid API key format.")
|
|
55
54
|
return value
|
|
56
55
|
|
|
@@ -99,21 +98,10 @@ def default_action(section: str = DEFAULT_CONFIG_SECTION):
|
|
|
99
98
|
default_values = {
|
|
100
99
|
"url": DEFAULT_ENDPOINT_URL,
|
|
101
100
|
}
|
|
102
|
-
if QBRAID_ORG_MODEL_ENABLED:
|
|
103
|
-
default_values["organization"] = DEFAULT_ORGANIZATION
|
|
104
|
-
default_values["workspace"] = DEFAULT_WORKSPACE
|
|
105
101
|
|
|
106
102
|
config[section]["url"] = prompt_for_config(config, section, "url", default_values)
|
|
107
103
|
config[section]["api-key"] = prompt_for_config(config, section, "api-key", default_values)
|
|
108
104
|
|
|
109
|
-
if QBRAID_ORG_MODEL_ENABLED:
|
|
110
|
-
config[section]["organization"] = prompt_for_config(
|
|
111
|
-
config, section, "organization", default_values
|
|
112
|
-
)
|
|
113
|
-
config[section]["workspace"] = prompt_for_config(
|
|
114
|
-
config, section, "workspace", default_values
|
|
115
|
-
)
|
|
116
|
-
|
|
117
105
|
for key in list(config[section]):
|
|
118
106
|
if not config[section][key]:
|
|
119
107
|
del config[section][key]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c)
|
|
1
|
+
# Copyright (c) 2026, qBraid Development Team
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
"""
|
|
@@ -6,38 +6,76 @@ Module defining commands in the 'qbraid devices' namespace.
|
|
|
6
6
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
from enum import Enum
|
|
9
10
|
from typing import Any, Optional
|
|
10
11
|
|
|
11
12
|
import typer
|
|
13
|
+
from qbraid_core.services.runtime.schemas import DeviceStatus
|
|
12
14
|
from rich.console import Console
|
|
13
15
|
|
|
14
|
-
from qbraid_cli.devices.validation import
|
|
16
|
+
from qbraid_cli.devices.validation import validate_type
|
|
15
17
|
from qbraid_cli.handlers import print_formatted_data, run_progress_task
|
|
16
18
|
|
|
17
19
|
devices_app = typer.Typer(help="Manage qBraid quantum devices.", no_args_is_help=True)
|
|
18
20
|
|
|
19
21
|
|
|
22
|
+
def _provider_from_qrn(qrn: str) -> str:
|
|
23
|
+
"""Extract provider from QRN. Format: vendor:provider:qpu|sim:name."""
|
|
24
|
+
parts = qrn.split(":")
|
|
25
|
+
return parts[1].lower() if len(parts) > 1 else ""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DeviceVendor(str, Enum):
|
|
29
|
+
"""Vendor filter for device listing."""
|
|
30
|
+
|
|
31
|
+
AWS = "aws"
|
|
32
|
+
AZURE = "azure"
|
|
33
|
+
IBM = "ibm"
|
|
34
|
+
IONQ = "ionq"
|
|
35
|
+
QBRAID = "qbraid"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class DeviceProvider(str, Enum):
|
|
39
|
+
"""Provider filter for device listing."""
|
|
40
|
+
|
|
41
|
+
AQT = "aqt"
|
|
42
|
+
AWS = "aws"
|
|
43
|
+
AZURE = "azure"
|
|
44
|
+
EQUAL1 = "equal1"
|
|
45
|
+
IBM = "ibm"
|
|
46
|
+
IQM = "iqm"
|
|
47
|
+
IONQ = "ionq"
|
|
48
|
+
NEC = "nec"
|
|
49
|
+
OQC = "oqc"
|
|
50
|
+
PASQAL = "pasqal"
|
|
51
|
+
QUANTINUUM = "quantinuum"
|
|
52
|
+
QUERA = "quera"
|
|
53
|
+
RIGETTI = "rigetti"
|
|
54
|
+
QBRAID = "qbraid"
|
|
55
|
+
|
|
56
|
+
|
|
20
57
|
@devices_app.command(name="list")
|
|
21
58
|
def devices_list(
|
|
22
|
-
status: Optional[
|
|
59
|
+
status: Optional[DeviceStatus] = typer.Option(
|
|
23
60
|
None,
|
|
24
61
|
"--status",
|
|
25
62
|
"-s",
|
|
26
|
-
help="'
|
|
27
|
-
callback=validate_status,
|
|
63
|
+
help=f"Filter by status: {', '.join(e.name for e in DeviceStatus)}",
|
|
28
64
|
),
|
|
29
65
|
device_type: Optional[str] = typer.Option(
|
|
30
66
|
None, "--type", "-t", help="'QPU'|'SIMULATOR'", callback=validate_type
|
|
31
67
|
),
|
|
32
|
-
|
|
68
|
+
vendor: Optional[DeviceVendor] = typer.Option(
|
|
69
|
+
None,
|
|
70
|
+
"--vendor",
|
|
71
|
+
"-v",
|
|
72
|
+
help=f"Filter by vendor: {', '.join(e.name for e in DeviceVendor)}",
|
|
73
|
+
),
|
|
74
|
+
provider: Optional[DeviceProvider] = typer.Option(
|
|
33
75
|
None,
|
|
34
76
|
"--provider",
|
|
35
77
|
"-p",
|
|
36
|
-
help=(
|
|
37
|
-
"'AWS'|'IBM'|'IonQ'|'Rigetti'|'OQC'|'QuEra'|'IQM'|"
|
|
38
|
-
"'NEC'|'qBraid'|'Azure'|'Pasqal'|'Quantinuum'|'Equal1'"
|
|
39
|
-
),
|
|
40
|
-
callback=validate_provider,
|
|
78
|
+
help=f"Filter by provider: {', '.join(e.name for e in DeviceProvider)}",
|
|
41
79
|
),
|
|
42
80
|
) -> None:
|
|
43
81
|
"""List qBraid quantum devices."""
|
|
@@ -51,21 +89,24 @@ def devices_list(
|
|
|
51
89
|
devices = run_progress_task(fetch_devices)
|
|
52
90
|
|
|
53
91
|
# Apply filters (client returns all devices, we filter locally)
|
|
54
|
-
if status:
|
|
55
|
-
devices = [d for d in devices if d.status
|
|
92
|
+
if status is not None:
|
|
93
|
+
devices = [d for d in devices if d.status == status]
|
|
56
94
|
if device_type:
|
|
57
95
|
devices = [d for d in devices if d.deviceType == device_type]
|
|
58
|
-
if
|
|
59
|
-
devices = [d for d in devices if d.vendor.lower() ==
|
|
96
|
+
if vendor is not None:
|
|
97
|
+
devices = [d for d in devices if d.vendor.lower() == vendor.value]
|
|
98
|
+
if provider is not None:
|
|
99
|
+
devices = [d for d in devices if _provider_from_qrn(d.qrn) == provider.value]
|
|
60
100
|
|
|
61
101
|
console = Console()
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
102
|
+
# Full QRNs, no truncation; column width from longest QRN in results
|
|
103
|
+
col_gap = 3
|
|
104
|
+
longest_qrn = max((len(d.qrn) for d in devices), default=len("Device QRN"))
|
|
105
|
+
qrn_width = longest_qrn + col_gap
|
|
106
|
+
status_width = 12
|
|
107
|
+
header_qrn = "Device QRN"
|
|
108
|
+
header_status = "Status"
|
|
109
|
+
console.print(f"[bold]{header_qrn.ljust(qrn_width)}{header_status.ljust(status_width)}[/bold]")
|
|
69
110
|
|
|
70
111
|
for device in devices:
|
|
71
112
|
device_status = device.status.value
|
|
@@ -78,13 +119,8 @@ def devices_list(
|
|
|
78
119
|
else:
|
|
79
120
|
status_color = "grey"
|
|
80
121
|
|
|
81
|
-
# Truncate long names/qrns for display
|
|
82
|
-
name = device.name[:33] + ".." if len(device.name) > 35 else device.name
|
|
83
|
-
qrn = device.qrn[:48] + ".." if len(device.qrn) > 50 else device.qrn
|
|
84
|
-
|
|
85
122
|
console.print(
|
|
86
|
-
f"{device.
|
|
87
|
-
f"[{status_color}]{device_status}[/{status_color}]",
|
|
123
|
+
f"{device.qrn.ljust(qrn_width)}[{status_color}]{device_status.ljust(status_width)}[/{status_color}]"
|
|
88
124
|
)
|
|
89
125
|
|
|
90
126
|
console.print(f"\n[italic]Displaying {len(devices)} devices[/italic]")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c)
|
|
1
|
+
# Copyright (c) 2026, qBraid Development Team
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
"""
|
|
@@ -19,12 +19,3 @@ def validate_status(value: Optional[str]) -> Union[str, None]:
|
|
|
19
19
|
def validate_type(value: Optional[str]) -> Union[str, None]:
|
|
20
20
|
"""Validate device type query parameter."""
|
|
21
21
|
return validate_item(value, ["QPU", "SIMULATOR"], "Type")
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def validate_provider(value: Optional[str]) -> Union[str, None]:
|
|
25
|
-
"""Validate device provider query parameter."""
|
|
26
|
-
return validate_item(
|
|
27
|
-
value,
|
|
28
|
-
["aws", "azure", "ibm", "ionq", "qbraid"],
|
|
29
|
-
"Provider",
|
|
30
|
-
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c)
|
|
1
|
+
# Copyright (c) 2026, qBraid Development Team
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
"""
|
|
@@ -15,7 +15,7 @@ import typer
|
|
|
15
15
|
def find_shell_rc(shell_path: str) -> str:
|
|
16
16
|
"""Finds an existing shell configuration file in the user's home directory."""
|
|
17
17
|
shell_name = Path(shell_path).name
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
if "bash" in shell_name:
|
|
20
20
|
possible_files = [".bashrc", ".bash_profile", ".bash_login"]
|
|
21
21
|
elif "zsh" in shell_name:
|
|
@@ -56,22 +56,22 @@ def activate_pyvenv(venv_path: Path):
|
|
|
56
56
|
if shell_path is None:
|
|
57
57
|
print_activate_command(venv_path)
|
|
58
58
|
return # Return early since we can't proceed without a shell
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
shell_name = Path(shell_path).name
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
try:
|
|
63
63
|
shell_rc = find_shell_rc(shell_path)
|
|
64
64
|
except (FileNotFoundError, ValueError):
|
|
65
65
|
print_activate_command(venv_path)
|
|
66
66
|
return # Return early since no suitable shell rc file was found
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
bin_path = str(venv_path / "bin")
|
|
69
69
|
activate_script = f"{bin_path}/activate"
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
# Combine shell rc and activate script, then launch new shell
|
|
72
72
|
# This works for both bash and zsh
|
|
73
73
|
combined_script = f"{bin_path}/activate2"
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
# Create combined script with shell rc and activate script
|
|
76
76
|
with open(combined_script, "w") as f:
|
|
77
77
|
f.write(f"# Combined shell rc and activate script\n")
|
|
@@ -80,13 +80,11 @@ def activate_pyvenv(venv_path: Path):
|
|
|
80
80
|
f.write(f"\n# Activate virtual environment\n")
|
|
81
81
|
with open(activate_script, "r") as act:
|
|
82
82
|
f.write(act.read())
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
if "zsh" in shell_name:
|
|
85
85
|
# For zsh, use -d to skip global zshenv/zshrc, then source our combined file
|
|
86
86
|
# Then exec zsh to get an interactive shell
|
|
87
|
-
os.system(
|
|
88
|
-
f"{shell_path} -d -c 'source {combined_script}; exec zsh'"
|
|
89
|
-
)
|
|
87
|
+
os.system(f"{shell_path} -d -c 'source {combined_script}; exec zsh'")
|
|
90
88
|
elif "bash" in shell_name:
|
|
91
89
|
# For bash, use --rcfile
|
|
92
90
|
os.system(f"{shell_path} --rcfile {combined_script}")
|