Hello, is it possible to make the prefect CLI (I h...
# prefect-community
d
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
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
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
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
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
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