- Notifications
You must be signed in to change notification settings - Fork193
Add interactive CLI to save user account#2066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Eric-Arellano left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is lovely!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Needs to be above SaveAccountCLI so it's defined when we use it in typehints. I did this in a separate commit to make the changes clearer.
Eric-Arellano left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This looks great from my perspective!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
So we see the full docstring when tests fail
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
kt474 commentedDec 18, 2024
Thanks@frankharkins, this looks great! I think for the documentation we should update the docstring in I was testing the tool and it works well with my IQP production accounts but it didn't seem to work for staging accounts - I'm guessing this is intended because external users won't have staging accounts? I was also running into issues with trying to save a cloud account: There may be an issue with how the cloud instances are returned. |
frankharkins commentedApr 16, 2025
I would like to continue this, but I don't have the bandwidth right now. I will wait until IQP account logic is removed and pick this back up then to be cloud-only. |

Uh oh!
There was an error while loading.Please reload this page.
Summary
Closes#2054.
This PR adds an interactive command-line interface (CLI) that guides users through saving their account to disk. This should be easier for users as they can just run one command and be guided through the relevant choices, and it should be more secure as they're discouraged from storing their token in code they might share.
With
qiskit-ibm-runtimeinstalled, users will be able to run the following command to start the CLI.This should also be compatible with
pipx run, so users will be able to runpipx run qiskit-ibm-runtime save-accountfrom any environment.Examples
Here's a screenshot of me saving my account correctly.
Here's the output of
--help:Questions
What should I add to the documentation? I don't think it belongs in the API documentation in this repo as we don't want users to import these functions. Maybe we can add a note under
QiskitRuntimeService.save_accountrecommending this instead? When released, we can update the guides.