dwave-cloud-client icon indicating copy to clipboard operation
dwave-cloud-client copied to clipboard

Add `--raw`/`-r` option to "get token" CLI commands

Open randomir opened this issue 2 years ago • 0 comments

Currently, to fetch a specific project's SAPI token (for use in scripting), one can write:

dwave leap project token --project CODE --json | jq .token -r

and then use it like this, for example, to list available solvers:

DWAVE_API_TOKEN=$(dwave leap project token --project CODE --json | jq .token -r) dwave solvers -la

We can simplify the JSON filtering part, though, by introducing --raw/-r option that returns raw token string:

$ dwave leap project token --project CODE --raw
a66...fe

Similarly for dwave auth get <token-type> command.

randomir avatar Nov 30 '23 10:11 randomir