Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Draft
frankharkins wants to merge32 commits intoQiskit:main
base:main
Choose a base branch
Loading
fromfrankharkins:FH/cli

Conversation

@frankharkins
Copy link
Member

@frankharkinsfrankharkins commentedDec 2, 2024
edited
Loading

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.

Withqiskit-ibm-runtime installed, users will be able to run the following command to start the CLI.

qiskit-ibm-runtime save-account

This should also be compatible withpipx run, so users will be able to runpipx run qiskit-ibm-runtime save-account from any environment.

Examples

Here's a screenshot of me saving my account correctly.

Screenshot 2024-12-02 at 20 35 29

Here's the output of--help:

(.venv) ~ $ qiskit-ibm-runtime --help      usage: qiskit-ibm-runtime [-h] {save-account} ...Scripts for the Qiskit IBM Runtime Python packageoptions:  -h, --help      show this help message and exitScripts:  This package supports the following scripts:  {save-account}    save-account  Interactive command-line interface to save your account locally.

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 underQiskitRuntimeService.save_account recommending this instead? When released, we can update the guides.

Eric-Arellano reacted with heart emoji
@frankharkinsfrankharkins marked this pull request as ready for reviewDecember 2, 2024 21:18
Copy link
Collaborator

@Eric-ArellanoEric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is lovely!

frankharkins reacted with heart emoji
frankharkinsand others added11 commitsDecember 5, 2024 13:29
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
Eric-Arellano previously approved these changesDec 17, 2024
Copy link
Collaborator

@Eric-ArellanoEric-Arellano left a 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!

frankharkins reacted with heart emoji
frankharkinsand others added3 commitsDecember 18, 2024 09:30
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
Copy link
Member

Thanks@frankharkins, this looks great! I think for the documentation we should update the docstring insave_account and also add a release note explaining the purpose of the CLI and how to use it.

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:
Screenshot 2024-12-18 at 5 48 50 PM

There may be an issue with how the cloud instances are returned.

frankharkins reacted with heart emoji

@frankharkins
Copy link
MemberAuthor

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.

Eric-Arellano and ElePT reacted with thumbs up emoji

@frankharkinsfrankharkins marked this pull request as draftApril 16, 2025 08:18
@ElePTElePT added enhancementNew feature or request on hold labelsJul 16, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Eric-ArellanoEric-ArellanoEric-Arellano left review comments

@kt474kt474Awaiting requested review from kt474

@jyu00jyu00Awaiting requested review from jyu00

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

enhancementNew feature or requeston hold

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Consider CLI for saving account

4 participants

@frankharkins@kt474@Eric-Arellano@ElePT

[8]ページ先頭

©2009-2025 Movatter.jp