Cortex CLI
The iqm-cortex-cli package is deprecated and the GitHub repository has been archived. New versions of Cortex CLI will be published as part of the iqm-client package as IQM Client CLI and can be installed from public PyPI with pip install iqm-client[cli]. See the latest documentation at https://docs.meetiqm.com/iqm-client/user_guide_cli.html for more information. The source code is available as part of the iqm-client package and a public mirror of the source code is available at https://github.com/iqm-finland/sdk. For support, you can contact support@meetiqm.com.
Command-line interface (CLI) for managing user authentication when using IQM quantum computers.
Installing Cortex CLI
Requirements for installing:
Python 3.9-3.11
$ pip install iqm-cortex-cli
Using Cortex CLI
For general usage instructions, run
$ cortex --help
Initialization
First, Cortex CLI needs initialization, which produces a configuration file:
$ cortex init
Cortex CLI will ask a few questions. You can also pass the values via command line to avoid having an interactive prompt. See cortex init --help for details.
Login
To log in, use
$ cortex auth login
This will ask you to enter your username and password. If you have a temporary password you will be asked to go to the authentication server and enter a new password. URL of the authentication server will be provided.
After a successful authentication, tokens will be saved into a tokens file (path specified in the configuration file), and a token manager daemon will start in the background. Token manager will periodically refresh the session and re-write the tokens file.
To use the token manager in a foreground mode (not as daemon), run cortex auth login --no-daemon. This requires keeping the shell session alive. However, you can start the process in the background by adding & after the command: cortex auth login --no-daemon &. This applies to Bash, zsh and similar shells, but may not be available on all shells.
To login and get tokens once, without starting a token manager at all, run cortex auth login --no-refresh.
If the tokens file already exists, then running cortex auth login will first attempt to refresh the session without asking you for a username and password. If that fails (because existing tokens may already have expired), you’ll be asked to re-enter your credentials.
See cortex auth login --help for more details.
Use with Cirq on IQM, Qiskit on IQM, etc.
Adapters based on IQM Client, such as Cirq on IQM and Qiskit on IQM, can take advantage of the tokens file maintained by Cortex CLI. This way you won’t need to provide the authentication server URL, username, or password to the adapter library itself. To achieve this, follow the instructions printed on the screen after running cortex auth login. Namely, set the IQM_TOKENS_FILE environment variable to point to your tokens file.
On Linux:
$ export IQM_TOKENS_FILE=/home/<username>/tokens.json
On Windows:
set IQM_TOKENS_FILE=C:\Users\<username>\.cache\iqm-cortex-cli\tokens.json
Once set, this environment variable is read by the instance of IQM Client associated with the adapter. As a result, from the point of view of the adapter it looks like authentication is simply not required (i.e. no authentication-related information has to be provided to the adapter).
Status
To see the current status of the token manager, use:
$ cortex auth status
If the tokens file exists, cortex auth status will report whether the corresponding token manager is running. It will also print the time of the last successful refresh request, and how much time is left until current tokens expire.
See cortex auth status --help for more details.
Logout
To log out, run
$ cortex auth logout
This will send a logout request to the authentication server, kill the token manager daemon (if any), and delete the tokens file.
You may want to stop the token manager, but maintain the session on the server and keep the tokens file intact. To do so, run:
$ cortex auth logout --keep-tokens
See cortex auth logout --help for more details.
Multiple configuration files
By default, all Cortex CLI commands read the configuration file from the default location ~/.config/iqm-cortex-cli/config.json. You can specify a different filepath by providing the --config-file value, for example:
$ cortex auth status --config-file /home/joe/config.json
$ cortex auth login --config-file /home/joe/config.json
$ cortex auth logout --config-file /home/joe/config.json
Metadata
Release files for iqm-cortex-cli 6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iqm_cortex_cli-6.1.tar.gz | 667.4 kB | Without provenance | Details for iqm_cortex_cli-6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iqm_cortex_cli-6.1-py3-none-any.whl | Python 3 | none | any | Details for iqm_cortex_cli-6.1-py3-none-any.whl |
Total release size: 693.8 kB
Release files / iqm_cortex_cli-6.1.tar.gz
| Download URL | iqm_cortex_cli-6.1.tar.gz |
|---|---|
| Size | 667.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb9348568e93b84ddc95cd2b1e0af55a947337d51d4776299106abd6d6a104ef
|
|
BLAKE2b-256 checksum How to use checksums |
2c35928bba905196dbd66389d4753664d0370cff94f57653be1a89a469f55e5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / iqm_cortex_cli-6.1-py3-none-any.whl
| Download URL | iqm_cortex_cli-6.1-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3732302c685b71cc9aad9a570d9afd8ab3ef56fa9a57aacaae01c8bab4b2982
|
|
BLAKE2b-256 checksum How to use checksums |
c8a8c13ad369d65f71e6e9b9c95f78a3d0773eb60e409f7c0b4c1a99356296ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for iqm-cortex-cli 6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.