Can we delete multiple workspace in one CLI Command ?

I need suppressing automatically multiple workspace in same time. I know the command to delete one workspace is
coder delete [workspace-id(username/workspacename)] --yes
coder delete [workspace-id(username/workspacename)] --yes
but to delete multiple workspace I did found.... Someone can help me please ?
5 Replies
Codercord
Codercord14mo ago
<#1300399758124519464>
Category
Help needed
Product
code-server
Platform
Linux
Logs
Please post any relevant logs/error messages.
zounce
zounce14mo ago
I don't believe you can on the CLI, so feel free to make a feature request on GitHub. In most shells however you can just run multiple commands simultaneously:
coder delete ws1 --yes &
coder delete ws2 --yes &
wait
coder delete ws1 --yes &
coder delete ws2 --yes &
wait
will delete both workspaces at the same time and then the wait will wait for them both commands to finish
zounce
zounce14mo ago
On the Web UI you could also use the boxes and then actions
No description
No description
stephane
stephaneOP14mo ago
Ok I'll test it, thank you Ethan
matifali
matifali14mo ago
You could also do something like
coder ls -c workspace --search "owner:me status:stopped" | awk 'NR>1' | xargs -n 1 coder delete --yes
coder ls -c workspace --search "owner:me status:stopped" | awk 'NR>1' | xargs -n 1 coder delete --yes

Did you find this page helpful?