https://prefect.io logo
#prefect-community
Title
# prefect-community
d

David Cupp

09/22/2022, 3:45 PM
Hello, is it possible to make the prefect CLI (I have version
2.4.0
) output text without the fancy borders and column headers? I would like to pass the output through awk, e.g.
prefect deployment ls | awk '(extract deployment id)' | xargs -n 1 (some command)
1
z

Zanie

09/22/2022, 3:49 PM
I expected
TERM=dumb
to do this per https://rich.readthedocs.io/en/stable/console.html#environment-variables but it doesn’t seem to work
👀 1
d

David Cupp

09/22/2022, 3:51 PM
Yeah I tried just piping it to grep, or a tmp file, because other tools with automagically detect that, but it didn't work either
z

Zanie

09/22/2022, 3:56 PM
Unfortunately I don’t see a workaround for this. There’s no toggle in the Rich console to display things differently, we’ll have to build our own toggle.
d

David Cupp

09/22/2022, 3:57 PM
Thanks for looking. I will add a feature request. Worst case scenario, I can just write my own CLI
in case anyone finds this via search: https://github.com/PrefectHQ/prefect/issues/6930
j

Justin Trautmann

09/23/2022, 7:27 AM
i had the same problem a while back when manipulating deployments via the CI and decided to use the REST API directly:
curl -s -X POST "$PREFECT_API_URL/deployments/filter" -H "Authorization: Bearer $PREFECT_API_KEY" | jq -r '.[] | .id' | xargs -n 1 echo