https://prefect.io logo
Title
d

Danilo Drobac

01/18/2023, 7:24 PM
Hey folks - trying to authenticate with prefect Cloud via a startup script on a VM with the following command:
prefect cloud login -k PREFECT_API_KEY
and I'm getting the following error:
When not using an interactive terminal, you must supply a `--key` and `--workspace`
Do I have to hardcode a workspace for this to work?
1
z

Zanie

01/18/2023, 7:25 PM
Hey! Yes you need to select a workspace. What’s your expectation otherwise?
d

Danilo Drobac

01/18/2023, 7:25 PM
When I ran it before, it defaulted to the only workspace I had available in Prefect Cloud.
z

Zanie

01/18/2023, 7:26 PM
I see, that’s pretty reasonable 🙂
Right now we’re just checking right at the start of the command https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/cloud.py#L303
d

Danilo Drobac

01/18/2023, 7:27 PM
It's not an issue or difficult to fix, I was just surprised at the error when it didn't happen when running the commands individually instead
z

Zanie

01/18/2023, 7:27 PM
We already have logic for retrieving workspaces, so we probably just want to make that check later
Interested in contributing? 🙂
d

Danilo Drobac

01/18/2023, 7:28 PM
I've never contributed to a repo before, but I'd absolutely give it a go! Where do I start?
z

Zanie

01/18/2023, 7:41 PM
Sweet! This one will be a little tricky because there’s a lot going on in that command.
We have a little bit of documentation at https://docs.prefect.io/contributing/overview/
Basically: • Download the repository • Make the changes • Add test coverage for the change, you can run just the relevant tests with
pytest tests/cli/test_cloud.py
• Push the changes to a fork and open a pull request (this is much easier with the
gh
CLI)
Happy to help you work through anything 🙂
👍 1
d

Danilo Drobac

01/18/2023, 7:44 PM
Awesome, I'll read through that and give it a go on the weekend (time pending)
z

Zanie

01/18/2023, 7:45 PM
You can also open an issue which would give us a good place for communication / other people can help out.