Hey folks - trying to authenticate with prefect Cl...
# ask-community
d
Hey folks - trying to authenticate with prefect Cloud via a startup script on a VM with the following command:
Copy code
prefect cloud login -k PREFECT_API_KEY
and I'm getting the following error:
Copy code
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
Hey! Yes you need to select a workspace. What’s your expectation otherwise?
d
When I ran it before, it defaulted to the only workspace I had available in Prefect Cloud.
z
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
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
We already have logic for retrieving workspaces, so we probably just want to make that check later
Interested in contributing? 🙂
d
I've never contributed to a repo before, but I'd absolutely give it a go! Where do I start?
z
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
Awesome, I'll read through that and give it a go on the weekend (time pending)
z
You can also open an issue which would give us a good place for communication / other people can help out.
202 Views